From db22e73c2d0cb6ad5f527741d696621af97befba Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 16 Nov 2023 17:15:14 +1300 Subject: [PATCH 01/60] Fix between query output --- README.md | 2 +- appwrite/client.py | 4 +- appwrite/query.py | 2 +- appwrite/services/account.py | 40 +++---- appwrite/services/avatars.py | 14 +-- appwrite/services/databases.py | 84 +++++++------- appwrite/services/functions.py | 38 +++--- appwrite/services/graphql.py | 4 +- appwrite/services/health.py | 115 ++++++++++++++++--- appwrite/services/locale.py | 14 +-- appwrite/services/storage.py | 20 ++-- appwrite/services/teams.py | 26 ++--- appwrite/services/users.py | 52 ++++----- docs/examples/health/get-queue-builds.md | 14 +++ docs/examples/health/get-queue-databases.md | 14 +++ docs/examples/health/get-queue-deletes.md | 14 +++ docs/examples/health/get-queue-mails.md | 14 +++ docs/examples/health/get-queue-messaging.md | 14 +++ docs/examples/health/get-queue-migrations.md | 14 +++ setup.py | 4 +- 20 files changed, 337 insertions(+), 166 deletions(-) create mode 100644 docs/examples/health/get-queue-builds.md create mode 100644 docs/examples/health/get-queue-databases.md create mode 100644 docs/examples/health/get-queue-deletes.md create mode 100644 docs/examples/health/get-queue-mails.md create mode 100644 docs/examples/health/get-queue-messaging.md create mode 100644 docs/examples/health/get-queue-migrations.md diff --git a/README.md b/README.md index 86bb1c4..9dd9d0c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.4.2-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.4.12-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index 73f97c1..84e0fbd 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -11,11 +11,11 @@ def __init__(self): self._endpoint = 'https://HOSTNAME/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/4.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/4.0.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '4.0.0', + 'x-sdk-version': '4.0.1', 'X-Appwrite-Response-Format' : '1.4.0', } diff --git a/appwrite/query.py b/appwrite/query.py index da63672..d970bd8 100644 --- a/appwrite/query.py +++ b/appwrite/query.py @@ -33,7 +33,7 @@ def is_not_null(attribute): @staticmethod def between(attribute, start, end): - return Query.add_query(attribute, "between", [start, end]) + return f'between("{attribute}", {Query.parseValues(start)}, {Query.parseValues(end)})' @staticmethod def starts_with(attribute, value): diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 29ab85c..278d890 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -7,7 +7,7 @@ def __init__(self, client): super(Account, self).__init__(client) def get(self): - """Get Account""" + """Get account""" api_path = '/account' @@ -18,7 +18,7 @@ def get(self): }, api_params) def update_email(self, email, password): - """Update Email""" + """Update email""" api_path = '/account/email' @@ -67,7 +67,7 @@ def delete_identity(self, identity_id): }, api_params) def list_logs(self, queries = None): - """List Logs""" + """List logs""" api_path = '/account/logs' @@ -80,7 +80,7 @@ def list_logs(self, queries = None): }, api_params) def update_name(self, name): - """Update Name""" + """Update name""" api_path = '/account/name' @@ -96,7 +96,7 @@ def update_name(self, name): }, api_params) def update_password(self, password, old_password = None): - """Update Password""" + """Update password""" api_path = '/account/password' @@ -113,7 +113,7 @@ def update_password(self, password, old_password = None): }, api_params) def update_phone(self, phone, password): - """Update Phone""" + """Update phone""" api_path = '/account/phone' @@ -133,7 +133,7 @@ def update_phone(self, phone, password): }, api_params) def get_prefs(self): - """Get Account Preferences""" + """Get account preferences""" api_path = '/account/prefs' @@ -144,7 +144,7 @@ def get_prefs(self): }, api_params) def update_prefs(self, prefs): - """Update Preferences""" + """Update preferences""" api_path = '/account/prefs' @@ -160,7 +160,7 @@ def update_prefs(self, prefs): }, api_params) def create_recovery(self, email, url): - """Create Password Recovery""" + """Create password recovery""" api_path = '/account/recovery' @@ -180,7 +180,7 @@ def create_recovery(self, email, url): }, api_params) def update_recovery(self, user_id, secret, password, password_again): - """Create Password Recovery (confirmation)""" + """Create password recovery (confirmation)""" api_path = '/account/recovery' @@ -208,7 +208,7 @@ def update_recovery(self, user_id, secret, password, password_again): }, api_params) def list_sessions(self): - """List Sessions""" + """List sessions""" api_path = '/account/sessions' @@ -219,7 +219,7 @@ def list_sessions(self): }, api_params) def delete_sessions(self): - """Delete Sessions""" + """Delete sessions""" api_path = '/account/sessions' @@ -230,7 +230,7 @@ def delete_sessions(self): }, api_params) def get_session(self, session_id): - """Get Session""" + """Get session""" api_path = '/account/sessions/{sessionId}' @@ -246,7 +246,7 @@ def get_session(self, session_id): }, api_params) def update_session(self, session_id): - """Update OAuth Session (Refresh Tokens)""" + """Update OAuth session (refresh tokens)""" api_path = '/account/sessions/{sessionId}' @@ -262,7 +262,7 @@ def update_session(self, session_id): }, api_params) def delete_session(self, session_id): - """Delete Session""" + """Delete session""" api_path = '/account/sessions/{sessionId}' @@ -278,7 +278,7 @@ def delete_session(self, session_id): }, api_params) def update_status(self): - """Update Status""" + """Update status""" api_path = '/account/status' @@ -289,7 +289,7 @@ def update_status(self): }, api_params) def create_verification(self, url): - """Create Email Verification""" + """Create email verification""" api_path = '/account/verification' @@ -305,7 +305,7 @@ def create_verification(self, url): }, api_params) def update_verification(self, user_id, secret): - """Create Email Verification (confirmation)""" + """Create email verification (confirmation)""" api_path = '/account/verification' @@ -325,7 +325,7 @@ def update_verification(self, user_id, secret): }, api_params) def create_phone_verification(self): - """Create Phone Verification""" + """Create phone verification""" api_path = '/account/verification/phone' @@ -336,7 +336,7 @@ def create_phone_verification(self): }, api_params) def update_phone_verification(self, user_id, secret): - """Create Phone Verification (confirmation)""" + """Create phone verification (confirmation)""" api_path = '/account/verification/phone' diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 6b7ed84..0a9b400 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -7,7 +7,7 @@ def __init__(self, client): super(Avatars, self).__init__(client) def get_browser(self, code, width = None, height = None, quality = None): - """Get Browser Icon""" + """Get browser icon""" api_path = '/avatars/browsers/{code}' @@ -26,7 +26,7 @@ def get_browser(self, code, width = None, height = None, quality = None): }, api_params) def get_credit_card(self, code, width = None, height = None, quality = None): - """Get Credit Card Icon""" + """Get credit card icon""" api_path = '/avatars/credit-cards/{code}' @@ -45,7 +45,7 @@ def get_credit_card(self, code, width = None, height = None, quality = None): }, api_params) def get_favicon(self, url): - """Get Favicon""" + """Get favicon""" api_path = '/avatars/favicon' @@ -61,7 +61,7 @@ def get_favicon(self, url): }, api_params) def get_flag(self, code, width = None, height = None, quality = None): - """Get Country Flag""" + """Get country flag""" api_path = '/avatars/flags/{code}' @@ -80,7 +80,7 @@ def get_flag(self, code, width = None, height = None, quality = None): }, api_params) def get_image(self, url, width = None, height = None): - """Get Image from URL""" + """Get image from URL""" api_path = '/avatars/image' @@ -98,7 +98,7 @@ def get_image(self, url, width = None, height = None): }, api_params) def get_initials(self, name = None, width = None, height = None, background = None): - """Get User Initials""" + """Get user initials""" api_path = '/avatars/initials' @@ -114,7 +114,7 @@ def get_initials(self, name = None, width = None, height = None, background = No }, api_params) def get_qr(self, text, size = None, margin = None, download = None): - """Get QR Code""" + """Get QR code""" api_path = '/avatars/qr' diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 1a8384c..801b19b 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -7,7 +7,7 @@ def __init__(self, client): super(Databases, self).__init__(client) def list(self, queries = None, search = None): - """List Databases""" + """List databases""" api_path = '/databases' @@ -21,7 +21,7 @@ def list(self, queries = None, search = None): }, api_params) def create(self, database_id, name, enabled = None): - """Create Database""" + """Create database""" api_path = '/databases' @@ -42,7 +42,7 @@ def create(self, database_id, name, enabled = None): }, api_params) def get(self, database_id): - """Get Database""" + """Get database""" api_path = '/databases/{databaseId}' @@ -58,7 +58,7 @@ def get(self, database_id): }, api_params) def update(self, database_id, name, enabled = None): - """Update Database""" + """Update database""" api_path = '/databases/{databaseId}' @@ -79,7 +79,7 @@ def update(self, database_id, name, enabled = None): }, api_params) def delete(self, database_id): - """Delete Database""" + """Delete database""" api_path = '/databases/{databaseId}' @@ -95,7 +95,7 @@ def delete(self, database_id): }, api_params) def list_collections(self, database_id, queries = None, search = None): - """List Collections""" + """List collections""" api_path = '/databases/{databaseId}/collections' @@ -113,7 +113,7 @@ def list_collections(self, database_id, queries = None, search = None): }, api_params) def create_collection(self, database_id, collection_id, name, permissions = None, document_security = None, enabled = None): - """Create Collection""" + """Create collection""" api_path = '/databases/{databaseId}/collections' @@ -140,7 +140,7 @@ def create_collection(self, database_id, collection_id, name, permissions = None }, api_params) def get_collection(self, database_id, collection_id): - """Get Collection""" + """Get collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' @@ -160,7 +160,7 @@ def get_collection(self, database_id, collection_id): }, api_params) def update_collection(self, database_id, collection_id, name, permissions = None, document_security = None, enabled = None): - """Update Collection""" + """Update collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' @@ -187,7 +187,7 @@ def update_collection(self, database_id, collection_id, name, permissions = None }, api_params) def delete_collection(self, database_id, collection_id): - """Delete Collection""" + """Delete collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' @@ -207,7 +207,7 @@ def delete_collection(self, database_id, collection_id): }, api_params) def list_attributes(self, database_id, collection_id, queries = None): - """List Attributes""" + """List attributes""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' @@ -228,7 +228,7 @@ def list_attributes(self, database_id, collection_id, queries = None): }, api_params) def create_boolean_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create Boolean Attribute""" + """Create boolean attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean' @@ -258,7 +258,7 @@ def create_boolean_attribute(self, database_id, collection_id, key, required, de }, api_params) def update_boolean_attribute(self, database_id, collection_id, key, required, default): - """Update Boolean Attribute""" + """Update boolean attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}' @@ -287,7 +287,7 @@ def update_boolean_attribute(self, database_id, collection_id, key, required, de }, api_params) def create_datetime_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create DateTime Attribute""" + """Create datetime attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime' @@ -317,7 +317,7 @@ def create_datetime_attribute(self, database_id, collection_id, key, required, d }, api_params) def update_datetime_attribute(self, database_id, collection_id, key, required, default): - """Update DateTime Attribute""" + """Update dateTime attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}' @@ -346,7 +346,7 @@ def update_datetime_attribute(self, database_id, collection_id, key, required, d }, api_params) def create_email_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create Email Attribute""" + """Create email attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email' @@ -376,7 +376,7 @@ def create_email_attribute(self, database_id, collection_id, key, required, defa }, api_params) def update_email_attribute(self, database_id, collection_id, key, required, default): - """Update Email Attribute""" + """Update email attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}' @@ -405,7 +405,7 @@ def update_email_attribute(self, database_id, collection_id, key, required, defa }, api_params) def create_enum_attribute(self, database_id, collection_id, key, elements, required, default = None, array = None): - """Create Enum Attribute""" + """Create enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' @@ -439,7 +439,7 @@ def create_enum_attribute(self, database_id, collection_id, key, elements, requi }, api_params) def update_enum_attribute(self, database_id, collection_id, key, elements, required, default): - """Update Enum Attribute""" + """Update enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}' @@ -472,7 +472,7 @@ def update_enum_attribute(self, database_id, collection_id, key, elements, requi }, api_params) def create_float_attribute(self, database_id, collection_id, key, required, min = None, max = None, default = None, array = None): - """Create Float Attribute""" + """Create float attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float' @@ -504,7 +504,7 @@ def create_float_attribute(self, database_id, collection_id, key, required, min }, api_params) def update_float_attribute(self, database_id, collection_id, key, required, min, max, default): - """Update Float Attribute""" + """Update float attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}' @@ -541,7 +541,7 @@ def update_float_attribute(self, database_id, collection_id, key, required, min, }, api_params) def create_integer_attribute(self, database_id, collection_id, key, required, min = None, max = None, default = None, array = None): - """Create Integer Attribute""" + """Create integer attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer' @@ -573,7 +573,7 @@ def create_integer_attribute(self, database_id, collection_id, key, required, mi }, api_params) def update_integer_attribute(self, database_id, collection_id, key, required, min, max, default): - """Update Integer Attribute""" + """Update integer attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}' @@ -610,7 +610,7 @@ def update_integer_attribute(self, database_id, collection_id, key, required, mi }, api_params) def create_ip_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create IP Address Attribute""" + """Create IP address attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip' @@ -640,7 +640,7 @@ def create_ip_attribute(self, database_id, collection_id, key, required, default }, api_params) def update_ip_attribute(self, database_id, collection_id, key, required, default): - """Update IP Address Attribute""" + """Update IP address attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}' @@ -669,7 +669,7 @@ def update_ip_attribute(self, database_id, collection_id, key, required, default }, api_params) def create_relationship_attribute(self, database_id, collection_id, related_collection_id, type, two_way = None, key = None, two_way_key = None, on_delete = None): - """Create Relationship Attribute""" + """Create relationship attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship' @@ -701,7 +701,7 @@ def create_relationship_attribute(self, database_id, collection_id, related_coll }, api_params) def create_string_attribute(self, database_id, collection_id, key, size, required, default = None, array = None, encrypt = None): - """Create String Attribute""" + """Create string attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string' @@ -736,7 +736,7 @@ def create_string_attribute(self, database_id, collection_id, key, size, require }, api_params) def update_string_attribute(self, database_id, collection_id, key, required, default): - """Update String Attribute""" + """Update string attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}' @@ -765,7 +765,7 @@ def update_string_attribute(self, database_id, collection_id, key, required, def }, api_params) def create_url_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create URL Attribute""" + """Create URL attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url' @@ -795,7 +795,7 @@ def create_url_attribute(self, database_id, collection_id, key, required, defaul }, api_params) def update_url_attribute(self, database_id, collection_id, key, required, default): - """Update URL Attribute""" + """Update URL attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}' @@ -824,7 +824,7 @@ def update_url_attribute(self, database_id, collection_id, key, required, defaul }, api_params) def get_attribute(self, database_id, collection_id, key): - """Get Attribute""" + """Get attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' @@ -848,7 +848,7 @@ def get_attribute(self, database_id, collection_id, key): }, api_params) def delete_attribute(self, database_id, collection_id, key): - """Delete Attribute""" + """Delete attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' @@ -872,7 +872,7 @@ def delete_attribute(self, database_id, collection_id, key): }, api_params) def update_relationship_attribute(self, database_id, collection_id, key, on_delete = None): - """Update Relationship Attribute""" + """Update relationship attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship' @@ -897,7 +897,7 @@ def update_relationship_attribute(self, database_id, collection_id, key, on_dele }, api_params) def list_documents(self, database_id, collection_id, queries = None): - """List Documents""" + """List documents""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' @@ -918,7 +918,7 @@ def list_documents(self, database_id, collection_id, queries = None): }, api_params) def create_document(self, database_id, collection_id, document_id, data, permissions = None): - """Create Document""" + """Create document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' @@ -947,7 +947,7 @@ def create_document(self, database_id, collection_id, document_id, data, permiss }, api_params) def get_document(self, database_id, collection_id, document_id, queries = None): - """Get Document""" + """Get document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' @@ -972,7 +972,7 @@ def get_document(self, database_id, collection_id, document_id, queries = None): }, api_params) def update_document(self, database_id, collection_id, document_id, data = None, permissions = None): - """Update Document""" + """Update document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' @@ -998,7 +998,7 @@ def update_document(self, database_id, collection_id, document_id, data = None, }, api_params) def delete_document(self, database_id, collection_id, document_id): - """Delete Document""" + """Delete document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' @@ -1022,7 +1022,7 @@ def delete_document(self, database_id, collection_id, document_id): }, api_params) def list_indexes(self, database_id, collection_id, queries = None): - """List Indexes""" + """List indexes""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' @@ -1043,7 +1043,7 @@ def list_indexes(self, database_id, collection_id, queries = None): }, api_params) def create_index(self, database_id, collection_id, key, type, attributes, orders = None): - """Create Index""" + """Create index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' @@ -1076,7 +1076,7 @@ def create_index(self, database_id, collection_id, key, type, attributes, orders }, api_params) def get_index(self, database_id, collection_id, key): - """Get Index""" + """Get index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' @@ -1100,7 +1100,7 @@ def get_index(self, database_id, collection_id, key): }, api_params) def delete_index(self, database_id, collection_id, key): - """Delete Index""" + """Delete index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index a08e7eb..f5e3d42 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -7,7 +7,7 @@ def __init__(self, client): super(Functions, self).__init__(client) def list(self, queries = None, search = None): - """List Functions""" + """List functions""" api_path = '/functions' @@ -21,7 +21,7 @@ def list(self, queries = None, search = None): }, api_params) def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_branch = None): - """Create Function""" + """Create function""" api_path = '/functions' @@ -73,7 +73,7 @@ def list_runtimes(self): }, api_params) def get(self, function_id): - """Get Function""" + """Get function""" api_path = '/functions/{functionId}' @@ -89,7 +89,7 @@ def get(self, function_id): }, api_params) def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None): - """Update Function""" + """Update function""" api_path = '/functions/{functionId}' @@ -123,7 +123,7 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non }, api_params) def delete(self, function_id): - """Delete Function""" + """Delete function""" api_path = '/functions/{functionId}' @@ -139,7 +139,7 @@ def delete(self, function_id): }, api_params) def list_deployments(self, function_id, queries = None, search = None): - """List Deployments""" + """List deployments""" api_path = '/functions/{functionId}/deployments' @@ -157,7 +157,7 @@ def list_deployments(self, function_id, queries = None, search = None): }, api_params) def create_deployment(self, function_id, code, activate, entrypoint = None, commands = None, on_progress = None): - """Create Deployment""" + """Create deployment""" api_path = '/functions/{functionId}/deployments' @@ -188,7 +188,7 @@ def create_deployment(self, function_id, code, activate, entrypoint = None, comm }, api_params, param_name, on_progress, upload_id) def get_deployment(self, function_id, deployment_id): - """Get Deployment""" + """Get deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' @@ -208,7 +208,7 @@ def get_deployment(self, function_id, deployment_id): }, api_params) def update_deployment(self, function_id, deployment_id): - """Update Function Deployment""" + """Update function deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' @@ -228,7 +228,7 @@ def update_deployment(self, function_id, deployment_id): }, api_params) def delete_deployment(self, function_id, deployment_id): - """Delete Deployment""" + """Delete deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' @@ -248,7 +248,7 @@ def delete_deployment(self, function_id, deployment_id): }, api_params) def create_build(self, function_id, deployment_id, build_id): - """Create Build""" + """Create build""" api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}' @@ -292,7 +292,7 @@ def download_deployment(self, function_id, deployment_id): }, api_params) def list_executions(self, function_id, queries = None, search = None): - """List Executions""" + """List executions""" api_path = '/functions/{functionId}/executions' @@ -310,7 +310,7 @@ def list_executions(self, function_id, queries = None, search = None): }, api_params) def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None): - """Create Execution""" + """Create execution""" api_path = '/functions/{functionId}/executions' @@ -331,7 +331,7 @@ def create_execution(self, function_id, body = None, xasync = None, path = None, }, api_params) def get_execution(self, function_id, execution_id): - """Get Execution""" + """Get execution""" api_path = '/functions/{functionId}/executions/{executionId}' @@ -351,7 +351,7 @@ def get_execution(self, function_id, execution_id): }, api_params) def list_variables(self, function_id): - """List Variables""" + """List variables""" api_path = '/functions/{functionId}/variables' @@ -367,7 +367,7 @@ def list_variables(self, function_id): }, api_params) def create_variable(self, function_id, key, value): - """Create Variable""" + """Create variable""" api_path = '/functions/{functionId}/variables' @@ -391,7 +391,7 @@ def create_variable(self, function_id, key, value): }, api_params) def get_variable(self, function_id, variable_id): - """Get Variable""" + """Get variable""" api_path = '/functions/{functionId}/variables/{variableId}' @@ -411,7 +411,7 @@ def get_variable(self, function_id, variable_id): }, api_params) def update_variable(self, function_id, variable_id, key, value = None): - """Update Variable""" + """Update variable""" api_path = '/functions/{functionId}/variables/{variableId}' @@ -436,7 +436,7 @@ def update_variable(self, function_id, variable_id, key, value = None): }, api_params) def delete_variable(self, function_id, variable_id): - """Delete Variable""" + """Delete variable""" api_path = '/functions/{functionId}/variables/{variableId}' diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 7f9d87d..58a6e99 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -7,7 +7,7 @@ def __init__(self, client): super(Graphql, self).__init__(client) def query(self, query): - """GraphQL Endpoint""" + """GraphQL endpoint""" api_path = '/graphql' @@ -24,7 +24,7 @@ def query(self, query): }, api_params) def mutation(self, query): - """GraphQL Endpoint""" + """GraphQL endpoint""" api_path = '/graphql/mutation' diff --git a/appwrite/services/health.py b/appwrite/services/health.py index 15bd0db..b4f1bf1 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -18,7 +18,7 @@ def get(self): }, api_params) def get_antivirus(self): - """Get Antivirus""" + """Get antivirus""" api_path = '/health/anti-virus' @@ -29,7 +29,7 @@ def get_antivirus(self): }, api_params) def get_cache(self): - """Get Cache""" + """Get cache""" api_path = '/health/cache' @@ -51,7 +51,7 @@ def get_db(self): }, api_params) def get_pub_sub(self): - """Get PubSub""" + """Get pubsub""" api_path = '/health/pubsub' @@ -62,7 +62,7 @@ def get_pub_sub(self): }, api_params) def get_queue(self): - """Get Queue""" + """Get queue""" api_path = '/health/queue' @@ -72,52 +72,139 @@ def get_queue(self): 'content-type': 'application/json', }, api_params) - def get_queue_certificates(self): - """Get Certificates Queue""" + def get_queue_builds(self, threshold = None): + """Get builds queue""" + + + api_path = '/health/queue/builds' + api_params = {} + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_queue_certificates(self, threshold = None): + """Get certificates queue""" api_path = '/health/queue/certificates' api_params = {} + api_params['threshold'] = threshold + return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) - def get_queue_functions(self): - """Get Functions Queue""" + def get_queue_databases(self, name = None, threshold = None): + """Get databases queue""" + + + api_path = '/health/queue/databases' + api_params = {} + + api_params['name'] = name + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_queue_deletes(self, threshold = None): + """Get deletes queue""" + + + api_path = '/health/queue/deletes' + api_params = {} + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_queue_functions(self, threshold = None): + """Get functions queue""" api_path = '/health/queue/functions' api_params = {} + api_params['threshold'] = threshold + return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) - def get_queue_logs(self): - """Get Logs Queue""" + def get_queue_logs(self, threshold = None): + """Get logs queue""" api_path = '/health/queue/logs' api_params = {} + api_params['threshold'] = threshold + return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) - def get_queue_webhooks(self): - """Get Webhooks Queue""" + def get_queue_mails(self, threshold = None): + """Get mails queue""" + + + api_path = '/health/queue/mails' + api_params = {} + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_queue_messaging(self, threshold = None): + """Get messaging queue""" + + + api_path = '/health/queue/messaging' + api_params = {} + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_queue_migrations(self, threshold = None): + """Get migrations queue""" + + + api_path = '/health/queue/migrations' + api_params = {} + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_queue_webhooks(self, threshold = None): + """Get webhooks queue""" api_path = '/health/queue/webhooks' api_params = {} + api_params['threshold'] = threshold + return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) def get_storage_local(self): - """Get Local Storage""" + """Get local storage""" api_path = '/health/storage/local' @@ -128,7 +215,7 @@ def get_storage_local(self): }, api_params) def get_time(self): - """Get Time""" + """Get time""" api_path = '/health/time' diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index 8216ac4..2ba17ac 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -7,7 +7,7 @@ def __init__(self, client): super(Locale, self).__init__(client) def get(self): - """Get User Locale""" + """Get user locale""" api_path = '/locale' @@ -29,7 +29,7 @@ def list_codes(self): }, api_params) def list_continents(self): - """List Continents""" + """List continents""" api_path = '/locale/continents' @@ -40,7 +40,7 @@ def list_continents(self): }, api_params) def list_countries(self): - """List Countries""" + """List countries""" api_path = '/locale/countries' @@ -51,7 +51,7 @@ def list_countries(self): }, api_params) def list_countries_eu(self): - """List EU Countries""" + """List EU countries""" api_path = '/locale/countries/eu' @@ -62,7 +62,7 @@ def list_countries_eu(self): }, api_params) def list_countries_phones(self): - """List Countries Phone Codes""" + """List countries phone codes""" api_path = '/locale/countries/phones' @@ -73,7 +73,7 @@ def list_countries_phones(self): }, api_params) def list_currencies(self): - """List Currencies""" + """List currencies""" api_path = '/locale/currencies' @@ -84,7 +84,7 @@ def list_currencies(self): }, api_params) def list_languages(self): - """List Languages""" + """List languages""" api_path = '/locale/languages' diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 48f1220..d86e412 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -49,7 +49,7 @@ def create_bucket(self, bucket_id, name, permissions = None, file_security = Non }, api_params) def get_bucket(self, bucket_id): - """Get Bucket""" + """Get bucket""" api_path = '/storage/buckets/{bucketId}' @@ -65,7 +65,7 @@ def get_bucket(self, bucket_id): }, api_params) def update_bucket(self, bucket_id, name, permissions = None, file_security = None, enabled = None, maximum_file_size = None, allowed_file_extensions = None, compression = None, encryption = None, antivirus = None): - """Update Bucket""" + """Update bucket""" api_path = '/storage/buckets/{bucketId}' @@ -93,7 +93,7 @@ def update_bucket(self, bucket_id, name, permissions = None, file_security = Non }, api_params) def delete_bucket(self, bucket_id): - """Delete Bucket""" + """Delete bucket""" api_path = '/storage/buckets/{bucketId}' @@ -109,7 +109,7 @@ def delete_bucket(self, bucket_id): }, api_params) def list_files(self, bucket_id, queries = None, search = None): - """List Files""" + """List files""" api_path = '/storage/buckets/{bucketId}/files' @@ -127,7 +127,7 @@ def list_files(self, bucket_id, queries = None, search = None): }, api_params) def create_file(self, bucket_id, file_id, file, permissions = None, on_progress = None): - """Create File""" + """Create file""" api_path = '/storage/buckets/{bucketId}/files' @@ -158,7 +158,7 @@ def create_file(self, bucket_id, file_id, file, permissions = None, on_progress }, api_params, param_name, on_progress, upload_id) def get_file(self, bucket_id, file_id): - """Get File""" + """Get file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' @@ -178,7 +178,7 @@ def get_file(self, bucket_id, file_id): }, api_params) def update_file(self, bucket_id, file_id, name = None, permissions = None): - """Update File""" + """Update file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' @@ -220,7 +220,7 @@ def delete_file(self, bucket_id, file_id): }, api_params) def get_file_download(self, bucket_id, file_id): - """Get File for Download""" + """Get file for download""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/download' @@ -240,7 +240,7 @@ def get_file_download(self, bucket_id, file_id): }, api_params) def get_file_preview(self, bucket_id, file_id, width = None, height = None, gravity = None, quality = None, border_width = None, border_color = None, border_radius = None, opacity = None, rotation = None, background = None, output = None): - """Get File Preview""" + """Get file preview""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/preview' @@ -271,7 +271,7 @@ def get_file_preview(self, bucket_id, file_id, width = None, height = None, grav }, api_params) def get_file_view(self, bucket_id, file_id): - """Get File for View""" + """Get file for view""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/view' diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index c7b4272..2c387ed 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -7,7 +7,7 @@ def __init__(self, client): super(Teams, self).__init__(client) def list(self, queries = None, search = None): - """List Teams""" + """List teams""" api_path = '/teams' @@ -21,7 +21,7 @@ def list(self, queries = None, search = None): }, api_params) def create(self, team_id, name, roles = None): - """Create Team""" + """Create team""" api_path = '/teams' @@ -42,7 +42,7 @@ def create(self, team_id, name, roles = None): }, api_params) def get(self, team_id): - """Get Team""" + """Get team""" api_path = '/teams/{teamId}' @@ -58,7 +58,7 @@ def get(self, team_id): }, api_params) def update_name(self, team_id, name): - """Update Name""" + """Update name""" api_path = '/teams/{teamId}' @@ -78,7 +78,7 @@ def update_name(self, team_id, name): }, api_params) def delete(self, team_id): - """Delete Team""" + """Delete team""" api_path = '/teams/{teamId}' @@ -94,7 +94,7 @@ def delete(self, team_id): }, api_params) def list_memberships(self, team_id, queries = None, search = None): - """List Team Memberships""" + """List team memberships""" api_path = '/teams/{teamId}/memberships' @@ -112,7 +112,7 @@ def list_memberships(self, team_id, queries = None, search = None): }, api_params) def create_membership(self, team_id, roles, email = None, user_id = None, phone = None, url = None, name = None): - """Create Team Membership""" + """Create team membership""" api_path = '/teams/{teamId}/memberships' @@ -137,7 +137,7 @@ def create_membership(self, team_id, roles, email = None, user_id = None, phone }, api_params) def get_membership(self, team_id, membership_id): - """Get Team Membership""" + """Get team membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' @@ -157,7 +157,7 @@ def get_membership(self, team_id, membership_id): }, api_params) def update_membership(self, team_id, membership_id, roles): - """Update Membership""" + """Update membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' @@ -181,7 +181,7 @@ def update_membership(self, team_id, membership_id, roles): }, api_params) def delete_membership(self, team_id, membership_id): - """Delete Team Membership""" + """Delete team membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' @@ -201,7 +201,7 @@ def delete_membership(self, team_id, membership_id): }, api_params) def update_membership_status(self, team_id, membership_id, user_id, secret): - """Update Team Membership Status""" + """Update team membership status""" api_path = '/teams/{teamId}/memberships/{membershipId}/status' @@ -229,7 +229,7 @@ def update_membership_status(self, team_id, membership_id, user_id, secret): }, api_params) def get_prefs(self, team_id): - """Get Team Preferences""" + """Get team preferences""" api_path = '/teams/{teamId}/prefs' @@ -245,7 +245,7 @@ def get_prefs(self, team_id): }, api_params) def update_prefs(self, team_id, prefs): - """Update Preferences""" + """Update preferences""" api_path = '/teams/{teamId}/prefs' diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 0962d7c..2bcec8d 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -7,7 +7,7 @@ def __init__(self, client): super(Users, self).__init__(client) def list(self, queries = None, search = None): - """List Users""" + """List users""" api_path = '/users' @@ -21,7 +21,7 @@ def list(self, queries = None, search = None): }, api_params) def create(self, user_id, email = None, phone = None, password = None, name = None): - """Create User""" + """Create user""" api_path = '/users' @@ -41,7 +41,7 @@ def create(self, user_id, email = None, phone = None, password = None, name = No }, api_params) def create_argon2_user(self, user_id, email, password, name = None): - """Create User with Argon2 Password""" + """Create user with Argon2 password""" api_path = '/users/argon2' @@ -66,7 +66,7 @@ def create_argon2_user(self, user_id, email, password, name = None): }, api_params) def create_bcrypt_user(self, user_id, email, password, name = None): - """Create User with Bcrypt Password""" + """Create user with bcrypt password""" api_path = '/users/bcrypt' @@ -121,7 +121,7 @@ def delete_identity(self, identity_id): }, api_params) def create_md5_user(self, user_id, email, password, name = None): - """Create User with MD5 Password""" + """Create user with MD5 password""" api_path = '/users/md5' @@ -146,7 +146,7 @@ def create_md5_user(self, user_id, email, password, name = None): }, api_params) def create_ph_pass_user(self, user_id, email, password, name = None): - """Create User with PHPass Password""" + """Create user with PHPass password""" api_path = '/users/phpass' @@ -171,7 +171,7 @@ def create_ph_pass_user(self, user_id, email, password, name = None): }, api_params) def create_scrypt_user(self, user_id, email, password, password_salt, password_cpu, password_memory, password_parallel, password_length, name = None): - """Create User with Scrypt Password""" + """Create user with Scrypt password""" api_path = '/users/scrypt' @@ -216,7 +216,7 @@ def create_scrypt_user(self, user_id, email, password, password_salt, password_c }, api_params) def create_scrypt_modified_user(self, user_id, email, password, password_salt, password_salt_separator, password_signer_key, name = None): - """Create User with Scrypt Modified Password""" + """Create user with Scrypt modified password""" api_path = '/users/scrypt-modified' @@ -253,7 +253,7 @@ def create_scrypt_modified_user(self, user_id, email, password, password_salt, p }, api_params) def create_sha_user(self, user_id, email, password, password_version = None, name = None): - """Create User with SHA Password""" + """Create user with SHA password""" api_path = '/users/sha' @@ -279,7 +279,7 @@ def create_sha_user(self, user_id, email, password, password_version = None, nam }, api_params) def get(self, user_id): - """Get User""" + """Get user""" api_path = '/users/{userId}' @@ -295,7 +295,7 @@ def get(self, user_id): }, api_params) def delete(self, user_id): - """Delete User""" + """Delete user""" api_path = '/users/{userId}' @@ -311,7 +311,7 @@ def delete(self, user_id): }, api_params) def update_email(self, user_id, email): - """Update Email""" + """Update email""" api_path = '/users/{userId}/email' @@ -331,7 +331,7 @@ def update_email(self, user_id, email): }, api_params) def update_labels(self, user_id, labels): - """Update User Labels""" + """Update user labels""" api_path = '/users/{userId}/labels' @@ -351,7 +351,7 @@ def update_labels(self, user_id, labels): }, api_params) def list_logs(self, user_id, queries = None): - """List User Logs""" + """List user logs""" api_path = '/users/{userId}/logs' @@ -368,7 +368,7 @@ def list_logs(self, user_id, queries = None): }, api_params) def list_memberships(self, user_id): - """List User Memberships""" + """List user memberships""" api_path = '/users/{userId}/memberships' @@ -384,7 +384,7 @@ def list_memberships(self, user_id): }, api_params) def update_name(self, user_id, name): - """Update Name""" + """Update name""" api_path = '/users/{userId}/name' @@ -404,7 +404,7 @@ def update_name(self, user_id, name): }, api_params) def update_password(self, user_id, password): - """Update Password""" + """Update password""" api_path = '/users/{userId}/password' @@ -424,7 +424,7 @@ def update_password(self, user_id, password): }, api_params) def update_phone(self, user_id, number): - """Update Phone""" + """Update phone""" api_path = '/users/{userId}/phone' @@ -444,7 +444,7 @@ def update_phone(self, user_id, number): }, api_params) def get_prefs(self, user_id): - """Get User Preferences""" + """Get user preferences""" api_path = '/users/{userId}/prefs' @@ -460,7 +460,7 @@ def get_prefs(self, user_id): }, api_params) def update_prefs(self, user_id, prefs): - """Update User Preferences""" + """Update user preferences""" api_path = '/users/{userId}/prefs' @@ -480,7 +480,7 @@ def update_prefs(self, user_id, prefs): }, api_params) def list_sessions(self, user_id): - """List User Sessions""" + """List user sessions""" api_path = '/users/{userId}/sessions' @@ -496,7 +496,7 @@ def list_sessions(self, user_id): }, api_params) def delete_sessions(self, user_id): - """Delete User Sessions""" + """Delete user sessions""" api_path = '/users/{userId}/sessions' @@ -512,7 +512,7 @@ def delete_sessions(self, user_id): }, api_params) def delete_session(self, user_id, session_id): - """Delete User Session""" + """Delete user session""" api_path = '/users/{userId}/sessions/{sessionId}' @@ -532,7 +532,7 @@ def delete_session(self, user_id, session_id): }, api_params) def update_status(self, user_id, status): - """Update User Status""" + """Update user status""" api_path = '/users/{userId}/status' @@ -552,7 +552,7 @@ def update_status(self, user_id, status): }, api_params) def update_email_verification(self, user_id, email_verification): - """Update Email Verification""" + """Update email verification""" api_path = '/users/{userId}/verification' @@ -572,7 +572,7 @@ def update_email_verification(self, user_id, email_verification): }, api_params) def update_phone_verification(self, user_id, phone_verification): - """Update Phone Verification""" + """Update phone verification""" api_path = '/users/{userId}/verification/phone' diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md new file mode 100644 index 0000000..3170559 --- /dev/null +++ b/docs/examples/health/get-queue-builds.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_builds() diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md new file mode 100644 index 0000000..4faff96 --- /dev/null +++ b/docs/examples/health/get-queue-databases.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_databases() diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md new file mode 100644 index 0000000..c84b9be --- /dev/null +++ b/docs/examples/health/get-queue-deletes.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_deletes() diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md new file mode 100644 index 0000000..cc2c3bc --- /dev/null +++ b/docs/examples/health/get-queue-mails.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_mails() diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md new file mode 100644 index 0000000..95200f3 --- /dev/null +++ b/docs/examples/health/get-queue-messaging.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_messaging() diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md new file mode 100644 index 0000000..1c91663 --- /dev/null +++ b/docs/examples/health/get-queue-migrations.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_migrations() diff --git a/setup.py b/setup.py index 851e7e4..d4270dd 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '4.0.0', + version = '4.0.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/4.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/4.0.1.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From ce7745c13497910c96a8d32a76cfcbecedc8936c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 16 Nov 2023 21:31:51 +1300 Subject: [PATCH 02/60] Fix between query output --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index 84e0fbd..d5dd8c7 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -11,11 +11,11 @@ def __init__(self): self._endpoint = 'https://HOSTNAME/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/4.0.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/4.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '4.0.1', + 'x-sdk-version': '4.1.0', 'X-Appwrite-Response-Format' : '1.4.0', } diff --git a/setup.py b/setup.py index d4270dd..49f3672 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '4.0.1', + version = '4.1.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/4.0.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/4.1.0.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From 94df3f4d3b68fca40ca057f81e1f05ec9919654e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 Feb 2024 23:40:58 +1300 Subject: [PATCH 03/60] Release candidate for 1.5.x --- LICENSE | 2 +- README.md | 4 +- appwrite/client.py | 34 +- appwrite/encoders/__init__.py | 1 + appwrite/encoders/value_class_encoder.py | 77 ++ appwrite/enums/__init__.py | 1 + appwrite/enums/authenticator_factor.py | 4 + appwrite/enums/authenticator_provider.py | 4 + appwrite/enums/browser.py | 17 + appwrite/enums/compression.py | 6 + appwrite/enums/credit_card.py | 19 + appwrite/enums/execution_method.py | 9 + appwrite/enums/flag.py | 197 ++++ appwrite/enums/image_format.py | 8 + appwrite/enums/image_gravity.py | 12 + appwrite/enums/index_type.py | 7 + appwrite/enums/message_type.py | 6 + appwrite/enums/messaging_provider_type.py | 6 + appwrite/enums/o_auth_provider.py | 42 + appwrite/enums/password_version.py | 14 + appwrite/enums/relation_mutate.py | 6 + appwrite/enums/relationship_type.py | 7 + appwrite/enums/runtime.py | 7 + appwrite/enums/smtp_encryption.py | 6 + appwrite/input_file.py | 2 +- appwrite/query.py | 88 +- appwrite/services/account.py | 319 +++++- appwrite/services/messaging.py | 998 ++++++++++++++++++ appwrite/services/users.py | 206 +++- docs/examples/account/add-authenticator.md | 14 + .../account/create-anonymous-session.md | 12 + docs/examples/account/create-challenge.md | 13 + .../account/create-email-password-session.md | 12 + docs/examples/account/create-email-token.md | 12 + docs/examples/account/create-j-w-t.md | 12 + .../account/create-magic-u-r-l-token.md | 12 + .../examples/account/create-o-auth2session.md | 13 + docs/examples/account/create-phone-token.md | 12 + .../account/create-phone-verification.md | 3 +- docs/examples/account/create-recovery.md | 3 +- docs/examples/account/create-session.md | 12 + docs/examples/account/create-verification.md | 3 +- docs/examples/account/create.md | 12 + docs/examples/account/delete-authenticator.md | 14 + docs/examples/account/delete-identity.md | 3 +- docs/examples/account/delete-session.md | 3 +- docs/examples/account/delete-sessions.md | 3 +- docs/examples/account/get-prefs.md | 3 +- docs/examples/account/get-session.md | 3 +- docs/examples/account/get.md | 3 +- docs/examples/account/list-factors.md | 13 + docs/examples/account/list-identities.md | 3 +- docs/examples/account/list-logs.md | 3 +- docs/examples/account/list-sessions.md | 3 +- docs/examples/account/update-challenge.md | 13 + docs/examples/account/update-email.md | 3 +- docs/examples/account/update-m-f-a.md | 13 + .../account/update-magic-u-r-l-session.md | 12 + docs/examples/account/update-name.md | 3 +- docs/examples/account/update-password.md | 3 +- .../account/update-phone-verification.md | 3 +- docs/examples/account/update-phone.md | 3 +- docs/examples/account/update-prefs.md | 3 +- docs/examples/account/update-recovery.md | 5 +- docs/examples/account/update-session.md | 3 +- docs/examples/account/update-status.md | 3 +- docs/examples/account/update-verification.md | 3 +- docs/examples/account/verify-authenticator.md | 14 + docs/examples/avatars/get-browser.md | 6 +- docs/examples/avatars/get-credit-card.md | 6 +- docs/examples/avatars/get-favicon.md | 3 +- docs/examples/avatars/get-flag.md | 6 +- docs/examples/avatars/get-image.md | 3 +- docs/examples/avatars/get-initials.md | 3 +- docs/examples/avatars/get-q-r.md | 3 +- .../databases/create-boolean-attribute.md | 1 - docs/examples/databases/create-collection.md | 1 - .../databases/create-datetime-attribute.md | 1 - docs/examples/databases/create-document.md | 3 +- .../databases/create-email-attribute.md | 1 - .../databases/create-enum-attribute.md | 1 - .../databases/create-float-attribute.md | 1 - docs/examples/databases/create-index.md | 4 +- .../databases/create-integer-attribute.md | 1 - .../examples/databases/create-ip-attribute.md | 1 - .../create-relationship-attribute.md | 4 +- .../databases/create-string-attribute.md | 1 - .../databases/create-url-attribute.md | 1 - docs/examples/databases/create.md | 1 - docs/examples/databases/delete-attribute.md | 1 - docs/examples/databases/delete-collection.md | 1 - docs/examples/databases/delete-document.md | 3 +- docs/examples/databases/delete-index.md | 1 - docs/examples/databases/delete.md | 1 - docs/examples/databases/get-attribute.md | 1 - docs/examples/databases/get-collection.md | 1 - docs/examples/databases/get-document.md | 3 +- docs/examples/databases/get-index.md | 1 - docs/examples/databases/get.md | 1 - docs/examples/databases/list-attributes.md | 1 - docs/examples/databases/list-collections.md | 1 - docs/examples/databases/list-documents.md | 3 +- docs/examples/databases/list-indexes.md | 1 - docs/examples/databases/list.md | 1 - .../databases/update-boolean-attribute.md | 1 - docs/examples/databases/update-collection.md | 1 - .../databases/update-datetime-attribute.md | 1 - docs/examples/databases/update-document.md | 3 +- .../databases/update-email-attribute.md | 1 - .../databases/update-enum-attribute.md | 1 - .../databases/update-float-attribute.md | 1 - .../databases/update-integer-attribute.md | 1 - .../examples/databases/update-ip-attribute.md | 1 - .../update-relationship-attribute.md | 1 - .../databases/update-string-attribute.md | 1 - .../databases/update-url-attribute.md | 1 - docs/examples/databases/update.md | 1 - docs/examples/functions/create-build.md | 1 - docs/examples/functions/create-deployment.md | 1 - docs/examples/functions/create-execution.md | 3 +- docs/examples/functions/create-variable.md | 1 - docs/examples/functions/create.md | 4 +- docs/examples/functions/delete-deployment.md | 1 - docs/examples/functions/delete-variable.md | 1 - docs/examples/functions/delete.md | 1 - .../examples/functions/download-deployment.md | 1 - docs/examples/functions/get-deployment.md | 1 - docs/examples/functions/get-execution.md | 3 +- docs/examples/functions/get-variable.md | 1 - docs/examples/functions/get.md | 1 - docs/examples/functions/list-deployments.md | 1 - docs/examples/functions/list-executions.md | 3 +- docs/examples/functions/list-runtimes.md | 1 - docs/examples/functions/list-variables.md | 1 - docs/examples/functions/list.md | 1 - docs/examples/functions/update-deployment.md | 1 - docs/examples/functions/update-variable.md | 1 - docs/examples/functions/update.md | 1 - docs/examples/graphql/mutation.md | 1 - docs/examples/graphql/query.md | 1 - docs/examples/health/get-antivirus.md | 1 - docs/examples/health/get-cache.md | 1 - docs/examples/health/get-d-b.md | 1 - docs/examples/health/get-pub-sub.md | 1 - docs/examples/health/get-queue-builds.md | 1 - .../examples/health/get-queue-certificates.md | 1 - docs/examples/health/get-queue-databases.md | 1 - docs/examples/health/get-queue-deletes.md | 1 - docs/examples/health/get-queue-functions.md | 1 - docs/examples/health/get-queue-logs.md | 1 - docs/examples/health/get-queue-mails.md | 1 - docs/examples/health/get-queue-messaging.md | 1 - docs/examples/health/get-queue-migrations.md | 1 - docs/examples/health/get-queue-webhooks.md | 1 - docs/examples/health/get-queue.md | 1 - docs/examples/health/get-storage-local.md | 1 - docs/examples/health/get-time.md | 1 - docs/examples/health/get.md | 1 - docs/examples/locale/get.md | 3 +- docs/examples/locale/list-codes.md | 3 +- docs/examples/locale/list-continents.md | 3 +- docs/examples/locale/list-countries-e-u.md | 3 +- docs/examples/locale/list-countries-phones.md | 3 +- docs/examples/locale/list-countries.md | 3 +- docs/examples/locale/list-currencies.md | 3 +- docs/examples/locale/list-languages.md | 3 +- .../messaging/create-a-p-n-s-provider.md | 13 + docs/examples/messaging/create-email.md | 13 + .../messaging/create-f-c-m-provider.md | 13 + .../messaging/create-mailgun-provider.md | 13 + .../messaging/create-msg91provider.md | 13 + docs/examples/messaging/create-push.md | 13 + docs/examples/messaging/create-s-m-s.md | 13 + .../messaging/create-s-m-t-p-provider.md | 13 + .../messaging/create-sendgrid-provider.md | 13 + docs/examples/messaging/create-subscriber.md | 13 + .../messaging/create-telesign-provider.md | 13 + .../messaging/create-textmagic-provider.md | 13 + docs/examples/messaging/create-topic.md | 13 + .../messaging/create-twilio-provider.md | 13 + .../messaging/create-vonage-provider.md | 13 + docs/examples/messaging/delete-provider.md | 13 + docs/examples/messaging/delete-subscriber.md | 13 + docs/examples/messaging/delete-topic.md | 13 + docs/examples/messaging/delete.md | 13 + docs/examples/messaging/get-message.md | 13 + docs/examples/messaging/get-provider.md | 13 + docs/examples/messaging/get-subscriber.md | 13 + docs/examples/messaging/get-topic.md | 13 + docs/examples/messaging/list-message-logs.md | 13 + docs/examples/messaging/list-messages.md | 13 + docs/examples/messaging/list-provider-logs.md | 13 + docs/examples/messaging/list-providers.md | 13 + .../messaging/list-subscriber-logs.md | 13 + docs/examples/messaging/list-subscribers.md | 13 + docs/examples/messaging/list-targets.md | 13 + docs/examples/messaging/list-topic-logs.md | 13 + docs/examples/messaging/list-topics.md | 13 + .../messaging/update-a-p-n-s-provider.md | 13 + docs/examples/messaging/update-email.md | 13 + .../messaging/update-f-c-m-provider.md | 13 + .../messaging/update-mailgun-provider.md | 13 + .../messaging/update-msg91provider.md | 13 + docs/examples/messaging/update-push.md | 13 + docs/examples/messaging/update-s-m-s.md | 13 + .../messaging/update-s-m-t-p-provider.md | 13 + .../messaging/update-sendgrid-provider.md | 13 + .../messaging/update-telesign-provider.md | 13 + .../messaging/update-textmagic-provider.md | 13 + docs/examples/messaging/update-topic.md | 13 + .../messaging/update-twilio-provider.md | 13 + .../messaging/update-vonage-provider.md | 13 + docs/examples/storage/create-bucket.md | 1 - docs/examples/storage/create-file.md | 3 +- docs/examples/storage/delete-bucket.md | 1 - docs/examples/storage/delete-file.md | 3 +- docs/examples/storage/get-bucket.md | 1 - docs/examples/storage/get-file-download.md | 3 +- docs/examples/storage/get-file-preview.md | 3 +- docs/examples/storage/get-file-view.md | 3 +- docs/examples/storage/get-file.md | 3 +- docs/examples/storage/list-buckets.md | 1 - docs/examples/storage/list-files.md | 3 +- docs/examples/storage/update-bucket.md | 1 - docs/examples/storage/update-file.md | 3 +- docs/examples/teams/create-membership.md | 3 +- docs/examples/teams/create.md | 3 +- docs/examples/teams/delete-membership.md | 3 +- docs/examples/teams/delete.md | 3 +- docs/examples/teams/get-membership.md | 3 +- docs/examples/teams/get-prefs.md | 3 +- docs/examples/teams/get.md | 3 +- docs/examples/teams/list-memberships.md | 3 +- docs/examples/teams/list.md | 3 +- .../teams/update-membership-status.md | 3 +- docs/examples/teams/update-membership.md | 3 +- docs/examples/teams/update-name.md | 3 +- docs/examples/teams/update-prefs.md | 3 +- docs/examples/users/create-argon2user.md | 1 - docs/examples/users/create-bcrypt-user.md | 1 - docs/examples/users/create-m-d5user.md | 1 - docs/examples/users/create-p-h-pass-user.md | 1 - docs/examples/users/create-s-h-a-user.md | 1 - .../users/create-scrypt-modified-user.md | 1 - docs/examples/users/create-scrypt-user.md | 1 - docs/examples/users/create-session.md | 13 + docs/examples/users/create-target.md | 14 + docs/examples/users/create-token.md | 13 + docs/examples/users/create.md | 1 - docs/examples/users/delete-authenticator.md | 14 + docs/examples/users/delete-identity.md | 1 - docs/examples/users/delete-session.md | 1 - docs/examples/users/delete-sessions.md | 1 - docs/examples/users/delete-target.md | 13 + docs/examples/users/delete.md | 1 - docs/examples/users/get-prefs.md | 1 - docs/examples/users/get-target.md | 13 + docs/examples/users/get.md | 1 - docs/examples/users/list-identities.md | 1 - docs/examples/users/list-logs.md | 1 - docs/examples/users/list-memberships.md | 1 - docs/examples/users/list-providers.md | 13 + docs/examples/users/list-sessions.md | 1 - docs/examples/users/list-targets.md | 13 + docs/examples/users/list.md | 1 - .../users/update-email-verification.md | 1 - docs/examples/users/update-email.md | 1 - docs/examples/users/update-labels.md | 1 - docs/examples/users/update-mfa.md | 13 + docs/examples/users/update-name.md | 1 - docs/examples/users/update-password.md | 1 - .../users/update-phone-verification.md | 1 - docs/examples/users/update-phone.md | 1 - docs/examples/users/update-prefs.md | 1 - docs/examples/users/update-status.md | 1 - docs/examples/users/update-target.md | 13 + setup.py | 4 +- 277 files changed, 3079 insertions(+), 305 deletions(-) create mode 100644 appwrite/encoders/__init__.py create mode 100644 appwrite/encoders/value_class_encoder.py create mode 100644 appwrite/enums/__init__.py create mode 100644 appwrite/enums/authenticator_factor.py create mode 100644 appwrite/enums/authenticator_provider.py create mode 100644 appwrite/enums/browser.py create mode 100644 appwrite/enums/compression.py create mode 100644 appwrite/enums/credit_card.py create mode 100644 appwrite/enums/execution_method.py create mode 100644 appwrite/enums/flag.py create mode 100644 appwrite/enums/image_format.py create mode 100644 appwrite/enums/image_gravity.py create mode 100644 appwrite/enums/index_type.py create mode 100644 appwrite/enums/message_type.py create mode 100644 appwrite/enums/messaging_provider_type.py create mode 100644 appwrite/enums/o_auth_provider.py create mode 100644 appwrite/enums/password_version.py create mode 100644 appwrite/enums/relation_mutate.py create mode 100644 appwrite/enums/relationship_type.py create mode 100644 appwrite/enums/runtime.py create mode 100644 appwrite/enums/smtp_encryption.py create mode 100644 appwrite/services/messaging.py create mode 100644 docs/examples/account/add-authenticator.md create mode 100644 docs/examples/account/create-anonymous-session.md create mode 100644 docs/examples/account/create-challenge.md create mode 100644 docs/examples/account/create-email-password-session.md create mode 100644 docs/examples/account/create-email-token.md create mode 100644 docs/examples/account/create-j-w-t.md create mode 100644 docs/examples/account/create-magic-u-r-l-token.md create mode 100644 docs/examples/account/create-o-auth2session.md create mode 100644 docs/examples/account/create-phone-token.md create mode 100644 docs/examples/account/create-session.md create mode 100644 docs/examples/account/create.md create mode 100644 docs/examples/account/delete-authenticator.md create mode 100644 docs/examples/account/list-factors.md create mode 100644 docs/examples/account/update-challenge.md create mode 100644 docs/examples/account/update-m-f-a.md create mode 100644 docs/examples/account/update-magic-u-r-l-session.md create mode 100644 docs/examples/account/verify-authenticator.md create mode 100644 docs/examples/messaging/create-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/create-email.md create mode 100644 docs/examples/messaging/create-f-c-m-provider.md create mode 100644 docs/examples/messaging/create-mailgun-provider.md create mode 100644 docs/examples/messaging/create-msg91provider.md create mode 100644 docs/examples/messaging/create-push.md create mode 100644 docs/examples/messaging/create-s-m-s.md create mode 100644 docs/examples/messaging/create-s-m-t-p-provider.md create mode 100644 docs/examples/messaging/create-sendgrid-provider.md create mode 100644 docs/examples/messaging/create-subscriber.md create mode 100644 docs/examples/messaging/create-telesign-provider.md create mode 100644 docs/examples/messaging/create-textmagic-provider.md create mode 100644 docs/examples/messaging/create-topic.md create mode 100644 docs/examples/messaging/create-twilio-provider.md create mode 100644 docs/examples/messaging/create-vonage-provider.md create mode 100644 docs/examples/messaging/delete-provider.md create mode 100644 docs/examples/messaging/delete-subscriber.md create mode 100644 docs/examples/messaging/delete-topic.md create mode 100644 docs/examples/messaging/delete.md create mode 100644 docs/examples/messaging/get-message.md create mode 100644 docs/examples/messaging/get-provider.md create mode 100644 docs/examples/messaging/get-subscriber.md create mode 100644 docs/examples/messaging/get-topic.md create mode 100644 docs/examples/messaging/list-message-logs.md create mode 100644 docs/examples/messaging/list-messages.md create mode 100644 docs/examples/messaging/list-provider-logs.md create mode 100644 docs/examples/messaging/list-providers.md create mode 100644 docs/examples/messaging/list-subscriber-logs.md create mode 100644 docs/examples/messaging/list-subscribers.md create mode 100644 docs/examples/messaging/list-targets.md create mode 100644 docs/examples/messaging/list-topic-logs.md create mode 100644 docs/examples/messaging/list-topics.md create mode 100644 docs/examples/messaging/update-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/update-email.md create mode 100644 docs/examples/messaging/update-f-c-m-provider.md create mode 100644 docs/examples/messaging/update-mailgun-provider.md create mode 100644 docs/examples/messaging/update-msg91provider.md create mode 100644 docs/examples/messaging/update-push.md create mode 100644 docs/examples/messaging/update-s-m-s.md create mode 100644 docs/examples/messaging/update-s-m-t-p-provider.md create mode 100644 docs/examples/messaging/update-sendgrid-provider.md create mode 100644 docs/examples/messaging/update-telesign-provider.md create mode 100644 docs/examples/messaging/update-textmagic-provider.md create mode 100644 docs/examples/messaging/update-topic.md create mode 100644 docs/examples/messaging/update-twilio-provider.md create mode 100644 docs/examples/messaging/update-vonage-provider.md create mode 100644 docs/examples/users/create-session.md create mode 100644 docs/examples/users/create-target.md create mode 100644 docs/examples/users/create-token.md create mode 100644 docs/examples/users/delete-authenticator.md create mode 100644 docs/examples/users/delete-target.md create mode 100644 docs/examples/users/get-target.md create mode 100644 docs/examples/users/list-providers.md create mode 100644 docs/examples/users/list-targets.md create mode 100644 docs/examples/users/update-mfa.md create mode 100644 docs/examples/users/update-target.md diff --git a/LICENSE b/LICENSE index 47cfdfb..5479bb8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors. +Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 9dd9d0c..9f444c6 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.4.12-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.4.13-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** +**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite/client.py b/appwrite/client.py index d5dd8c7..b846965 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -1,8 +1,10 @@ import io -import requests +import json import os +import requests from .input_file import InputFile from .exception import AppwriteException +from .encoders.value_class_encoder import ValueClassEncoder class Client: def __init__(self): @@ -11,11 +13,11 @@ def __init__(self): self._endpoint = 'https://HOSTNAME/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/4.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '4.1.0', + 'x-sdk-version': '5.0.0-rc.1', 'X-Appwrite-Response-Format' : '1.4.0', } @@ -53,6 +55,24 @@ def set_locale(self, value): self._global_headers['x-appwrite-locale'] = value return self + def set_session(self, value): + """The user session to authenticate with""" + + self._global_headers['x-appwrite-session'] = value + return self + + def set_forwarded_for(self, value): + """The IP address of the client that made the request""" + + self._global_headers['x-forwarded-for'] = value + return self + + def set_forwarded_user_agent(self, value): + """The user agent string of the client that made the request""" + + self._global_headers['x-forwarded-user-agent'] = value + return self + def call(self, method, path='', headers=None, params=None): if headers is None: headers = {} @@ -63,7 +83,6 @@ def call(self, method, path='', headers=None, params=None): params = {k: v for k, v in params.items() if v is not None} # Remove None values from params dictionary data = {} - json = {} files = {} stringify = False @@ -74,8 +93,7 @@ def call(self, method, path='', headers=None, params=None): params = {} if headers['content-type'].startswith('application/json'): - json = data - data = {} + data = json.dumps(data, cls=ValueClassEncoder) if headers['content-type'].startswith('multipart/form-data'): del headers['content-type'] @@ -84,14 +102,14 @@ def call(self, method, path='', headers=None, params=None): if isinstance(data[key], InputFile): files[key] = (data[key].filename, data[key].data) del data[key] + data = self.flatten(data, stringify=stringify) response = None try: response = requests.request( # call method dynamically https://stackoverflow.com/a/4246075/2299554 method=method, url=self._endpoint + path, params=self.flatten(params, stringify=stringify), - data=self.flatten(data), - json=json, + data=data, files=files, headers=headers, verify=(not self._self_signed), diff --git a/appwrite/encoders/__init__.py b/appwrite/encoders/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/appwrite/encoders/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py new file mode 100644 index 0000000..9901856 --- /dev/null +++ b/appwrite/encoders/value_class_encoder.py @@ -0,0 +1,77 @@ +import json +from ..enums.authenticator_provider import AuthenticatorProvider +from ..enums.authenticator_factor import AuthenticatorFactor +from ..enums.o_auth_provider import OAuthProvider +from ..enums.browser import Browser +from ..enums.credit_card import CreditCard +from ..enums.flag import Flag +from ..enums.relationship_type import RelationshipType +from ..enums.relation_mutate import RelationMutate +from ..enums.index_type import IndexType +from ..enums.runtime import Runtime +from ..enums.execution_method import ExecutionMethod +from ..enums.message_type import MessageType +from ..enums.smtp_encryption import SMTPEncryption +from ..enums.compression import Compression +from ..enums.image_gravity import ImageGravity +from ..enums.image_format import ImageFormat +from ..enums.password_version import PasswordVersion +from ..enums.messaging_provider_type import MessagingProviderType + +class ValueClassEncoder(json.JSONEncoder): + def default(self, o): + if isinstance(o, AuthenticatorProvider): + return o.value + + if isinstance(o, AuthenticatorFactor): + return o.value + + if isinstance(o, OAuthProvider): + return o.value + + if isinstance(o, Browser): + return o.value + + if isinstance(o, CreditCard): + return o.value + + if isinstance(o, Flag): + return o.value + + if isinstance(o, RelationshipType): + return o.value + + if isinstance(o, RelationMutate): + return o.value + + if isinstance(o, IndexType): + return o.value + + if isinstance(o, Runtime): + return o.value + + if isinstance(o, ExecutionMethod): + return o.value + + if isinstance(o, MessageType): + return o.value + + if isinstance(o, SMTPEncryption): + return o.value + + if isinstance(o, Compression): + return o.value + + if isinstance(o, ImageGravity): + return o.value + + if isinstance(o, ImageFormat): + return o.value + + if isinstance(o, PasswordVersion): + return o.value + + if isinstance(o, MessagingProviderType): + return o.value + + return super().default(o) \ No newline at end of file diff --git a/appwrite/enums/__init__.py b/appwrite/enums/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/appwrite/enums/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/appwrite/enums/authenticator_factor.py b/appwrite/enums/authenticator_factor.py new file mode 100644 index 0000000..3850b86 --- /dev/null +++ b/appwrite/enums/authenticator_factor.py @@ -0,0 +1,4 @@ +from enum import Enum + +class AuthenticatorFactor(Enum): + TOTP = "totp" diff --git a/appwrite/enums/authenticator_provider.py b/appwrite/enums/authenticator_provider.py new file mode 100644 index 0000000..9db892d --- /dev/null +++ b/appwrite/enums/authenticator_provider.py @@ -0,0 +1,4 @@ +from enum import Enum + +class AuthenticatorProvider(Enum): + TOTP = "totp" diff --git a/appwrite/enums/browser.py b/appwrite/enums/browser.py new file mode 100644 index 0000000..02974ec --- /dev/null +++ b/appwrite/enums/browser.py @@ -0,0 +1,17 @@ +from enum import Enum + +class Browser(Enum): + AVANT_BROWSER = "aa" + ANDROID_WEBVIEW_BETA = "an" + GOOGLE_CHROME = "ch" + GOOGLE_CHROME_IOS = "ci" + GOOGLE_CHROME_MOBILE = "cm" + CHROMIUM = "cr" + MOZILLA_FIREFOX = "ff" + SAFARI = "sf" + MOBILE_SAFARI = "mf" + MICROSOFT_EDGE = "ps" + MICROSOFT_EDGE_IOS = "oi" + OPERA_MINI = "om" + OPERA = "op" + OPERA_NEXT = "on" diff --git a/appwrite/enums/compression.py b/appwrite/enums/compression.py new file mode 100644 index 0000000..6d2d21a --- /dev/null +++ b/appwrite/enums/compression.py @@ -0,0 +1,6 @@ +from enum import Enum + +class Compression(Enum): + NONE = "none" + GZIP = "gzip" + ZSTD = "zstd" diff --git a/appwrite/enums/credit_card.py b/appwrite/enums/credit_card.py new file mode 100644 index 0000000..127e077 --- /dev/null +++ b/appwrite/enums/credit_card.py @@ -0,0 +1,19 @@ +from enum import Enum + +class CreditCard(Enum): + AMERICAN_EXPRESS = "amex" + ARGENCARD = "argencard" + CABAL = "cabal" + CONSOSUD = "censosud" + DINERS_CLUB = "diners" + DISCOVER = "discover" + ELO = "elo" + HIPERCARD = "hipercard" + JCB = "jcb" + MASTERCARD = "mastercard" + NARANJA = "naranja" + TARJETA_SHOPPING = "targeta-shopping" + UNION_CHINA_PAY = "union-china-pay" + VISA = "visa" + MIR = "mir" + MAESTRO = "maestro" diff --git a/appwrite/enums/execution_method.py b/appwrite/enums/execution_method.py new file mode 100644 index 0000000..23df3b9 --- /dev/null +++ b/appwrite/enums/execution_method.py @@ -0,0 +1,9 @@ +from enum import Enum + +class ExecutionMethod(Enum): + GET = "GET" + POST = "POST" + PUT = "PUT" + PATCH = "PATCH" + DELETE = "DELETE" + OPTIONS = "OPTIONS" diff --git a/appwrite/enums/flag.py b/appwrite/enums/flag.py new file mode 100644 index 0000000..5988e11 --- /dev/null +++ b/appwrite/enums/flag.py @@ -0,0 +1,197 @@ +from enum import Enum + +class Flag(Enum): + AFGHANISTAN = "af" + ANGOLA = "ao" + ALBANIA = "al" + ANDORRA = "ad" + UNITED_ARAB_EMIRATES = "ae" + ARGENTINA = "ar" + ARMENIA = "am" + ANTIGUA_AND_BARBUDA = "ag" + AUSTRALIA = "au" + AUSTRIA = "at" + AZERBAIJAN = "az" + BURUNDI = "bi" + BELGIUM = "be" + BENIN = "bj" + BURKINA_FASO = "bf" + BANGLADESH = "bd" + BULGARIA = "bg" + BAHRAIN = "bh" + BAHAMAS = "bs" + BOSNIA_AND_HERZEGOVINA = "ba" + BELARUS = "by" + BELIZE = "bz" + BOLIVIA = "bo" + BRAZIL = "br" + BARBADOS = "bb" + BRUNEI_DARUSSALAM = "bn" + BHUTAN = "bt" + BOTSWANA = "bw" + CENTRAL_AFRICAN_REPUBLIC = "cf" + CANADA = "ca" + SWITZERLAND = "ch" + CHILE = "cl" + CHINA = "cn" + CôTE_D'IVOIRE = "ci" + CAMEROON = "cm" + DEMOCRATIC_REPUBLIC_OF_THE_CONGO = "cd" + REPUBLIC_OF_THE_CONGO = "cg" + COLOMBIA = "co" + COMOROS = "km" + CAPE_VERDE = "cv" + COSTA_RICA = "cr" + CUBA = "cu" + CYPRUS = "cy" + CZECH_REPUBLIC = "cz" + GERMANY = "de" + DJIBOUTI = "dj" + DOMINICA = "dm" + DENMARK = "dk" + DOMINICAN_REPUBLIC = "do" + ALGERIA = "dz" + ECUADOR = "ec" + EGYPT = "eg" + ERITREA = "er" + SPAIN = "es" + ESTONIA = "ee" + ETHIOPIA = "et" + FINLAND = "fi" + FIJI = "fj" + FRANCE = "fr" + MICRONESIA_FEDERATED_STATES_OF = "fm" + GABON = "ga" + UNITED_KINGDOM = "gb" + GEORGIA = "ge" + GHANA = "gh" + GUINEA = "gn" + GAMBIA = "gm" + GUINEABISSAU = "gw" + EQUATORIAL_GUINEA = "gq" + GREECE = "gr" + GRENADA = "gd" + GUATEMALA = "gt" + GUYANA = "gy" + HONDURAS = "hn" + CROATIA = "hr" + HAITI = "ht" + HUNGARY = "hu" + INDONESIA = "id" + INDIA = "in" + IRELAND = "ie" + IRAN_ISLAMIC_REPUBLIC_OF = "ir" + IRAQ = "iq" + ICELAND = "is" + ISRAEL = "il" + ITALY = "it" + JAMAICA = "jm" + JORDAN = "jo" + JAPAN = "jp" + KAZAKHSTAN = "kz" + KENYA = "ke" + KYRGYZSTAN = "kg" + CAMBODIA = "kh" + KIRIBATI = "ki" + SAINT_KITTS_AND_NEVIS = "kn" + SOUTH_KOREA = "kr" + KUWAIT = "kw" + LAO_PEOPLE'S_DEMOCRATIC_REPUBLIC = "la" + LEBANON = "lb" + LIBERIA = "lr" + LIBYA = "ly" + SAINT_LUCIA = "lc" + LIECHTENSTEIN = "li" + SRI_LANKA = "lk" + LESOTHO = "ls" + LITHUANIA = "lt" + LUXEMBOURG = "lu" + LATVIA = "lv" + MOROCCO = "ma" + MONACO = "mc" + MOLDOVA = "md" + MADAGASCAR = "mg" + MALDIVES = "mv" + MEXICO = "mx" + MARSHALL_ISLANDS = "mh" + NORTH_MACEDONIA = "mk" + MALI = "ml" + MALTA = "mt" + MYANMAR = "mm" + MONTENEGRO = "me" + MONGOLIA = "mn" + MOZAMBIQUE = "mz" + MAURITANIA = "mr" + MAURITIUS = "mu" + MALAWI = "mw" + MALAYSIA = "my" + NAMIBIA = "na" + NIGER = "ne" + NIGERIA = "ng" + NICARAGUA = "ni" + NETHERLANDS = "nl" + NORWAY = "no" + NEPAL = "np" + NAURU = "nr" + NEW_ZEALAND = "nz" + OMAN = "om" + PAKISTAN = "pk" + PANAMA = "pa" + PERU = "pe" + PHILIPPINES = "ph" + PALAU = "pw" + PAPUA_NEW_GUINEA = "pg" + POLAND = "pl" + NORTH_KOREA = "kp" + PORTUGAL = "pt" + PARAGUAY = "py" + QATAR = "qa" + ROMANIA = "ro" + RUSSIA = "ru" + RWANDA = "rw" + SAUDI_ARABIA = "sa" + SUDAN = "sd" + SENEGAL = "sn" + SINGAPORE = "sg" + SOLOMON_ISLANDS = "sb" + SIERRA_LEONE = "sl" + EL_SALVADOR = "sv" + SAN_MARINO = "sm" + SOMALIA = "so" + SERBIA = "rs" + SOUTH_SUDAN = "ss" + SAO_TOME_AND_PRINCIPE = "st" + SURINAME = "sr" + SLOVAKIA = "sk" + SLOVENIA = "si" + SWEDEN = "se" + ESWATINI = "sz" + SEYCHELLES = "sc" + SYRIA = "sy" + CHAD = "td" + TOGO = "tg" + THAILAND = "th" + TAJIKISTAN = "tj" + TURKMENISTAN = "tm" + TIMORLESTE = "tl" + TONGA = "to" + TRINIDAD_AND_TOBAGO = "tt" + TUNISIA = "tn" + TURKEY = "tr" + TUVALU = "tv" + TANZANIA = "tz" + UGANDA = "ug" + UKRAINE = "ua" + URUGUAY = "uy" + UNITED_STATES = "us" + UZBEKISTAN = "uz" + VATICAN_CITY = "va" + SAINT_VINCENT_AND_THE_GRENADINES = "vc" + VENEZUELA = "ve" + VIETNAM = "vn" + VANUATU = "vu" + SAMOA = "ws" + YEMEN = "ye" + SOUTH_AFRICA = "za" + ZAMBIA = "zm" + ZIMBABWE = "zw" diff --git a/appwrite/enums/image_format.py b/appwrite/enums/image_format.py new file mode 100644 index 0000000..7cdd8f3 --- /dev/null +++ b/appwrite/enums/image_format.py @@ -0,0 +1,8 @@ +from enum import Enum + +class ImageFormat(Enum): + JPG = "jpg" + JPEG = "jpeg" + GIF = "gif" + PNG = "png" + WEBP = "webp" diff --git a/appwrite/enums/image_gravity.py b/appwrite/enums/image_gravity.py new file mode 100644 index 0000000..1d365a9 --- /dev/null +++ b/appwrite/enums/image_gravity.py @@ -0,0 +1,12 @@ +from enum import Enum + +class ImageGravity(Enum): + CENTER = "center" + TOPLEFT = "top-left" + TOP = "top" + TOPRIGHT = "top-right" + LEFT = "left" + RIGHT = "right" + BOTTOMLEFT = "bottom-left" + BOTTOM = "bottom" + BOTTOMRIGHT = "bottom-right" diff --git a/appwrite/enums/index_type.py b/appwrite/enums/index_type.py new file mode 100644 index 0000000..842240f --- /dev/null +++ b/appwrite/enums/index_type.py @@ -0,0 +1,7 @@ +from enum import Enum + +class IndexType(Enum): + KEY = "key" + FULLTEXT = "fulltext" + UNIQUE = "unique" + SPATIAL = "spatial" diff --git a/appwrite/enums/message_type.py b/appwrite/enums/message_type.py new file mode 100644 index 0000000..0961a12 --- /dev/null +++ b/appwrite/enums/message_type.py @@ -0,0 +1,6 @@ +from enum import Enum + +class MessageType(Enum): + DRAFT = "draft" + CANCELLED = "cancelled" + PROCESSING = "processing" diff --git a/appwrite/enums/messaging_provider_type.py b/appwrite/enums/messaging_provider_type.py new file mode 100644 index 0000000..e6e7c07 --- /dev/null +++ b/appwrite/enums/messaging_provider_type.py @@ -0,0 +1,6 @@ +from enum import Enum + +class MessagingProviderType(Enum): + EMAIL = "email" + SMS = "sms" + PUSH = "push" diff --git a/appwrite/enums/o_auth_provider.py b/appwrite/enums/o_auth_provider.py new file mode 100644 index 0000000..3d46c8e --- /dev/null +++ b/appwrite/enums/o_auth_provider.py @@ -0,0 +1,42 @@ +from enum import Enum + +class OAuthProvider(Enum): + AMAZON = "amazon" + APPLE = "apple" + AUTH0 = "auth0" + AUTHENTIK = "authentik" + AUTODESK = "autodesk" + BITBUCKET = "bitbucket" + BITLY = "bitly" + BOX = "box" + DAILYMOTION = "dailymotion" + DISCORD = "discord" + DISQUS = "disqus" + DROPBOX = "dropbox" + ETSY = "etsy" + FACEBOOK = "facebook" + GITHUB = "github" + GITLAB = "gitlab" + GOOGLE = "google" + LINKEDIN = "linkedin" + MICROSOFT = "microsoft" + NOTION = "notion" + OIDC = "oidc" + OKTA = "okta" + PAYPAL = "paypal" + PAYPALSANDBOX = "paypalSandbox" + PODIO = "podio" + SALESFORCE = "salesforce" + SLACK = "slack" + SPOTIFY = "spotify" + STRIPE = "stripe" + TRADESHIFT = "tradeshift" + TRADESHIFTBOX = "tradeshiftBox" + TWITCH = "twitch" + WORDPRESS = "wordpress" + YAHOO = "yahoo" + YAMMER = "yammer" + YANDEX = "yandex" + ZOHO = "zoho" + ZOOM = "zoom" + MOCK = "mock" diff --git a/appwrite/enums/password_version.py b/appwrite/enums/password_version.py new file mode 100644 index 0000000..e3df201 --- /dev/null +++ b/appwrite/enums/password_version.py @@ -0,0 +1,14 @@ +from enum import Enum + +class PasswordVersion(Enum): + SHA1 = "sha1" + SHA224 = "sha224" + SHA256 = "sha256" + SHA384 = "sha384" + SHA512/224 = "sha512/224" + SHA512/256 = "sha512/256" + SHA512 = "sha512" + SHA3224 = "sha3-224" + SHA3256 = "sha3-256" + SHA3384 = "sha3-384" + SHA3512 = "sha3-512" diff --git a/appwrite/enums/relation_mutate.py b/appwrite/enums/relation_mutate.py new file mode 100644 index 0000000..ae52aa7 --- /dev/null +++ b/appwrite/enums/relation_mutate.py @@ -0,0 +1,6 @@ +from enum import Enum + +class RelationMutate(Enum): + CASCADE = "cascade" + RESTRICT = "restrict" + SETNULL = "setNull" diff --git a/appwrite/enums/relationship_type.py b/appwrite/enums/relationship_type.py new file mode 100644 index 0000000..7866ca6 --- /dev/null +++ b/appwrite/enums/relationship_type.py @@ -0,0 +1,7 @@ +from enum import Enum + +class RelationshipType(Enum): + ONETOONE = "oneToOne" + MANYTOONE = "manyToOne" + MANYTOMANY = "manyToMany" + ONETOMANY = "oneToMany" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py new file mode 100644 index 0000000..cca0f68 --- /dev/null +++ b/appwrite/enums/runtime.py @@ -0,0 +1,7 @@ +from enum import Enum + +class Runtime(Enum): + NODE180 = "node-18.0" + PHP80 = "php-8.0" + RUBY31 = "ruby-3.1" + PYTHON39 = "python-3.9" diff --git a/appwrite/enums/smtp_encryption.py b/appwrite/enums/smtp_encryption.py new file mode 100644 index 0000000..405fc60 --- /dev/null +++ b/appwrite/enums/smtp_encryption.py @@ -0,0 +1,6 @@ +from enum import Enum + +class SMTPEncryption(Enum): + NONE = "none" + SSL = "ssl" + TLS = "tls" diff --git a/appwrite/input_file.py b/appwrite/input_file.py index 9f11b0c..33d5a77 100644 --- a/appwrite/input_file.py +++ b/appwrite/input_file.py @@ -12,7 +12,7 @@ def from_path(cls, path): return instance @classmethod - def from_bytes(cls, bytes, filename = None, mime_type = None): + def from_bytes(cls, bytes, filename, mime_type = None): instance = cls() instance.data = bytes instance.filename = filename diff --git a/appwrite/query.py b/appwrite/query.py index d970bd8..f25e33d 100644 --- a/appwrite/query.py +++ b/appwrite/query.py @@ -1,92 +1,108 @@ -class Query: +import json + + +# Inherit from dict to allow for easy serialization +class Query(): + def __init__(self, method, attribute=None, values=None): + self.method = method + + if attribute is not None: + self.attribute = attribute + + if values is not None: + self.values = values if isinstance(values, list) else [values] + + def __str__(self): + return json.dumps( + self.__dict__, + separators=(",", ":"), + default=lambda obj: obj.__dict__ + ) + @staticmethod def equal(attribute, value): - return Query.add_query(attribute, "equal", value) + return str(Query("equal", attribute, value)) @staticmethod def not_equal(attribute, value): - return Query.add_query(attribute, "notEqual", value) - + return str(Query("notEqual", attribute, value)) + @staticmethod def less_than(attribute, value): - return Query.add_query(attribute, "lessThan", value) - + return str(Query("lessThan", attribute, value)) + @staticmethod def less_than_equal(attribute, value): - return Query.add_query(attribute, "lessThanEqual", value) - + return str(Query("lessThanEqual", attribute, value)) + @staticmethod def greater_than(attribute, value): - return Query.add_query(attribute, "greaterThan", value) - + return str(Query("greaterThan", attribute, value)) + @staticmethod def greater_than_equal(attribute, value): - return Query.add_query(attribute, "greaterThanEqual", value) + return str(Query("greaterThanEqual", attribute, value)) @staticmethod def is_null(attribute): - return f'isNull("{attribute}")' + return str(Query("isNull", attribute, None)) @staticmethod def is_not_null(attribute): - return f'isNotNull("{attribute}")' + return str(Query("isNotNull", attribute, None)) @staticmethod def between(attribute, start, end): - return f'between("{attribute}", {Query.parseValues(start)}, {Query.parseValues(end)})' + return str(Query("between", attribute, [start, end])) @staticmethod def starts_with(attribute, value): - return Query.add_query(attribute, "startsWith", value) + return str(Query("startsWith", attribute, value)) @staticmethod def ends_with(attribute, value): - return Query.add_query(attribute, "endsWith", value) + return str(Query("endsWith", attribute, value)) @staticmethod def select(attributes): - return f'select([{",".join(map(Query.parseValues, attributes))}])' + return str(Query("select", None, attributes)) @staticmethod def search(attribute, value): - return Query.add_query(attribute, "search", value) + return str(Query("search", attribute, value)) @staticmethod def order_asc(attribute): - return f'orderAsc("{attribute}")' + return str(Query("orderAsc", attribute, None)) @staticmethod def order_desc(attribute): - return f'orderDesc("{attribute}")' + return str(Query("orderDesc", attribute, None)) @staticmethod def cursor_before(id): - return f'cursorBefore("{id}")' + return str(Query("cursorBefore", None, id)) @staticmethod def cursor_after(id): - return f'cursorAfter("{id}")' + return str(Query("cursorAfter", None, id)) @staticmethod def limit(limit): - return f'limit({limit})' + return str(Query("limit", None, limit)) @staticmethod def offset(offset): - return f'offset({offset})' + return str(Query("offset", None, offset)) + + @staticmethod + def contains(attribute, value): + return str(Query("contains", attribute, value)) @staticmethod - def add_query(attribute, method, value): - if type(value) == list: - return f'{method}("{attribute}", [{",".join(map(Query.parseValues, value))}])' - else: - return f'{method}("{attribute}", [{Query.parseValues(value)}])' + def or_queries(queries): + return str(Query("or", None, [json.loads(query) for query in queries])) @staticmethod - def parseValues(value): - if type(value) == str: - return f'"{value}"' - elif type(value) == bool: - return str(value).lower() - else: - return str(value) \ No newline at end of file + def and_queries(queries): + return str(Query("and", None, [json.loads(query) for query in queries])) diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 278d890..dd528fe 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -17,6 +17,31 @@ def get(self): 'content-type': 'application/json', }, api_params) + def create(self, user_id, email, password, name = None): + """Create account""" + + + api_path = '/account' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if email is None: + raise AppwriteException('Missing required parameter: "email"') + + if password is None: + raise AppwriteException('Missing required parameter: "password"') + + + api_params['userId'] = user_id + api_params['email'] = email + api_params['password'] = password + api_params['name'] = name + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_email(self, email, password): """Update email""" @@ -51,7 +76,7 @@ def list_identities(self, queries = None): }, api_params) def delete_identity(self, identity_id): - """Delete Identity""" + """Delete identity""" api_path = '/account/identities/{identityId}' @@ -66,6 +91,17 @@ def delete_identity(self, identity_id): 'content-type': 'application/json', }, api_params) + def create_jwt(self): + """Create JWT""" + + + api_path = '/account/jwt' + api_params = {} + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def list_logs(self, queries = None): """List logs""" @@ -79,6 +115,125 @@ def list_logs(self, queries = None): 'content-type': 'application/json', }, api_params) + def update_mfa(self, mfa): + """Update MFA""" + + + api_path = '/account/mfa' + api_params = {} + if mfa is None: + raise AppwriteException('Missing required parameter: "mfa"') + + + api_params['mfa'] = mfa + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_challenge(self, provider): + """Create MFA Challenge""" + + + api_path = '/account/mfa/challenge' + api_params = {} + if provider is None: + raise AppwriteException('Missing required parameter: "provider"') + + + api_params['provider'] = provider + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_challenge(self, challenge_id, otp): + """Create MFA Challenge (confirmation)""" + + + api_path = '/account/mfa/challenge' + api_params = {} + if challenge_id is None: + raise AppwriteException('Missing required parameter: "challenge_id"') + + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + + api_params['challengeId'] = challenge_id + api_params['otp'] = otp + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_factors(self): + """List Factors""" + + + api_path = '/account/mfa/factors' + api_params = {} + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def add_authenticator(self, factor): + """Add Authenticator""" + + + api_path = '/account/mfa/{factor}' + api_params = {} + if factor is None: + raise AppwriteException('Missing required parameter: "factor"') + + api_path = api_path.replace('{factor}', factor) + + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def verify_authenticator(self, factor, otp): + """Verify Authenticator""" + + + api_path = '/account/mfa/{factor}' + api_params = {} + if factor is None: + raise AppwriteException('Missing required parameter: "factor"') + + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + api_path = api_path.replace('{factor}', factor) + + api_params['otp'] = otp + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_authenticator(self, provider, otp): + """Delete Authenticator""" + + + api_path = '/account/mfa/{provider}' + api_params = {} + if provider is None: + raise AppwriteException('Missing required parameter: "provider"') + + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + api_path = api_path.replace('{provider}', provider) + + api_params['otp'] = otp + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_name(self, name): """Update name""" @@ -179,7 +334,7 @@ def create_recovery(self, email, url): 'content-type': 'application/json', }, api_params) - def update_recovery(self, user_id, secret, password, password_again): + def update_recovery(self, user_id, secret, password): """Create password recovery (confirmation)""" @@ -194,14 +349,10 @@ def update_recovery(self, user_id, secret, password, password_again): if password is None: raise AppwriteException('Missing required parameter: "password"') - if password_again is None: - raise AppwriteException('Missing required parameter: "password_again"') - api_params['userId'] = user_id api_params['secret'] = secret api_params['password'] = password - api_params['passwordAgain'] = password_again return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -229,6 +380,97 @@ def delete_sessions(self): 'content-type': 'application/json', }, api_params) + def create_anonymous_session(self): + """Create anonymous session""" + + + api_path = '/account/sessions/anonymous' + api_params = {} + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_email_password_session(self, email, password): + """Create email password session""" + + + api_path = '/account/sessions/email' + api_params = {} + if email is None: + raise AppwriteException('Missing required parameter: "email"') + + if password is None: + raise AppwriteException('Missing required parameter: "password"') + + + api_params['email'] = email + api_params['password'] = password + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_magic_url_session(self, user_id, secret): + """Create session (deprecated)""" + + + api_path = '/account/sessions/magic-url' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if secret is None: + raise AppwriteException('Missing required parameter: "secret"') + + + api_params['userId'] = user_id + api_params['secret'] = secret + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_o_auth2_session(self, provider, success = None, failure = None, token = None, scopes = None): + """Create OAuth2 session""" + + + api_path = '/account/sessions/oauth2/{provider}' + api_params = {} + if provider is None: + raise AppwriteException('Missing required parameter: "provider"') + + api_path = api_path.replace('{provider}', provider) + + api_params['success'] = success + api_params['failure'] = failure + api_params['token'] = token + api_params['scopes'] = scopes + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_session(self, user_id, secret): + """Create session""" + + + api_path = '/account/sessions/token' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if secret is None: + raise AppwriteException('Missing required parameter: "secret"') + + + api_params['userId'] = user_id + api_params['secret'] = secret + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def get_session(self, session_id): """Get session""" @@ -246,7 +488,7 @@ def get_session(self, session_id): }, api_params) def update_session(self, session_id): - """Update OAuth session (refresh tokens)""" + """Update (or renew) a session""" api_path = '/account/sessions/{sessionId}' @@ -288,6 +530,69 @@ def update_status(self): 'content-type': 'application/json', }, api_params) + def create_email_token(self, user_id, email, phrase = None): + """Create email token (OTP)""" + + + api_path = '/account/tokens/email' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if email is None: + raise AppwriteException('Missing required parameter: "email"') + + + api_params['userId'] = user_id + api_params['email'] = email + api_params['phrase'] = phrase + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_magic_url_token(self, user_id, email, url = None, phrase = None): + """Create magic URL token""" + + + api_path = '/account/tokens/magic-url' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if email is None: + raise AppwriteException('Missing required parameter: "email"') + + + api_params['userId'] = user_id + api_params['email'] = email + api_params['url'] = url + api_params['phrase'] = phrase + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_phone_token(self, user_id, phone): + """Create phone token""" + + + api_path = '/account/tokens/phone' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if phone is None: + raise AppwriteException('Missing required parameter: "phone"') + + + api_params['userId'] = user_id + api_params['phone'] = phone + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def create_verification(self, url): """Create email verification""" diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py new file mode 100644 index 0000000..addbf0e --- /dev/null +++ b/appwrite/services/messaging.py @@ -0,0 +1,998 @@ +from ..service import Service +from ..exception import AppwriteException + +class Messaging(Service): + + def __init__(self, client): + super(Messaging, self).__init__(client) + + def list_messages(self, queries = None, search = None): + """List messages""" + + + api_path = '/messaging/messages' + api_params = {} + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, status = None, html = None, scheduled_at = None): + """Create an email.""" + + + api_path = '/messaging/messages/email' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + if subject is None: + raise AppwriteException('Missing required parameter: "subject"') + + if content is None: + raise AppwriteException('Missing required parameter: "content"') + + + api_params['messageId'] = message_id + api_params['subject'] = subject + api_params['content'] = content + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['cc'] = cc + api_params['bcc'] = bcc + api_params['status'] = status + api_params['html'] = html + api_params['scheduledAt'] = scheduled_at + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, status = None, html = None, cc = None, bcc = None, scheduled_at = None): + """Update an email.""" + + + api_path = '/messaging/messages/email/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['subject'] = subject + api_params['content'] = content + api_params['status'] = status + api_params['html'] = html + api_params['cc'] = cc + api_params['bcc'] = bcc + api_params['scheduledAt'] = scheduled_at + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): + """Create a push notification.""" + + + api_path = '/messaging/messages/push' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + if title is None: + raise AppwriteException('Missing required parameter: "title"') + + if body is None: + raise AppwriteException('Missing required parameter: "body"') + + + api_params['messageId'] = message_id + api_params['title'] = title + api_params['body'] = body + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['data'] = data + api_params['action'] = action + api_params['icon'] = icon + api_params['sound'] = sound + api_params['color'] = color + api_params['tag'] = tag + api_params['badge'] = badge + api_params['status'] = status + api_params['scheduledAt'] = scheduled_at + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): + """Update a push notification.""" + + + api_path = '/messaging/messages/push/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['title'] = title + api_params['body'] = body + api_params['data'] = data + api_params['action'] = action + api_params['icon'] = icon + api_params['sound'] = sound + api_params['color'] = color + api_params['tag'] = tag + api_params['badge'] = badge + api_params['status'] = status + api_params['scheduledAt'] = scheduled_at + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_sms(self, message_id, content, topics = None, users = None, targets = None, status = None, scheduled_at = None): + """Create an SMS.""" + + + api_path = '/messaging/messages/sms' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + if content is None: + raise AppwriteException('Missing required parameter: "content"') + + + api_params['messageId'] = message_id + api_params['content'] = content + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['status'] = status + api_params['scheduledAt'] = scheduled_at + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, status = None, scheduled_at = None): + """Update an SMS.""" + + + api_path = '/messaging/messages/sms/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['content'] = content + api_params['status'] = status + api_params['scheduledAt'] = scheduled_at + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_message(self, message_id): + """Get a message""" + + + api_path = '/messaging/messages/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete(self, message_id): + """Delete a message""" + + + api_path = '/messaging/messages/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_message_logs(self, message_id, queries = None): + """List message logs""" + + + api_path = '/messaging/messages/{messageId}/logs' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_targets(self, message_id, queries = None): + """List message targets""" + + + api_path = '/messaging/messages/{messageId}/targets' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_providers(self, queries = None, search = None): + """List providers""" + + + api_path = '/messaging/providers' + api_params = {} + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, enabled = None): + """Create APNS provider""" + + + api_path = '/messaging/providers/apns' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['authKey'] = auth_key + api_params['authKeyId'] = auth_key_id + api_params['teamId'] = team_id + api_params['bundleId'] = bundle_id + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_apns_provider(self, provider_id, name = None, enabled = None, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None): + """Update APNS provider""" + + + api_path = '/messaging/providers/apns/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['authKey'] = auth_key + api_params['authKeyId'] = auth_key_id + api_params['teamId'] = team_id + api_params['bundleId'] = bundle_id + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_fcm_provider(self, provider_id, name, service_account_json = None, enabled = None): + """Create FCM provider""" + + + api_path = '/messaging/providers/fcm' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['serviceAccountJSON'] = service_account_json + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_fcm_provider(self, provider_id, name = None, enabled = None, service_account_json = None): + """Update FCM provider""" + + + api_path = '/messaging/providers/fcm/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['serviceAccountJSON'] = service_account_json + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_mailgun_provider(self, provider_id, name, api_key = None, domain = None, is_eu_region = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): + """Create Mailgun provider""" + + + api_path = '/messaging/providers/mailgun' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['apiKey'] = api_key + api_params['domain'] = domain + api_params['isEuRegion'] = is_eu_region + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_mailgun_provider(self, provider_id, name = None, api_key = None, domain = None, is_eu_region = None, enabled = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): + """Update Mailgun provider""" + + + api_path = '/messaging/providers/mailgun/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['apiKey'] = api_key + api_params['domain'] = domain + api_params['isEuRegion'] = is_eu_region + api_params['enabled'] = enabled + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_msg91_provider(self, provider_id, name, xfrom = None, sender_id = None, auth_key = None, enabled = None): + """Create Msg91 provider""" + + + api_path = '/messaging/providers/msg91' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['senderId'] = sender_id + api_params['authKey'] = auth_key + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_msg91_provider(self, provider_id, name = None, enabled = None, sender_id = None, auth_key = None, xfrom = None): + """Update Msg91 provider""" + + + api_path = '/messaging/providers/msg91/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['senderId'] = sender_id + api_params['authKey'] = auth_key + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): + """Create Sendgrid provider""" + + + api_path = '/messaging/providers/sendgrid' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['apiKey'] = api_key + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): + """Update Sendgrid provider""" + + + api_path = '/messaging/providers/sendgrid/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['apiKey'] = api_key + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_smtp_provider(self, provider_id, name, host, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): + """Create SMTP provider""" + + + api_path = '/messaging/providers/smtp' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + if host is None: + raise AppwriteException('Missing required parameter: "host"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['host'] = host + api_params['port'] = port + api_params['username'] = username + api_params['password'] = password + api_params['encryption'] = encryption + api_params['autoTLS'] = auto_tls + api_params['mailer'] = mailer + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_smtp_provider(self, provider_id, name = None, host = None, port = None, username = None, password = None, encryption = None, auto_tls = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): + """Update SMTP provider""" + + + api_path = '/messaging/providers/smtp/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['host'] = host + api_params['port'] = port + api_params['username'] = username + api_params['password'] = password + api_params['encryption'] = encryption + api_params['autoTLS'] = auto_tls + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + api_params['enabled'] = enabled + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_telesign_provider(self, provider_id, name, xfrom = None, username = None, password = None, enabled = None): + """Create Telesign provider""" + + + api_path = '/messaging/providers/telesign' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['username'] = username + api_params['password'] = password + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_telesign_provider(self, provider_id, name = None, enabled = None, username = None, password = None, xfrom = None): + """Update Telesign provider""" + + + api_path = '/messaging/providers/telesign/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['username'] = username + api_params['password'] = password + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_textmagic_provider(self, provider_id, name, xfrom = None, username = None, api_key = None, enabled = None): + """Create Textmagic provider""" + + + api_path = '/messaging/providers/textmagic' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['username'] = username + api_params['apiKey'] = api_key + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_textmagic_provider(self, provider_id, name = None, enabled = None, username = None, api_key = None, xfrom = None): + """Update Textmagic provider""" + + + api_path = '/messaging/providers/textmagic/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['username'] = username + api_params['apiKey'] = api_key + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = None, auth_token = None, enabled = None): + """Create Twilio provider""" + + + api_path = '/messaging/providers/twilio' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['accountSid'] = account_sid + api_params['authToken'] = auth_token + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_twilio_provider(self, provider_id, name = None, enabled = None, account_sid = None, auth_token = None, xfrom = None): + """Update Twilio provider""" + + + api_path = '/messaging/providers/twilio/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['accountSid'] = account_sid + api_params['authToken'] = auth_token + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None, api_secret = None, enabled = None): + """Create Vonage provider""" + + + api_path = '/messaging/providers/vonage' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['apiKey'] = api_key + api_params['apiSecret'] = api_secret + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_vonage_provider(self, provider_id, name = None, enabled = None, api_key = None, api_secret = None, xfrom = None): + """Update Vonage provider""" + + + api_path = '/messaging/providers/vonage/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['apiKey'] = api_key + api_params['apiSecret'] = api_secret + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_provider(self, provider_id): + """Get provider""" + + + api_path = '/messaging/providers/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_provider(self, provider_id): + """Delete provider""" + + + api_path = '/messaging/providers/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_provider_logs(self, provider_id, queries = None): + """List provider logs""" + + + api_path = '/messaging/providers/{providerId}/logs' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_subscriber_logs(self, subscriber_id, queries = None): + """List subscriber logs""" + + + api_path = '/messaging/subscribers/{subscriberId}/logs' + api_params = {} + if subscriber_id is None: + raise AppwriteException('Missing required parameter: "subscriber_id"') + + api_path = api_path.replace('{subscriberId}', subscriber_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_topics(self, queries = None, search = None): + """List topics.""" + + + api_path = '/messaging/topics' + api_params = {} + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_topic(self, topic_id, name): + """Create a topic.""" + + + api_path = '/messaging/topics' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['topicId'] = topic_id + api_params['name'] = name + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_topic(self, topic_id): + """Get a topic.""" + + + api_path = '/messaging/topics/{topicId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_topic(self, topic_id, name = None): + """Update a topic.""" + + + api_path = '/messaging/topics/{topicId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + api_params['name'] = name + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_topic(self, topic_id): + """Delete a topic.""" + + + api_path = '/messaging/topics/{topicId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_topic_logs(self, topic_id, queries = None): + """List topic logs""" + + + api_path = '/messaging/topics/{topicId}/logs' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_subscribers(self, topic_id, queries = None, search = None): + """List subscribers.""" + + + api_path = '/messaging/topics/{topicId}/subscribers' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_subscriber(self, topic_id, subscriber_id, target_id): + """Create a subscriber.""" + + + api_path = '/messaging/topics/{topicId}/subscribers' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + if subscriber_id is None: + raise AppwriteException('Missing required parameter: "subscriber_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + api_params['subscriberId'] = subscriber_id + api_params['targetId'] = target_id + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_subscriber(self, topic_id, subscriber_id): + """Get a subscriber.""" + + + api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + if subscriber_id is None: + raise AppwriteException('Missing required parameter: "subscriber_id"') + + api_path = api_path.replace('{topicId}', topic_id) + api_path = api_path.replace('{subscriberId}', subscriber_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_subscriber(self, topic_id, subscriber_id): + """Delete a subscriber.""" + + + api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + if subscriber_id is None: + raise AppwriteException('Missing required parameter: "subscriber_id"') + + api_path = api_path.replace('{topicId}', topic_id) + api_path = api_path.replace('{subscriberId}', subscriber_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 2bcec8d..4b2a235 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -105,7 +105,7 @@ def list_identities(self, queries = None, search = None): }, api_params) def delete_identity(self, identity_id): - """Delete Identity""" + """Delete identity""" api_path = '/users/identities/{identityId}' @@ -383,6 +383,50 @@ def list_memberships(self, user_id): 'content-type': 'application/json', }, api_params) + def update_mfa(self, user_id, mfa): + """Update MFA""" + + + api_path = '/users/{userId}/mfa' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if mfa is None: + raise AppwriteException('Missing required parameter: "mfa"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['mfa'] = mfa + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_authenticator(self, user_id, provider, otp): + """Delete Authenticator""" + + + api_path = '/users/{userId}/mfa/{provider}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if provider is None: + raise AppwriteException('Missing required parameter: "provider"') + + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{provider}', provider) + + api_params['otp'] = otp + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_name(self, user_id, name): """Update name""" @@ -479,6 +523,22 @@ def update_prefs(self, user_id, prefs): 'content-type': 'application/json', }, api_params) + def list_providers(self, user_id): + """List Providers""" + + + api_path = '/users/{userId}/providers' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + def list_sessions(self, user_id): """List user sessions""" @@ -495,6 +555,22 @@ def list_sessions(self, user_id): 'content-type': 'application/json', }, api_params) + def create_session(self, user_id): + """Create session""" + + + api_path = '/users/{userId}/sessions' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def delete_sessions(self, user_id): """Delete user sessions""" @@ -551,6 +627,134 @@ def update_status(self, user_id, status): 'content-type': 'application/json', }, api_params) + def list_targets(self, user_id, queries = None): + """List User Targets""" + + + api_path = '/users/{userId}/targets' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_target(self, user_id, target_id, provider_type, identifier, provider_id = None, name = None): + """Create User Target""" + + + api_path = '/users/{userId}/targets' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + if provider_type is None: + raise AppwriteException('Missing required parameter: "provider_type"') + + if identifier is None: + raise AppwriteException('Missing required parameter: "identifier"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['targetId'] = target_id + api_params['providerType'] = provider_type + api_params['identifier'] = identifier + api_params['providerId'] = provider_id + api_params['name'] = name + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_target(self, user_id, target_id): + """Get User Target""" + + + api_path = '/users/{userId}/targets/{targetId}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{targetId}', target_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_target(self, user_id, target_id, identifier = None, provider_id = None, name = None): + """Update User target""" + + + api_path = '/users/{userId}/targets/{targetId}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{targetId}', target_id) + + api_params['identifier'] = identifier + api_params['providerId'] = provider_id + api_params['name'] = name + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_target(self, user_id, target_id): + """Delete user target""" + + + api_path = '/users/{userId}/targets/{targetId}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{targetId}', target_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_token(self, user_id, length = None, expire = None): + """Create token""" + + + api_path = '/users/{userId}/tokens' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['length'] = length + api_params['expire'] = expire + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_email_verification(self, user_id, email_verification): """Update email verification""" diff --git a/docs/examples/account/add-authenticator.md b/docs/examples/account/add-authenticator.md new file mode 100644 index 0000000..d938332 --- /dev/null +++ b/docs/examples/account/add-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import AuthenticatorFactor + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.add_authenticator(AuthenticatorFactor.TOTP) diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md new file mode 100644 index 0000000..71282f6 --- /dev/null +++ b/docs/examples/account/create-anonymous-session.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_anonymous_session() diff --git a/docs/examples/account/create-challenge.md b/docs/examples/account/create-challenge.md new file mode 100644 index 0000000..5a73bad --- /dev/null +++ b/docs/examples/account/create-challenge.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from Appwrite.enums import AuthenticatorProvider + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_challenge(AuthenticatorProvider.TOTP) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md new file mode 100644 index 0000000..718159b --- /dev/null +++ b/docs/examples/account/create-email-password-session.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_email_password_session('email@example.com', 'password') diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md new file mode 100644 index 0000000..00db0b3 --- /dev/null +++ b/docs/examples/account/create-email-token.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_email_token('[USER_ID]', 'email@example.com') diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md new file mode 100644 index 0000000..0889609 --- /dev/null +++ b/docs/examples/account/create-j-w-t.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_jwt() diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md new file mode 100644 index 0000000..390e9cb --- /dev/null +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_magic_url_token('[USER_ID]', 'email@example.com') diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md new file mode 100644 index 0000000..fcdb570 --- /dev/null +++ b/docs/examples/account/create-o-auth2session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from Appwrite.enums import OAuthProvider + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_o_auth2_session(OAuthProvider.AMAZON) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md new file mode 100644 index 0000000..c661de3 --- /dev/null +++ b/docs/examples/account/create-phone-token.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_phone_token('[USER_ID]', '+12065550100') diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 2203cdb..c4f3f6b 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 21130fe..e3937d5 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md new file mode 100644 index 0000000..04d4ece --- /dev/null +++ b/docs/examples/account/create-session.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_session('[USER_ID]', '[SECRET]') diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index c45d0d4..a9d7c27 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md new file mode 100644 index 0000000..7c4428d --- /dev/null +++ b/docs/examples/account/create.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create('[USER_ID]', 'email@example.com', '') diff --git a/docs/examples/account/delete-authenticator.md b/docs/examples/account/delete-authenticator.md new file mode 100644 index 0000000..3d81d79 --- /dev/null +++ b/docs/examples/account/delete-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import AuthenticatorProvider + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.delete_authenticator(AuthenticatorProvider.TOTP, '[OTP]') diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index bac4334..02a80c3 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 8095cdc..ac945fe 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 1728d61..9057b73 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index da2fd76..0b79b60 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 25b8f03..dc1d0de 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index f75bad7..752a823 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/list-factors.md b/docs/examples/account/list-factors.md new file mode 100644 index 0000000..a5ec4a2 --- /dev/null +++ b/docs/examples/account/list-factors.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.list_factors() diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 3c166d1..f14e5b4 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 65802d8..da2d511 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 12d5c81..2bdd710 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-challenge.md b/docs/examples/account/update-challenge.md new file mode 100644 index 0000000..f262ea3 --- /dev/null +++ b/docs/examples/account/update-challenge.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.update_challenge('[CHALLENGE_ID]', '[OTP]') diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index f4a6776..8e2bc67 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md new file mode 100644 index 0000000..ccb6d77 --- /dev/null +++ b/docs/examples/account/update-m-f-a.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.update_mfa(False) diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md new file mode 100644 index 0000000..c75e94c --- /dev/null +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.update_magic_url_session('[USER_ID]', '[SECRET]') diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index eb1eb62..2aaa411 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 955ada6..365c733 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index f2a75b4..9d4fdbb 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index aaee1f7..7c1b218 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index e96546b..c554961 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index b4ea8aa..4f14fa1 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,14 +1,13 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) -result = account.update_recovery('[USER_ID]', '[SECRET]', 'password', 'password') +result = account.update_recovery('[USER_ID]', '[SECRET]', '') diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index e7234f7..aca93ba 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 5924d4d..e7be5fb 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 9a410a5..3ae98a1 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/verify-authenticator.md b/docs/examples/account/verify-authenticator.md new file mode 100644 index 0000000..894a7ff --- /dev/null +++ b/docs/examples/account/verify-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import AuthenticatorFactor + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.verify_authenticator(AuthenticatorFactor.TOTP, '[OTP]') diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 9ed56d1..0d2220f 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars +from Appwrite.enums import Browser client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) -result = avatars.get_browser('aa') +result = avatars.get_browser(Browser.AVANT_BROWSER) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 9fa6b0f..b2a9afd 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars +from Appwrite.enums import CreditCard client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) -result = avatars.get_credit_card('amex') +result = avatars.get_credit_card(CreditCard.AMERICAN_EXPRESS) diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 75b0315..f3c5aed 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 70d2e5f..6c2fbee 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars +from Appwrite.enums import Flag client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) -result = avatars.get_flag('af') +result = avatars.get_flag(Flag.AFGHANISTAN) diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 35015d9..9c33063 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 639fa03..098d791 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 27fc8e2..b6191bd 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index f073d3d..e7b223f 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 183c55c..2d7c679 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 5c77689..c3039d1 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index aa95de9..f7b05e0 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 92cdcb2..8b25aaa 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index df66f12..b35f591 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 0bfe424..f4c1dd7 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 78a7d33..ba10266 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.services.databases import Databases +from Appwrite.enums import IndexType client = Client() @@ -11,4 +11,4 @@ client = Client() databases = Databases(client) -result = databases.create_index('[DATABASE_ID]', '[COLLECTION_ID]', '', 'key', []) +result = databases.create_index('[DATABASE_ID]', '[COLLECTION_ID]', '', IndexType.KEY, []) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index b3cce2b..d0619bd 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 967d284..d211390 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 4f69eca..9bfb6c3 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.services.databases import Databases +from Appwrite.enums import RelationshipType client = Client() @@ -11,4 +11,4 @@ client = Client() databases = Databases(client) -result = databases.create_relationship_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', 'oneToOne') +result = databases.create_relationship_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', RelationshipType.ONE_TO_ONE) diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 00bbbe9..820f06a 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index fd5b7f4..b6b5fb0 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index e4a8320..f2188b1 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 41871b2..95f8166 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 998bb61..dea504c 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 605b087..9c441a5 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index a53e06c..6aff595 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 780e145..bb9c307 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 0a61052..0c5a832 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 90f57a3..8bba64c 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 7085384..d89a040 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 3213c66..bc8852f 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 93a46b3..654f5d6 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 632202c..500a273 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index d0c98da..34c3c61 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 5eb03b2..014f54c 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index b4224be..c4685f5 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 3aa6839..41eb45a 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index e6a7d55..0c4c727 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 4a38aab..67c1a8b 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 5c79257..28bb030 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index c768c54..5496516 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 8148b01..567f10e 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 65ef26f..626ccc8 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index efbf1ad..ba5e25c 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 61c74b8..dcf92be 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 7d5a35d..e58e944 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 7c426a6..c717550 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 2ee236e..22861aa 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 119c787..2924e5d 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index d46692e..a3a3f13 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index 76888f8..8b3a95b 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 1ee1be0..a62d341 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,6 +1,5 @@ from appwrite.client import Client from appwrite.input_file import InputFile -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 7c04522..709ca07 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) functions = Functions(client) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index f33ed08..8198694 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index bf66396..c05c56a 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.services.functions import Functions +from Appwrite.enums import client = Client() @@ -11,4 +11,4 @@ client = Client() functions = Functions(client) -result = functions.create('[FUNCTION_ID]', '[NAME]', 'node-18.0') +result = functions.create('[FUNCTION_ID]', '[NAME]', .NODE-18.0) diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 42d526e..f5ec491 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index cae0f2d..1ee6b16 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index e89213e..ac5aa7f 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/download-deployment.md index ee51f67..f86f56e 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/download-deployment.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 6257b59..e324251 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index f0e4f0d..f7c1f04 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) functions = Functions(client) diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 4e71bff..1bbce36 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 30e1d59..9ceed7b 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index d1797a1..51b89a6 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index d70f004..112d884 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) functions = Functions(client) diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 19b85e2..941f22e 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 9a72bba..1ae2f51 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index b8442e5..107dacf 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 87dd097..08abe08 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index ab5b43a..452dcc4 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 3960054..4dbbee5 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 24226a5..80cb9c7 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.graphql import Graphql client = Client() diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 8e1597c..cebf63c 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.graphql import Graphql client = Client() diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index fbfaf0e..0894ff7 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 40bc010..e0d4f6b 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 803dd73..7fe0bf2 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 43ada69..4c63e6a 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 3170559..09f2d81 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 4fb0266..6771209 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 4faff96..576dd5e 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index c84b9be..863fa58 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 92e4e20..c84460b 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index b798ad7..99ecad2 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index cc2c3bc..225d286 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 95200f3..df77f45 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 1c91663..de2f90d 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 8406de1..79e47bf 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 5a35588..81dbde6 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index bb2533e..1d3c016 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 9fe313d..89cec53 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index d3ff594..b4bc8e6 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 06b04f2..2e4f028 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 3dc6cf8..646d82e 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index ba9c94f..75b78d8 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index ea4c43c..af224a8 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 5a4cafe..0b451c2 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index f8ec83c..c0c9008 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 347e81c..8501744 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index ce50a6e..c70d837 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/messaging/create-a-p-n-s-provider.md b/docs/examples/messaging/create-a-p-n-s-provider.md new file mode 100644 index 0000000..ad05664 --- /dev/null +++ b/docs/examples/messaging/create-a-p-n-s-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_apns_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md new file mode 100644 index 0000000..72fc437 --- /dev/null +++ b/docs/examples/messaging/create-email.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_email('[MESSAGE_ID]', '[SUBJECT]', '[CONTENT]') diff --git a/docs/examples/messaging/create-f-c-m-provider.md b/docs/examples/messaging/create-f-c-m-provider.md new file mode 100644 index 0000000..b6b2a7b --- /dev/null +++ b/docs/examples/messaging/create-f-c-m-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_fcm_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000..84fc1d5 --- /dev/null +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_mailgun_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md new file mode 100644 index 0000000..5db7e0e --- /dev/null +++ b/docs/examples/messaging/create-msg91provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_msg91_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md new file mode 100644 index 0000000..550f58b --- /dev/null +++ b/docs/examples/messaging/create-push.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_push('[MESSAGE_ID]', '[TITLE]', '[BODY]') diff --git a/docs/examples/messaging/create-s-m-s.md b/docs/examples/messaging/create-s-m-s.md new file mode 100644 index 0000000..d2eb41a --- /dev/null +++ b/docs/examples/messaging/create-s-m-s.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_sms('[MESSAGE_ID]', '[CONTENT]') diff --git a/docs/examples/messaging/create-s-m-t-p-provider.md b/docs/examples/messaging/create-s-m-t-p-provider.md new file mode 100644 index 0000000..f7af468 --- /dev/null +++ b/docs/examples/messaging/create-s-m-t-p-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_smtp_provider('[PROVIDER_ID]', '[NAME]', '[HOST]') diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000..003a397 --- /dev/null +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_sendgrid_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md new file mode 100644 index 0000000..82e9976 --- /dev/null +++ b/docs/examples/messaging/create-subscriber.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token +) + +messaging = Messaging(client) + +result = messaging.create_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]', '[TARGET_ID]') diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000..4139ccf --- /dev/null +++ b/docs/examples/messaging/create-telesign-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_telesign_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000..5b0fcfc --- /dev/null +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_textmagic_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md new file mode 100644 index 0000000..9dd5ce8 --- /dev/null +++ b/docs/examples/messaging/create-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_topic('[TOPIC_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000..e984b06 --- /dev/null +++ b/docs/examples/messaging/create-twilio-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_twilio_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000..31115b7 --- /dev/null +++ b/docs/examples/messaging/create-vonage-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_vonage_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md new file mode 100644 index 0000000..894cb6f --- /dev/null +++ b/docs/examples/messaging/delete-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.delete_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000..04012a5 --- /dev/null +++ b/docs/examples/messaging/delete-subscriber.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token +) + +messaging = Messaging(client) + +result = messaging.delete_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md new file mode 100644 index 0000000..4e6b380 --- /dev/null +++ b/docs/examples/messaging/delete-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.delete_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md new file mode 100644 index 0000000..2839355 --- /dev/null +++ b/docs/examples/messaging/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.delete('[MESSAGE_ID]') diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md new file mode 100644 index 0000000..19587e9 --- /dev/null +++ b/docs/examples/messaging/get-message.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.get_message('[MESSAGE_ID]') diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md new file mode 100644 index 0000000..9e02e14 --- /dev/null +++ b/docs/examples/messaging/get-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.get_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md new file mode 100644 index 0000000..a170f60 --- /dev/null +++ b/docs/examples/messaging/get-subscriber.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.get_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md new file mode 100644 index 0000000..ade0291 --- /dev/null +++ b/docs/examples/messaging/get-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.get_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md new file mode 100644 index 0000000..b77c8d9 --- /dev/null +++ b/docs/examples/messaging/list-message-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_message_logs('[MESSAGE_ID]') diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md new file mode 100644 index 0000000..eb8bdf6 --- /dev/null +++ b/docs/examples/messaging/list-messages.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_messages() diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000..c9ee22c --- /dev/null +++ b/docs/examples/messaging/list-provider-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_provider_logs('[PROVIDER_ID]') diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md new file mode 100644 index 0000000..5bb1223 --- /dev/null +++ b/docs/examples/messaging/list-providers.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_providers() diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000..56a5544 --- /dev/null +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_subscriber_logs('[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md new file mode 100644 index 0000000..85f5972 --- /dev/null +++ b/docs/examples/messaging/list-subscribers.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_subscribers('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md new file mode 100644 index 0000000..1463533 --- /dev/null +++ b/docs/examples/messaging/list-targets.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_targets('[MESSAGE_ID]') diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000..0eaac28 --- /dev/null +++ b/docs/examples/messaging/list-topic-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_topic_logs('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md new file mode 100644 index 0000000..4f6265f --- /dev/null +++ b/docs/examples/messaging/list-topics.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_topics() diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-a-p-n-s-provider.md new file mode 100644 index 0000000..74a3ade --- /dev/null +++ b/docs/examples/messaging/update-a-p-n-s-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_apns_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md new file mode 100644 index 0000000..a737e24 --- /dev/null +++ b/docs/examples/messaging/update-email.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_email('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-f-c-m-provider.md new file mode 100644 index 0000000..106d8af --- /dev/null +++ b/docs/examples/messaging/update-f-c-m-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_fcm_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000..995df6c --- /dev/null +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_mailgun_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md new file mode 100644 index 0000000..4504915 --- /dev/null +++ b/docs/examples/messaging/update-msg91provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_msg91_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md new file mode 100644 index 0000000..5b9a5d5 --- /dev/null +++ b/docs/examples/messaging/update-push.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_push('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-s-m-s.md b/docs/examples/messaging/update-s-m-s.md new file mode 100644 index 0000000..bb8039a --- /dev/null +++ b/docs/examples/messaging/update-s-m-s.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_sms('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-s-m-t-p-provider.md b/docs/examples/messaging/update-s-m-t-p-provider.md new file mode 100644 index 0000000..7faad9e --- /dev/null +++ b/docs/examples/messaging/update-s-m-t-p-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_smtp_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000..d5fafdc --- /dev/null +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_sendgrid_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000..59a1411 --- /dev/null +++ b/docs/examples/messaging/update-telesign-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_telesign_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000..70a0337 --- /dev/null +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_textmagic_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md new file mode 100644 index 0000000..61adea6 --- /dev/null +++ b/docs/examples/messaging/update-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000..5091170 --- /dev/null +++ b/docs/examples/messaging/update-twilio-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_twilio_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000..7cd819c --- /dev/null +++ b/docs/examples/messaging/update-vonage-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_vonage_provider('[PROVIDER_ID]') diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 72ffdcc..1fb104d 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index b469b5b..643dc93 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,13 +1,12 @@ from appwrite.client import Client from appwrite.input_file import InputFile -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 60dc107..3741e9d 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 9bed0af..6fc33f8 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 7ea64f2..b4ef599 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index e9f5cce..39e67c5 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 4e12291..e926f15 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 01cbfaf..7036f40 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index f83ed8a..e8b7af6 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 204fd95..8b5eaa7 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 63101e2..f3a6c12 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index fb1b76b..9cf6f02 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 24a92e3..a504371 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index cde8455..0d58c58 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index c690123..b524915 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index f8d8759..37af7f2 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 4fc0fa4..e1afd82 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index e9c62ae..85a15a3 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 40909fa..4603fb9 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index fdca2fc..e2284d5 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 63e662a..30e3945 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index e60cb60..edb3575 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index a6cd4cd..8fee274 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 816c6ad..e68ba08 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 929f4ec..4458bfb 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 4176c62..3579d2c 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index be1e8ce..c0eebc7 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 77c9918..8f1e3af 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index f3ab3f8..b01a5b0 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index e715f47..efaab20 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index 2a2db5a..7e784a4 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 0b42e98..4b3fdf4 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index b445623..cff12d7 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md new file mode 100644 index 0000000..44129de --- /dev/null +++ b/docs/examples/users/create-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.create_session('[USER_ID]') diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md new file mode 100644 index 0000000..1aea0c2 --- /dev/null +++ b/docs/examples/users/create-target.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import MessagingProviderType + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.create_target('[USER_ID]', '[TARGET_ID]', MessagingProviderType.EMAIL, '[IDENTIFIER]') diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md new file mode 100644 index 0000000..78bec21 --- /dev/null +++ b/docs/examples/users/create-token.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.create_token('[USER_ID]') diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 05249c0..ff4c92a 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md new file mode 100644 index 0000000..1f460be --- /dev/null +++ b/docs/examples/users/delete-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import AuthenticatorProvider + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +users = Users(client) + +result = users.delete_authenticator('[USER_ID]', AuthenticatorProvider.TOTP, '[OTP]') diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index d103824..5420468 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 26b041d..45f0c8d 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index dabe4f6..8e6e285 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md new file mode 100644 index 0000000..7d010e9 --- /dev/null +++ b/docs/examples/users/delete-target.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.delete_target('[USER_ID]', '[TARGET_ID]') diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 7fdc775..d09204f 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 2bbaa88..79a7100 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md new file mode 100644 index 0000000..1a77982 --- /dev/null +++ b/docs/examples/users/get-target.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.get_target('[USER_ID]', '[TARGET_ID]') diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 463957d..b74dcf5 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 0addd3e..279e9ce 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index ca3a5eb..0db92fc 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 0dfb97a..52abcb5 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-providers.md b/docs/examples/users/list-providers.md new file mode 100644 index 0000000..a1c285d --- /dev/null +++ b/docs/examples/users/list-providers.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +users = Users(client) + +result = users.list_providers('[USER_ID]') diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 5f8fbd6..24a7103 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md new file mode 100644 index 0000000..08f6fd2 --- /dev/null +++ b/docs/examples/users/list-targets.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.list_targets('[USER_ID]') diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index baaf42c..a5536b4 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 8be33ad..8582aa7 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 4899bd3..6d962e3 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index b2d4c2d..12e4b94 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md new file mode 100644 index 0000000..0882458 --- /dev/null +++ b/docs/examples/users/update-mfa.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.update_mfa('[USER_ID]', False) diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 66bb6b2..bff47a9 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index e79f125..71b6c86 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index e42317c..5565ee3 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 6df39fc..aabc4da 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 53d1e52..00309a9 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 6d1577d..fcd9b94 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md new file mode 100644 index 0000000..be8f764 --- /dev/null +++ b/docs/examples/users/update-target.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.update_target('[USER_ID]', '[TARGET_ID]') diff --git a/setup.py b/setup.py index 49f3672..ec85635 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '4.1.0', + version = '5.0.0-rc.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/4.1.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.1.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From 6db5966a1b88af4d1cc6000daf9f6d4fb8e51832 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Feb 2024 19:25:24 +1300 Subject: [PATCH 04/60] Fixes for nested query parsing and MFA route authentication types --- docs/examples/users/delete-authenticator.md | 2 +- docs/examples/users/list-providers.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md index 1f460be..94aa014 100644 --- a/docs/examples/users/delete-authenticator.md +++ b/docs/examples/users/delete-authenticator.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) users = Users(client) diff --git a/docs/examples/users/list-providers.md b/docs/examples/users/list-providers.md index a1c285d..cf95496 100644 --- a/docs/examples/users/list-providers.md +++ b/docs/examples/users/list-providers.md @@ -5,7 +5,7 @@ client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) users = Users(client) From 06b002d8aa58320786e3b63387eb7e4d672e1036 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 14 Feb 2024 07:24:03 +0000 Subject: [PATCH 05/60] chore: bug fixes and improvements --- README.md | 2 +- appwrite/client.py | 34 +- appwrite/encoders/__init__.py | 1 - appwrite/encoders/value_class_encoder.py | 77 -- appwrite/enums/__init__.py | 1 - appwrite/enums/authenticator_factor.py | 4 - appwrite/enums/authenticator_provider.py | 4 - appwrite/enums/browser.py | 17 - appwrite/enums/compression.py | 6 - appwrite/enums/credit_card.py | 19 - appwrite/enums/execution_method.py | 9 - appwrite/enums/flag.py | 197 ---- appwrite/enums/image_format.py | 8 - appwrite/enums/image_gravity.py | 12 - appwrite/enums/index_type.py | 7 - appwrite/enums/message_type.py | 6 - appwrite/enums/messaging_provider_type.py | 6 - appwrite/enums/o_auth_provider.py | 42 - appwrite/enums/password_version.py | 14 - appwrite/enums/relation_mutate.py | 6 - appwrite/enums/relationship_type.py | 7 - appwrite/enums/runtime.py | 7 - appwrite/enums/smtp_encryption.py | 6 - appwrite/query.py | 88 +- appwrite/services/account.py | 319 +----- appwrite/services/messaging.py | 998 ------------------ appwrite/services/users.py | 206 +--- docs/examples/account/add-authenticator.md | 14 - .../account/create-anonymous-session.md | 12 - docs/examples/account/create-challenge.md | 13 - .../account/create-email-password-session.md | 12 - docs/examples/account/create-email-token.md | 12 - docs/examples/account/create-j-w-t.md | 12 - .../account/create-magic-u-r-l-token.md | 12 - .../examples/account/create-o-auth2session.md | 13 - docs/examples/account/create-phone-token.md | 12 - .../account/create-phone-verification.md | 3 +- docs/examples/account/create-recovery.md | 3 +- docs/examples/account/create-session.md | 12 - docs/examples/account/create-verification.md | 3 +- docs/examples/account/create.md | 12 - docs/examples/account/delete-authenticator.md | 14 - docs/examples/account/delete-identity.md | 3 +- docs/examples/account/delete-session.md | 3 +- docs/examples/account/delete-sessions.md | 3 +- docs/examples/account/get-prefs.md | 3 +- docs/examples/account/get-session.md | 3 +- docs/examples/account/get.md | 3 +- docs/examples/account/list-factors.md | 13 - docs/examples/account/list-identities.md | 3 +- docs/examples/account/list-logs.md | 3 +- docs/examples/account/list-sessions.md | 3 +- docs/examples/account/update-challenge.md | 13 - docs/examples/account/update-email.md | 3 +- docs/examples/account/update-m-f-a.md | 13 - .../account/update-magic-u-r-l-session.md | 12 - docs/examples/account/update-name.md | 3 +- docs/examples/account/update-password.md | 3 +- .../account/update-phone-verification.md | 3 +- docs/examples/account/update-phone.md | 3 +- docs/examples/account/update-prefs.md | 3 +- docs/examples/account/update-recovery.md | 5 +- docs/examples/account/update-session.md | 3 +- docs/examples/account/update-status.md | 3 +- docs/examples/account/update-verification.md | 3 +- docs/examples/account/verify-authenticator.md | 14 - docs/examples/avatars/get-browser.md | 6 +- docs/examples/avatars/get-credit-card.md | 6 +- docs/examples/avatars/get-favicon.md | 3 +- docs/examples/avatars/get-flag.md | 6 +- docs/examples/avatars/get-image.md | 3 +- docs/examples/avatars/get-initials.md | 3 +- docs/examples/avatars/get-q-r.md | 3 +- .../databases/create-boolean-attribute.md | 1 + docs/examples/databases/create-collection.md | 1 + .../databases/create-datetime-attribute.md | 1 + docs/examples/databases/create-document.md | 3 +- .../databases/create-email-attribute.md | 1 + .../databases/create-enum-attribute.md | 1 + .../databases/create-float-attribute.md | 1 + docs/examples/databases/create-index.md | 4 +- .../databases/create-integer-attribute.md | 1 + .../examples/databases/create-ip-attribute.md | 1 + .../create-relationship-attribute.md | 4 +- .../databases/create-string-attribute.md | 1 + .../databases/create-url-attribute.md | 1 + docs/examples/databases/create.md | 1 + docs/examples/databases/delete-attribute.md | 1 + docs/examples/databases/delete-collection.md | 1 + docs/examples/databases/delete-document.md | 3 +- docs/examples/databases/delete-index.md | 1 + docs/examples/databases/delete.md | 1 + docs/examples/databases/get-attribute.md | 1 + docs/examples/databases/get-collection.md | 1 + docs/examples/databases/get-document.md | 3 +- docs/examples/databases/get-index.md | 1 + docs/examples/databases/get.md | 1 + docs/examples/databases/list-attributes.md | 1 + docs/examples/databases/list-collections.md | 1 + docs/examples/databases/list-documents.md | 3 +- docs/examples/databases/list-indexes.md | 1 + docs/examples/databases/list.md | 1 + .../databases/update-boolean-attribute.md | 1 + docs/examples/databases/update-collection.md | 1 + .../databases/update-datetime-attribute.md | 1 + docs/examples/databases/update-document.md | 3 +- .../databases/update-email-attribute.md | 1 + .../databases/update-enum-attribute.md | 1 + .../databases/update-float-attribute.md | 1 + .../databases/update-integer-attribute.md | 1 + .../examples/databases/update-ip-attribute.md | 1 + .../update-relationship-attribute.md | 1 + .../databases/update-string-attribute.md | 1 + .../databases/update-url-attribute.md | 1 + docs/examples/databases/update.md | 1 + docs/examples/functions/create-build.md | 1 + docs/examples/functions/create-deployment.md | 1 + docs/examples/functions/create-execution.md | 3 +- docs/examples/functions/create-variable.md | 1 + docs/examples/functions/create.md | 4 +- docs/examples/functions/delete-deployment.md | 1 + docs/examples/functions/delete-variable.md | 1 + docs/examples/functions/delete.md | 1 + .../examples/functions/download-deployment.md | 1 + docs/examples/functions/get-deployment.md | 1 + docs/examples/functions/get-execution.md | 3 +- docs/examples/functions/get-variable.md | 1 + docs/examples/functions/get.md | 1 + docs/examples/functions/list-deployments.md | 1 + docs/examples/functions/list-executions.md | 3 +- docs/examples/functions/list-runtimes.md | 1 + docs/examples/functions/list-variables.md | 1 + docs/examples/functions/list.md | 1 + docs/examples/functions/update-deployment.md | 1 + docs/examples/functions/update-variable.md | 1 + docs/examples/functions/update.md | 1 + docs/examples/graphql/mutation.md | 1 + docs/examples/graphql/query.md | 1 + docs/examples/health/get-antivirus.md | 1 + docs/examples/health/get-cache.md | 1 + docs/examples/health/get-d-b.md | 1 + docs/examples/health/get-pub-sub.md | 1 + docs/examples/health/get-queue-builds.md | 1 + .../examples/health/get-queue-certificates.md | 1 + docs/examples/health/get-queue-databases.md | 1 + docs/examples/health/get-queue-deletes.md | 1 + docs/examples/health/get-queue-functions.md | 1 + docs/examples/health/get-queue-logs.md | 1 + docs/examples/health/get-queue-mails.md | 1 + docs/examples/health/get-queue-messaging.md | 1 + docs/examples/health/get-queue-migrations.md | 1 + docs/examples/health/get-queue-webhooks.md | 1 + docs/examples/health/get-queue.md | 1 + docs/examples/health/get-storage-local.md | 1 + docs/examples/health/get-time.md | 1 + docs/examples/health/get.md | 1 + docs/examples/locale/get.md | 3 +- docs/examples/locale/list-codes.md | 3 +- docs/examples/locale/list-continents.md | 3 +- docs/examples/locale/list-countries-e-u.md | 3 +- docs/examples/locale/list-countries-phones.md | 3 +- docs/examples/locale/list-countries.md | 3 +- docs/examples/locale/list-currencies.md | 3 +- docs/examples/locale/list-languages.md | 3 +- .../messaging/create-a-p-n-s-provider.md | 13 - docs/examples/messaging/create-email.md | 13 - .../messaging/create-f-c-m-provider.md | 13 - .../messaging/create-mailgun-provider.md | 13 - .../messaging/create-msg91provider.md | 13 - docs/examples/messaging/create-push.md | 13 - docs/examples/messaging/create-s-m-s.md | 13 - .../messaging/create-s-m-t-p-provider.md | 13 - .../messaging/create-sendgrid-provider.md | 13 - docs/examples/messaging/create-subscriber.md | 13 - .../messaging/create-telesign-provider.md | 13 - .../messaging/create-textmagic-provider.md | 13 - docs/examples/messaging/create-topic.md | 13 - .../messaging/create-twilio-provider.md | 13 - .../messaging/create-vonage-provider.md | 13 - docs/examples/messaging/delete-provider.md | 13 - docs/examples/messaging/delete-subscriber.md | 13 - docs/examples/messaging/delete-topic.md | 13 - docs/examples/messaging/delete.md | 13 - docs/examples/messaging/get-message.md | 13 - docs/examples/messaging/get-provider.md | 13 - docs/examples/messaging/get-subscriber.md | 13 - docs/examples/messaging/get-topic.md | 13 - docs/examples/messaging/list-message-logs.md | 13 - docs/examples/messaging/list-messages.md | 13 - docs/examples/messaging/list-provider-logs.md | 13 - docs/examples/messaging/list-providers.md | 13 - .../messaging/list-subscriber-logs.md | 13 - docs/examples/messaging/list-subscribers.md | 13 - docs/examples/messaging/list-targets.md | 13 - docs/examples/messaging/list-topic-logs.md | 13 - docs/examples/messaging/list-topics.md | 13 - .../messaging/update-a-p-n-s-provider.md | 13 - docs/examples/messaging/update-email.md | 13 - .../messaging/update-f-c-m-provider.md | 13 - .../messaging/update-mailgun-provider.md | 13 - .../messaging/update-msg91provider.md | 13 - docs/examples/messaging/update-push.md | 13 - docs/examples/messaging/update-s-m-s.md | 13 - .../messaging/update-s-m-t-p-provider.md | 13 - .../messaging/update-sendgrid-provider.md | 13 - .../messaging/update-telesign-provider.md | 13 - .../messaging/update-textmagic-provider.md | 13 - docs/examples/messaging/update-topic.md | 13 - .../messaging/update-twilio-provider.md | 13 - .../messaging/update-vonage-provider.md | 13 - docs/examples/storage/create-bucket.md | 1 + docs/examples/storage/create-file.md | 3 +- docs/examples/storage/delete-bucket.md | 1 + docs/examples/storage/delete-file.md | 3 +- docs/examples/storage/get-bucket.md | 1 + docs/examples/storage/get-file-download.md | 3 +- docs/examples/storage/get-file-preview.md | 3 +- docs/examples/storage/get-file-view.md | 3 +- docs/examples/storage/get-file.md | 3 +- docs/examples/storage/list-buckets.md | 1 + docs/examples/storage/list-files.md | 3 +- docs/examples/storage/update-bucket.md | 1 + docs/examples/storage/update-file.md | 3 +- docs/examples/teams/create-membership.md | 3 +- docs/examples/teams/create.md | 3 +- docs/examples/teams/delete-membership.md | 3 +- docs/examples/teams/delete.md | 3 +- docs/examples/teams/get-membership.md | 3 +- docs/examples/teams/get-prefs.md | 3 +- docs/examples/teams/get.md | 3 +- docs/examples/teams/list-memberships.md | 3 +- docs/examples/teams/list.md | 3 +- .../teams/update-membership-status.md | 3 +- docs/examples/teams/update-membership.md | 3 +- docs/examples/teams/update-name.md | 3 +- docs/examples/teams/update-prefs.md | 3 +- docs/examples/users/create-argon2user.md | 1 + docs/examples/users/create-bcrypt-user.md | 1 + docs/examples/users/create-m-d5user.md | 1 + docs/examples/users/create-p-h-pass-user.md | 1 + docs/examples/users/create-s-h-a-user.md | 1 + .../users/create-scrypt-modified-user.md | 1 + docs/examples/users/create-scrypt-user.md | 1 + docs/examples/users/create-session.md | 13 - docs/examples/users/create-target.md | 14 - docs/examples/users/create-token.md | 13 - docs/examples/users/create.md | 1 + docs/examples/users/delete-authenticator.md | 14 - docs/examples/users/delete-identity.md | 1 + docs/examples/users/delete-session.md | 1 + docs/examples/users/delete-sessions.md | 1 + docs/examples/users/delete-target.md | 13 - docs/examples/users/delete.md | 1 + docs/examples/users/get-prefs.md | 1 + docs/examples/users/get-target.md | 13 - docs/examples/users/get.md | 1 + docs/examples/users/list-identities.md | 1 + docs/examples/users/list-logs.md | 1 + docs/examples/users/list-memberships.md | 1 + docs/examples/users/list-providers.md | 13 - docs/examples/users/list-sessions.md | 1 + docs/examples/users/list-targets.md | 13 - docs/examples/users/list.md | 1 + .../users/update-email-verification.md | 1 + docs/examples/users/update-email.md | 1 + docs/examples/users/update-labels.md | 1 + docs/examples/users/update-mfa.md | 13 - docs/examples/users/update-name.md | 1 + docs/examples/users/update-password.md | 1 + .../users/update-phone-verification.md | 1 + docs/examples/users/update-phone.md | 1 + docs/examples/users/update-prefs.md | 1 + docs/examples/users/update-status.md | 1 + docs/examples/users/update-target.md | 13 - setup.py | 4 +- 275 files changed, 302 insertions(+), 3076 deletions(-) delete mode 100644 appwrite/encoders/__init__.py delete mode 100644 appwrite/encoders/value_class_encoder.py delete mode 100644 appwrite/enums/__init__.py delete mode 100644 appwrite/enums/authenticator_factor.py delete mode 100644 appwrite/enums/authenticator_provider.py delete mode 100644 appwrite/enums/browser.py delete mode 100644 appwrite/enums/compression.py delete mode 100644 appwrite/enums/credit_card.py delete mode 100644 appwrite/enums/execution_method.py delete mode 100644 appwrite/enums/flag.py delete mode 100644 appwrite/enums/image_format.py delete mode 100644 appwrite/enums/image_gravity.py delete mode 100644 appwrite/enums/index_type.py delete mode 100644 appwrite/enums/message_type.py delete mode 100644 appwrite/enums/messaging_provider_type.py delete mode 100644 appwrite/enums/o_auth_provider.py delete mode 100644 appwrite/enums/password_version.py delete mode 100644 appwrite/enums/relation_mutate.py delete mode 100644 appwrite/enums/relationship_type.py delete mode 100644 appwrite/enums/runtime.py delete mode 100644 appwrite/enums/smtp_encryption.py delete mode 100644 appwrite/services/messaging.py delete mode 100644 docs/examples/account/add-authenticator.md delete mode 100644 docs/examples/account/create-anonymous-session.md delete mode 100644 docs/examples/account/create-challenge.md delete mode 100644 docs/examples/account/create-email-password-session.md delete mode 100644 docs/examples/account/create-email-token.md delete mode 100644 docs/examples/account/create-j-w-t.md delete mode 100644 docs/examples/account/create-magic-u-r-l-token.md delete mode 100644 docs/examples/account/create-o-auth2session.md delete mode 100644 docs/examples/account/create-phone-token.md delete mode 100644 docs/examples/account/create-session.md delete mode 100644 docs/examples/account/create.md delete mode 100644 docs/examples/account/delete-authenticator.md delete mode 100644 docs/examples/account/list-factors.md delete mode 100644 docs/examples/account/update-challenge.md delete mode 100644 docs/examples/account/update-m-f-a.md delete mode 100644 docs/examples/account/update-magic-u-r-l-session.md delete mode 100644 docs/examples/account/verify-authenticator.md delete mode 100644 docs/examples/messaging/create-a-p-n-s-provider.md delete mode 100644 docs/examples/messaging/create-email.md delete mode 100644 docs/examples/messaging/create-f-c-m-provider.md delete mode 100644 docs/examples/messaging/create-mailgun-provider.md delete mode 100644 docs/examples/messaging/create-msg91provider.md delete mode 100644 docs/examples/messaging/create-push.md delete mode 100644 docs/examples/messaging/create-s-m-s.md delete mode 100644 docs/examples/messaging/create-s-m-t-p-provider.md delete mode 100644 docs/examples/messaging/create-sendgrid-provider.md delete mode 100644 docs/examples/messaging/create-subscriber.md delete mode 100644 docs/examples/messaging/create-telesign-provider.md delete mode 100644 docs/examples/messaging/create-textmagic-provider.md delete mode 100644 docs/examples/messaging/create-topic.md delete mode 100644 docs/examples/messaging/create-twilio-provider.md delete mode 100644 docs/examples/messaging/create-vonage-provider.md delete mode 100644 docs/examples/messaging/delete-provider.md delete mode 100644 docs/examples/messaging/delete-subscriber.md delete mode 100644 docs/examples/messaging/delete-topic.md delete mode 100644 docs/examples/messaging/delete.md delete mode 100644 docs/examples/messaging/get-message.md delete mode 100644 docs/examples/messaging/get-provider.md delete mode 100644 docs/examples/messaging/get-subscriber.md delete mode 100644 docs/examples/messaging/get-topic.md delete mode 100644 docs/examples/messaging/list-message-logs.md delete mode 100644 docs/examples/messaging/list-messages.md delete mode 100644 docs/examples/messaging/list-provider-logs.md delete mode 100644 docs/examples/messaging/list-providers.md delete mode 100644 docs/examples/messaging/list-subscriber-logs.md delete mode 100644 docs/examples/messaging/list-subscribers.md delete mode 100644 docs/examples/messaging/list-targets.md delete mode 100644 docs/examples/messaging/list-topic-logs.md delete mode 100644 docs/examples/messaging/list-topics.md delete mode 100644 docs/examples/messaging/update-a-p-n-s-provider.md delete mode 100644 docs/examples/messaging/update-email.md delete mode 100644 docs/examples/messaging/update-f-c-m-provider.md delete mode 100644 docs/examples/messaging/update-mailgun-provider.md delete mode 100644 docs/examples/messaging/update-msg91provider.md delete mode 100644 docs/examples/messaging/update-push.md delete mode 100644 docs/examples/messaging/update-s-m-s.md delete mode 100644 docs/examples/messaging/update-s-m-t-p-provider.md delete mode 100644 docs/examples/messaging/update-sendgrid-provider.md delete mode 100644 docs/examples/messaging/update-telesign-provider.md delete mode 100644 docs/examples/messaging/update-textmagic-provider.md delete mode 100644 docs/examples/messaging/update-topic.md delete mode 100644 docs/examples/messaging/update-twilio-provider.md delete mode 100644 docs/examples/messaging/update-vonage-provider.md delete mode 100644 docs/examples/users/create-session.md delete mode 100644 docs/examples/users/create-target.md delete mode 100644 docs/examples/users/create-token.md delete mode 100644 docs/examples/users/delete-authenticator.md delete mode 100644 docs/examples/users/delete-target.md delete mode 100644 docs/examples/users/get-target.md delete mode 100644 docs/examples/users/list-providers.md delete mode 100644 docs/examples/users/list-targets.md delete mode 100644 docs/examples/users/update-mfa.md delete mode 100644 docs/examples/users/update-target.md diff --git a/README.md b/README.md index 9f444c6..1f9ce4d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** +**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite/client.py b/appwrite/client.py index b846965..d5dd8c7 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -1,10 +1,8 @@ import io -import json -import os import requests +import os from .input_file import InputFile from .exception import AppwriteException -from .encoders.value_class_encoder import ValueClassEncoder class Client: def __init__(self): @@ -13,11 +11,11 @@ def __init__(self): self._endpoint = 'https://HOSTNAME/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/4.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.0-rc.1', + 'x-sdk-version': '4.1.0', 'X-Appwrite-Response-Format' : '1.4.0', } @@ -55,24 +53,6 @@ def set_locale(self, value): self._global_headers['x-appwrite-locale'] = value return self - def set_session(self, value): - """The user session to authenticate with""" - - self._global_headers['x-appwrite-session'] = value - return self - - def set_forwarded_for(self, value): - """The IP address of the client that made the request""" - - self._global_headers['x-forwarded-for'] = value - return self - - def set_forwarded_user_agent(self, value): - """The user agent string of the client that made the request""" - - self._global_headers['x-forwarded-user-agent'] = value - return self - def call(self, method, path='', headers=None, params=None): if headers is None: headers = {} @@ -83,6 +63,7 @@ def call(self, method, path='', headers=None, params=None): params = {k: v for k, v in params.items() if v is not None} # Remove None values from params dictionary data = {} + json = {} files = {} stringify = False @@ -93,7 +74,8 @@ def call(self, method, path='', headers=None, params=None): params = {} if headers['content-type'].startswith('application/json'): - data = json.dumps(data, cls=ValueClassEncoder) + json = data + data = {} if headers['content-type'].startswith('multipart/form-data'): del headers['content-type'] @@ -102,14 +84,14 @@ def call(self, method, path='', headers=None, params=None): if isinstance(data[key], InputFile): files[key] = (data[key].filename, data[key].data) del data[key] - data = self.flatten(data, stringify=stringify) response = None try: response = requests.request( # call method dynamically https://stackoverflow.com/a/4246075/2299554 method=method, url=self._endpoint + path, params=self.flatten(params, stringify=stringify), - data=data, + data=self.flatten(data), + json=json, files=files, headers=headers, verify=(not self._self_signed), diff --git a/appwrite/encoders/__init__.py b/appwrite/encoders/__init__.py deleted file mode 100644 index 0519ecb..0000000 --- a/appwrite/encoders/__init__.py +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py deleted file mode 100644 index 9901856..0000000 --- a/appwrite/encoders/value_class_encoder.py +++ /dev/null @@ -1,77 +0,0 @@ -import json -from ..enums.authenticator_provider import AuthenticatorProvider -from ..enums.authenticator_factor import AuthenticatorFactor -from ..enums.o_auth_provider import OAuthProvider -from ..enums.browser import Browser -from ..enums.credit_card import CreditCard -from ..enums.flag import Flag -from ..enums.relationship_type import RelationshipType -from ..enums.relation_mutate import RelationMutate -from ..enums.index_type import IndexType -from ..enums.runtime import Runtime -from ..enums.execution_method import ExecutionMethod -from ..enums.message_type import MessageType -from ..enums.smtp_encryption import SMTPEncryption -from ..enums.compression import Compression -from ..enums.image_gravity import ImageGravity -from ..enums.image_format import ImageFormat -from ..enums.password_version import PasswordVersion -from ..enums.messaging_provider_type import MessagingProviderType - -class ValueClassEncoder(json.JSONEncoder): - def default(self, o): - if isinstance(o, AuthenticatorProvider): - return o.value - - if isinstance(o, AuthenticatorFactor): - return o.value - - if isinstance(o, OAuthProvider): - return o.value - - if isinstance(o, Browser): - return o.value - - if isinstance(o, CreditCard): - return o.value - - if isinstance(o, Flag): - return o.value - - if isinstance(o, RelationshipType): - return o.value - - if isinstance(o, RelationMutate): - return o.value - - if isinstance(o, IndexType): - return o.value - - if isinstance(o, Runtime): - return o.value - - if isinstance(o, ExecutionMethod): - return o.value - - if isinstance(o, MessageType): - return o.value - - if isinstance(o, SMTPEncryption): - return o.value - - if isinstance(o, Compression): - return o.value - - if isinstance(o, ImageGravity): - return o.value - - if isinstance(o, ImageFormat): - return o.value - - if isinstance(o, PasswordVersion): - return o.value - - if isinstance(o, MessagingProviderType): - return o.value - - return super().default(o) \ No newline at end of file diff --git a/appwrite/enums/__init__.py b/appwrite/enums/__init__.py deleted file mode 100644 index 0519ecb..0000000 --- a/appwrite/enums/__init__.py +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/appwrite/enums/authenticator_factor.py b/appwrite/enums/authenticator_factor.py deleted file mode 100644 index 3850b86..0000000 --- a/appwrite/enums/authenticator_factor.py +++ /dev/null @@ -1,4 +0,0 @@ -from enum import Enum - -class AuthenticatorFactor(Enum): - TOTP = "totp" diff --git a/appwrite/enums/authenticator_provider.py b/appwrite/enums/authenticator_provider.py deleted file mode 100644 index 9db892d..0000000 --- a/appwrite/enums/authenticator_provider.py +++ /dev/null @@ -1,4 +0,0 @@ -from enum import Enum - -class AuthenticatorProvider(Enum): - TOTP = "totp" diff --git a/appwrite/enums/browser.py b/appwrite/enums/browser.py deleted file mode 100644 index 02974ec..0000000 --- a/appwrite/enums/browser.py +++ /dev/null @@ -1,17 +0,0 @@ -from enum import Enum - -class Browser(Enum): - AVANT_BROWSER = "aa" - ANDROID_WEBVIEW_BETA = "an" - GOOGLE_CHROME = "ch" - GOOGLE_CHROME_IOS = "ci" - GOOGLE_CHROME_MOBILE = "cm" - CHROMIUM = "cr" - MOZILLA_FIREFOX = "ff" - SAFARI = "sf" - MOBILE_SAFARI = "mf" - MICROSOFT_EDGE = "ps" - MICROSOFT_EDGE_IOS = "oi" - OPERA_MINI = "om" - OPERA = "op" - OPERA_NEXT = "on" diff --git a/appwrite/enums/compression.py b/appwrite/enums/compression.py deleted file mode 100644 index 6d2d21a..0000000 --- a/appwrite/enums/compression.py +++ /dev/null @@ -1,6 +0,0 @@ -from enum import Enum - -class Compression(Enum): - NONE = "none" - GZIP = "gzip" - ZSTD = "zstd" diff --git a/appwrite/enums/credit_card.py b/appwrite/enums/credit_card.py deleted file mode 100644 index 127e077..0000000 --- a/appwrite/enums/credit_card.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - -class CreditCard(Enum): - AMERICAN_EXPRESS = "amex" - ARGENCARD = "argencard" - CABAL = "cabal" - CONSOSUD = "censosud" - DINERS_CLUB = "diners" - DISCOVER = "discover" - ELO = "elo" - HIPERCARD = "hipercard" - JCB = "jcb" - MASTERCARD = "mastercard" - NARANJA = "naranja" - TARJETA_SHOPPING = "targeta-shopping" - UNION_CHINA_PAY = "union-china-pay" - VISA = "visa" - MIR = "mir" - MAESTRO = "maestro" diff --git a/appwrite/enums/execution_method.py b/appwrite/enums/execution_method.py deleted file mode 100644 index 23df3b9..0000000 --- a/appwrite/enums/execution_method.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - -class ExecutionMethod(Enum): - GET = "GET" - POST = "POST" - PUT = "PUT" - PATCH = "PATCH" - DELETE = "DELETE" - OPTIONS = "OPTIONS" diff --git a/appwrite/enums/flag.py b/appwrite/enums/flag.py deleted file mode 100644 index 5988e11..0000000 --- a/appwrite/enums/flag.py +++ /dev/null @@ -1,197 +0,0 @@ -from enum import Enum - -class Flag(Enum): - AFGHANISTAN = "af" - ANGOLA = "ao" - ALBANIA = "al" - ANDORRA = "ad" - UNITED_ARAB_EMIRATES = "ae" - ARGENTINA = "ar" - ARMENIA = "am" - ANTIGUA_AND_BARBUDA = "ag" - AUSTRALIA = "au" - AUSTRIA = "at" - AZERBAIJAN = "az" - BURUNDI = "bi" - BELGIUM = "be" - BENIN = "bj" - BURKINA_FASO = "bf" - BANGLADESH = "bd" - BULGARIA = "bg" - BAHRAIN = "bh" - BAHAMAS = "bs" - BOSNIA_AND_HERZEGOVINA = "ba" - BELARUS = "by" - BELIZE = "bz" - BOLIVIA = "bo" - BRAZIL = "br" - BARBADOS = "bb" - BRUNEI_DARUSSALAM = "bn" - BHUTAN = "bt" - BOTSWANA = "bw" - CENTRAL_AFRICAN_REPUBLIC = "cf" - CANADA = "ca" - SWITZERLAND = "ch" - CHILE = "cl" - CHINA = "cn" - CôTE_D'IVOIRE = "ci" - CAMEROON = "cm" - DEMOCRATIC_REPUBLIC_OF_THE_CONGO = "cd" - REPUBLIC_OF_THE_CONGO = "cg" - COLOMBIA = "co" - COMOROS = "km" - CAPE_VERDE = "cv" - COSTA_RICA = "cr" - CUBA = "cu" - CYPRUS = "cy" - CZECH_REPUBLIC = "cz" - GERMANY = "de" - DJIBOUTI = "dj" - DOMINICA = "dm" - DENMARK = "dk" - DOMINICAN_REPUBLIC = "do" - ALGERIA = "dz" - ECUADOR = "ec" - EGYPT = "eg" - ERITREA = "er" - SPAIN = "es" - ESTONIA = "ee" - ETHIOPIA = "et" - FINLAND = "fi" - FIJI = "fj" - FRANCE = "fr" - MICRONESIA_FEDERATED_STATES_OF = "fm" - GABON = "ga" - UNITED_KINGDOM = "gb" - GEORGIA = "ge" - GHANA = "gh" - GUINEA = "gn" - GAMBIA = "gm" - GUINEABISSAU = "gw" - EQUATORIAL_GUINEA = "gq" - GREECE = "gr" - GRENADA = "gd" - GUATEMALA = "gt" - GUYANA = "gy" - HONDURAS = "hn" - CROATIA = "hr" - HAITI = "ht" - HUNGARY = "hu" - INDONESIA = "id" - INDIA = "in" - IRELAND = "ie" - IRAN_ISLAMIC_REPUBLIC_OF = "ir" - IRAQ = "iq" - ICELAND = "is" - ISRAEL = "il" - ITALY = "it" - JAMAICA = "jm" - JORDAN = "jo" - JAPAN = "jp" - KAZAKHSTAN = "kz" - KENYA = "ke" - KYRGYZSTAN = "kg" - CAMBODIA = "kh" - KIRIBATI = "ki" - SAINT_KITTS_AND_NEVIS = "kn" - SOUTH_KOREA = "kr" - KUWAIT = "kw" - LAO_PEOPLE'S_DEMOCRATIC_REPUBLIC = "la" - LEBANON = "lb" - LIBERIA = "lr" - LIBYA = "ly" - SAINT_LUCIA = "lc" - LIECHTENSTEIN = "li" - SRI_LANKA = "lk" - LESOTHO = "ls" - LITHUANIA = "lt" - LUXEMBOURG = "lu" - LATVIA = "lv" - MOROCCO = "ma" - MONACO = "mc" - MOLDOVA = "md" - MADAGASCAR = "mg" - MALDIVES = "mv" - MEXICO = "mx" - MARSHALL_ISLANDS = "mh" - NORTH_MACEDONIA = "mk" - MALI = "ml" - MALTA = "mt" - MYANMAR = "mm" - MONTENEGRO = "me" - MONGOLIA = "mn" - MOZAMBIQUE = "mz" - MAURITANIA = "mr" - MAURITIUS = "mu" - MALAWI = "mw" - MALAYSIA = "my" - NAMIBIA = "na" - NIGER = "ne" - NIGERIA = "ng" - NICARAGUA = "ni" - NETHERLANDS = "nl" - NORWAY = "no" - NEPAL = "np" - NAURU = "nr" - NEW_ZEALAND = "nz" - OMAN = "om" - PAKISTAN = "pk" - PANAMA = "pa" - PERU = "pe" - PHILIPPINES = "ph" - PALAU = "pw" - PAPUA_NEW_GUINEA = "pg" - POLAND = "pl" - NORTH_KOREA = "kp" - PORTUGAL = "pt" - PARAGUAY = "py" - QATAR = "qa" - ROMANIA = "ro" - RUSSIA = "ru" - RWANDA = "rw" - SAUDI_ARABIA = "sa" - SUDAN = "sd" - SENEGAL = "sn" - SINGAPORE = "sg" - SOLOMON_ISLANDS = "sb" - SIERRA_LEONE = "sl" - EL_SALVADOR = "sv" - SAN_MARINO = "sm" - SOMALIA = "so" - SERBIA = "rs" - SOUTH_SUDAN = "ss" - SAO_TOME_AND_PRINCIPE = "st" - SURINAME = "sr" - SLOVAKIA = "sk" - SLOVENIA = "si" - SWEDEN = "se" - ESWATINI = "sz" - SEYCHELLES = "sc" - SYRIA = "sy" - CHAD = "td" - TOGO = "tg" - THAILAND = "th" - TAJIKISTAN = "tj" - TURKMENISTAN = "tm" - TIMORLESTE = "tl" - TONGA = "to" - TRINIDAD_AND_TOBAGO = "tt" - TUNISIA = "tn" - TURKEY = "tr" - TUVALU = "tv" - TANZANIA = "tz" - UGANDA = "ug" - UKRAINE = "ua" - URUGUAY = "uy" - UNITED_STATES = "us" - UZBEKISTAN = "uz" - VATICAN_CITY = "va" - SAINT_VINCENT_AND_THE_GRENADINES = "vc" - VENEZUELA = "ve" - VIETNAM = "vn" - VANUATU = "vu" - SAMOA = "ws" - YEMEN = "ye" - SOUTH_AFRICA = "za" - ZAMBIA = "zm" - ZIMBABWE = "zw" diff --git a/appwrite/enums/image_format.py b/appwrite/enums/image_format.py deleted file mode 100644 index 7cdd8f3..0000000 --- a/appwrite/enums/image_format.py +++ /dev/null @@ -1,8 +0,0 @@ -from enum import Enum - -class ImageFormat(Enum): - JPG = "jpg" - JPEG = "jpeg" - GIF = "gif" - PNG = "png" - WEBP = "webp" diff --git a/appwrite/enums/image_gravity.py b/appwrite/enums/image_gravity.py deleted file mode 100644 index 1d365a9..0000000 --- a/appwrite/enums/image_gravity.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - -class ImageGravity(Enum): - CENTER = "center" - TOPLEFT = "top-left" - TOP = "top" - TOPRIGHT = "top-right" - LEFT = "left" - RIGHT = "right" - BOTTOMLEFT = "bottom-left" - BOTTOM = "bottom" - BOTTOMRIGHT = "bottom-right" diff --git a/appwrite/enums/index_type.py b/appwrite/enums/index_type.py deleted file mode 100644 index 842240f..0000000 --- a/appwrite/enums/index_type.py +++ /dev/null @@ -1,7 +0,0 @@ -from enum import Enum - -class IndexType(Enum): - KEY = "key" - FULLTEXT = "fulltext" - UNIQUE = "unique" - SPATIAL = "spatial" diff --git a/appwrite/enums/message_type.py b/appwrite/enums/message_type.py deleted file mode 100644 index 0961a12..0000000 --- a/appwrite/enums/message_type.py +++ /dev/null @@ -1,6 +0,0 @@ -from enum import Enum - -class MessageType(Enum): - DRAFT = "draft" - CANCELLED = "cancelled" - PROCESSING = "processing" diff --git a/appwrite/enums/messaging_provider_type.py b/appwrite/enums/messaging_provider_type.py deleted file mode 100644 index e6e7c07..0000000 --- a/appwrite/enums/messaging_provider_type.py +++ /dev/null @@ -1,6 +0,0 @@ -from enum import Enum - -class MessagingProviderType(Enum): - EMAIL = "email" - SMS = "sms" - PUSH = "push" diff --git a/appwrite/enums/o_auth_provider.py b/appwrite/enums/o_auth_provider.py deleted file mode 100644 index 3d46c8e..0000000 --- a/appwrite/enums/o_auth_provider.py +++ /dev/null @@ -1,42 +0,0 @@ -from enum import Enum - -class OAuthProvider(Enum): - AMAZON = "amazon" - APPLE = "apple" - AUTH0 = "auth0" - AUTHENTIK = "authentik" - AUTODESK = "autodesk" - BITBUCKET = "bitbucket" - BITLY = "bitly" - BOX = "box" - DAILYMOTION = "dailymotion" - DISCORD = "discord" - DISQUS = "disqus" - DROPBOX = "dropbox" - ETSY = "etsy" - FACEBOOK = "facebook" - GITHUB = "github" - GITLAB = "gitlab" - GOOGLE = "google" - LINKEDIN = "linkedin" - MICROSOFT = "microsoft" - NOTION = "notion" - OIDC = "oidc" - OKTA = "okta" - PAYPAL = "paypal" - PAYPALSANDBOX = "paypalSandbox" - PODIO = "podio" - SALESFORCE = "salesforce" - SLACK = "slack" - SPOTIFY = "spotify" - STRIPE = "stripe" - TRADESHIFT = "tradeshift" - TRADESHIFTBOX = "tradeshiftBox" - TWITCH = "twitch" - WORDPRESS = "wordpress" - YAHOO = "yahoo" - YAMMER = "yammer" - YANDEX = "yandex" - ZOHO = "zoho" - ZOOM = "zoom" - MOCK = "mock" diff --git a/appwrite/enums/password_version.py b/appwrite/enums/password_version.py deleted file mode 100644 index e3df201..0000000 --- a/appwrite/enums/password_version.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - -class PasswordVersion(Enum): - SHA1 = "sha1" - SHA224 = "sha224" - SHA256 = "sha256" - SHA384 = "sha384" - SHA512/224 = "sha512/224" - SHA512/256 = "sha512/256" - SHA512 = "sha512" - SHA3224 = "sha3-224" - SHA3256 = "sha3-256" - SHA3384 = "sha3-384" - SHA3512 = "sha3-512" diff --git a/appwrite/enums/relation_mutate.py b/appwrite/enums/relation_mutate.py deleted file mode 100644 index ae52aa7..0000000 --- a/appwrite/enums/relation_mutate.py +++ /dev/null @@ -1,6 +0,0 @@ -from enum import Enum - -class RelationMutate(Enum): - CASCADE = "cascade" - RESTRICT = "restrict" - SETNULL = "setNull" diff --git a/appwrite/enums/relationship_type.py b/appwrite/enums/relationship_type.py deleted file mode 100644 index 7866ca6..0000000 --- a/appwrite/enums/relationship_type.py +++ /dev/null @@ -1,7 +0,0 @@ -from enum import Enum - -class RelationshipType(Enum): - ONETOONE = "oneToOne" - MANYTOONE = "manyToOne" - MANYTOMANY = "manyToMany" - ONETOMANY = "oneToMany" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py deleted file mode 100644 index cca0f68..0000000 --- a/appwrite/enums/runtime.py +++ /dev/null @@ -1,7 +0,0 @@ -from enum import Enum - -class Runtime(Enum): - NODE180 = "node-18.0" - PHP80 = "php-8.0" - RUBY31 = "ruby-3.1" - PYTHON39 = "python-3.9" diff --git a/appwrite/enums/smtp_encryption.py b/appwrite/enums/smtp_encryption.py deleted file mode 100644 index 405fc60..0000000 --- a/appwrite/enums/smtp_encryption.py +++ /dev/null @@ -1,6 +0,0 @@ -from enum import Enum - -class SMTPEncryption(Enum): - NONE = "none" - SSL = "ssl" - TLS = "tls" diff --git a/appwrite/query.py b/appwrite/query.py index f25e33d..d970bd8 100644 --- a/appwrite/query.py +++ b/appwrite/query.py @@ -1,108 +1,92 @@ -import json - - -# Inherit from dict to allow for easy serialization -class Query(): - def __init__(self, method, attribute=None, values=None): - self.method = method - - if attribute is not None: - self.attribute = attribute - - if values is not None: - self.values = values if isinstance(values, list) else [values] - - def __str__(self): - return json.dumps( - self.__dict__, - separators=(",", ":"), - default=lambda obj: obj.__dict__ - ) - +class Query: @staticmethod def equal(attribute, value): - return str(Query("equal", attribute, value)) + return Query.add_query(attribute, "equal", value) @staticmethod def not_equal(attribute, value): - return str(Query("notEqual", attribute, value)) - + return Query.add_query(attribute, "notEqual", value) + @staticmethod def less_than(attribute, value): - return str(Query("lessThan", attribute, value)) - + return Query.add_query(attribute, "lessThan", value) + @staticmethod def less_than_equal(attribute, value): - return str(Query("lessThanEqual", attribute, value)) - + return Query.add_query(attribute, "lessThanEqual", value) + @staticmethod def greater_than(attribute, value): - return str(Query("greaterThan", attribute, value)) - + return Query.add_query(attribute, "greaterThan", value) + @staticmethod def greater_than_equal(attribute, value): - return str(Query("greaterThanEqual", attribute, value)) + return Query.add_query(attribute, "greaterThanEqual", value) @staticmethod def is_null(attribute): - return str(Query("isNull", attribute, None)) + return f'isNull("{attribute}")' @staticmethod def is_not_null(attribute): - return str(Query("isNotNull", attribute, None)) + return f'isNotNull("{attribute}")' @staticmethod def between(attribute, start, end): - return str(Query("between", attribute, [start, end])) + return f'between("{attribute}", {Query.parseValues(start)}, {Query.parseValues(end)})' @staticmethod def starts_with(attribute, value): - return str(Query("startsWith", attribute, value)) + return Query.add_query(attribute, "startsWith", value) @staticmethod def ends_with(attribute, value): - return str(Query("endsWith", attribute, value)) + return Query.add_query(attribute, "endsWith", value) @staticmethod def select(attributes): - return str(Query("select", None, attributes)) + return f'select([{",".join(map(Query.parseValues, attributes))}])' @staticmethod def search(attribute, value): - return str(Query("search", attribute, value)) + return Query.add_query(attribute, "search", value) @staticmethod def order_asc(attribute): - return str(Query("orderAsc", attribute, None)) + return f'orderAsc("{attribute}")' @staticmethod def order_desc(attribute): - return str(Query("orderDesc", attribute, None)) + return f'orderDesc("{attribute}")' @staticmethod def cursor_before(id): - return str(Query("cursorBefore", None, id)) + return f'cursorBefore("{id}")' @staticmethod def cursor_after(id): - return str(Query("cursorAfter", None, id)) + return f'cursorAfter("{id}")' @staticmethod def limit(limit): - return str(Query("limit", None, limit)) + return f'limit({limit})' @staticmethod def offset(offset): - return str(Query("offset", None, offset)) - - @staticmethod - def contains(attribute, value): - return str(Query("contains", attribute, value)) + return f'offset({offset})' @staticmethod - def or_queries(queries): - return str(Query("or", None, [json.loads(query) for query in queries])) + def add_query(attribute, method, value): + if type(value) == list: + return f'{method}("{attribute}", [{",".join(map(Query.parseValues, value))}])' + else: + return f'{method}("{attribute}", [{Query.parseValues(value)}])' @staticmethod - def and_queries(queries): - return str(Query("and", None, [json.loads(query) for query in queries])) + def parseValues(value): + if type(value) == str: + return f'"{value}"' + elif type(value) == bool: + return str(value).lower() + else: + return str(value) \ No newline at end of file diff --git a/appwrite/services/account.py b/appwrite/services/account.py index dd528fe..278d890 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -17,31 +17,6 @@ def get(self): 'content-type': 'application/json', }, api_params) - def create(self, user_id, email, password, name = None): - """Create account""" - - - api_path = '/account' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if email is None: - raise AppwriteException('Missing required parameter: "email"') - - if password is None: - raise AppwriteException('Missing required parameter: "password"') - - - api_params['userId'] = user_id - api_params['email'] = email - api_params['password'] = password - api_params['name'] = name - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - def update_email(self, email, password): """Update email""" @@ -76,7 +51,7 @@ def list_identities(self, queries = None): }, api_params) def delete_identity(self, identity_id): - """Delete identity""" + """Delete Identity""" api_path = '/account/identities/{identityId}' @@ -91,17 +66,6 @@ def delete_identity(self, identity_id): 'content-type': 'application/json', }, api_params) - def create_jwt(self): - """Create JWT""" - - - api_path = '/account/jwt' - api_params = {} - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - def list_logs(self, queries = None): """List logs""" @@ -115,125 +79,6 @@ def list_logs(self, queries = None): 'content-type': 'application/json', }, api_params) - def update_mfa(self, mfa): - """Update MFA""" - - - api_path = '/account/mfa' - api_params = {} - if mfa is None: - raise AppwriteException('Missing required parameter: "mfa"') - - - api_params['mfa'] = mfa - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_challenge(self, provider): - """Create MFA Challenge""" - - - api_path = '/account/mfa/challenge' - api_params = {} - if provider is None: - raise AppwriteException('Missing required parameter: "provider"') - - - api_params['provider'] = provider - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_challenge(self, challenge_id, otp): - """Create MFA Challenge (confirmation)""" - - - api_path = '/account/mfa/challenge' - api_params = {} - if challenge_id is None: - raise AppwriteException('Missing required parameter: "challenge_id"') - - if otp is None: - raise AppwriteException('Missing required parameter: "otp"') - - - api_params['challengeId'] = challenge_id - api_params['otp'] = otp - - return self.client.call('put', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_factors(self): - """List Factors""" - - - api_path = '/account/mfa/factors' - api_params = {} - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def add_authenticator(self, factor): - """Add Authenticator""" - - - api_path = '/account/mfa/{factor}' - api_params = {} - if factor is None: - raise AppwriteException('Missing required parameter: "factor"') - - api_path = api_path.replace('{factor}', factor) - - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def verify_authenticator(self, factor, otp): - """Verify Authenticator""" - - - api_path = '/account/mfa/{factor}' - api_params = {} - if factor is None: - raise AppwriteException('Missing required parameter: "factor"') - - if otp is None: - raise AppwriteException('Missing required parameter: "otp"') - - api_path = api_path.replace('{factor}', factor) - - api_params['otp'] = otp - - return self.client.call('put', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete_authenticator(self, provider, otp): - """Delete Authenticator""" - - - api_path = '/account/mfa/{provider}' - api_params = {} - if provider is None: - raise AppwriteException('Missing required parameter: "provider"') - - if otp is None: - raise AppwriteException('Missing required parameter: "otp"') - - api_path = api_path.replace('{provider}', provider) - - api_params['otp'] = otp - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - def update_name(self, name): """Update name""" @@ -334,7 +179,7 @@ def create_recovery(self, email, url): 'content-type': 'application/json', }, api_params) - def update_recovery(self, user_id, secret, password): + def update_recovery(self, user_id, secret, password, password_again): """Create password recovery (confirmation)""" @@ -349,10 +194,14 @@ def update_recovery(self, user_id, secret, password): if password is None: raise AppwriteException('Missing required parameter: "password"') + if password_again is None: + raise AppwriteException('Missing required parameter: "password_again"') + api_params['userId'] = user_id api_params['secret'] = secret api_params['password'] = password + api_params['passwordAgain'] = password_again return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -380,97 +229,6 @@ def delete_sessions(self): 'content-type': 'application/json', }, api_params) - def create_anonymous_session(self): - """Create anonymous session""" - - - api_path = '/account/sessions/anonymous' - api_params = {} - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_email_password_session(self, email, password): - """Create email password session""" - - - api_path = '/account/sessions/email' - api_params = {} - if email is None: - raise AppwriteException('Missing required parameter: "email"') - - if password is None: - raise AppwriteException('Missing required parameter: "password"') - - - api_params['email'] = email - api_params['password'] = password - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_magic_url_session(self, user_id, secret): - """Create session (deprecated)""" - - - api_path = '/account/sessions/magic-url' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if secret is None: - raise AppwriteException('Missing required parameter: "secret"') - - - api_params['userId'] = user_id - api_params['secret'] = secret - - return self.client.call('put', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_o_auth2_session(self, provider, success = None, failure = None, token = None, scopes = None): - """Create OAuth2 session""" - - - api_path = '/account/sessions/oauth2/{provider}' - api_params = {} - if provider is None: - raise AppwriteException('Missing required parameter: "provider"') - - api_path = api_path.replace('{provider}', provider) - - api_params['success'] = success - api_params['failure'] = failure - api_params['token'] = token - api_params['scopes'] = scopes - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_session(self, user_id, secret): - """Create session""" - - - api_path = '/account/sessions/token' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if secret is None: - raise AppwriteException('Missing required parameter: "secret"') - - - api_params['userId'] = user_id - api_params['secret'] = secret - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - def get_session(self, session_id): """Get session""" @@ -488,7 +246,7 @@ def get_session(self, session_id): }, api_params) def update_session(self, session_id): - """Update (or renew) a session""" + """Update OAuth session (refresh tokens)""" api_path = '/account/sessions/{sessionId}' @@ -530,69 +288,6 @@ def update_status(self): 'content-type': 'application/json', }, api_params) - def create_email_token(self, user_id, email, phrase = None): - """Create email token (OTP)""" - - - api_path = '/account/tokens/email' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if email is None: - raise AppwriteException('Missing required parameter: "email"') - - - api_params['userId'] = user_id - api_params['email'] = email - api_params['phrase'] = phrase - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_magic_url_token(self, user_id, email, url = None, phrase = None): - """Create magic URL token""" - - - api_path = '/account/tokens/magic-url' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if email is None: - raise AppwriteException('Missing required parameter: "email"') - - - api_params['userId'] = user_id - api_params['email'] = email - api_params['url'] = url - api_params['phrase'] = phrase - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_phone_token(self, user_id, phone): - """Create phone token""" - - - api_path = '/account/tokens/phone' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if phone is None: - raise AppwriteException('Missing required parameter: "phone"') - - - api_params['userId'] = user_id - api_params['phone'] = phone - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - def create_verification(self, url): """Create email verification""" diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py deleted file mode 100644 index addbf0e..0000000 --- a/appwrite/services/messaging.py +++ /dev/null @@ -1,998 +0,0 @@ -from ..service import Service -from ..exception import AppwriteException - -class Messaging(Service): - - def __init__(self, client): - super(Messaging, self).__init__(client) - - def list_messages(self, queries = None, search = None): - """List messages""" - - - api_path = '/messaging/messages' - api_params = {} - - api_params['queries'] = queries - api_params['search'] = search - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, status = None, html = None, scheduled_at = None): - """Create an email.""" - - - api_path = '/messaging/messages/email' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - if subject is None: - raise AppwriteException('Missing required parameter: "subject"') - - if content is None: - raise AppwriteException('Missing required parameter: "content"') - - - api_params['messageId'] = message_id - api_params['subject'] = subject - api_params['content'] = content - api_params['topics'] = topics - api_params['users'] = users - api_params['targets'] = targets - api_params['cc'] = cc - api_params['bcc'] = bcc - api_params['status'] = status - api_params['html'] = html - api_params['scheduledAt'] = scheduled_at - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, status = None, html = None, cc = None, bcc = None, scheduled_at = None): - """Update an email.""" - - - api_path = '/messaging/messages/email/{messageId}' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - api_path = api_path.replace('{messageId}', message_id) - - api_params['topics'] = topics - api_params['users'] = users - api_params['targets'] = targets - api_params['subject'] = subject - api_params['content'] = content - api_params['status'] = status - api_params['html'] = html - api_params['cc'] = cc - api_params['bcc'] = bcc - api_params['scheduledAt'] = scheduled_at - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): - """Create a push notification.""" - - - api_path = '/messaging/messages/push' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - if title is None: - raise AppwriteException('Missing required parameter: "title"') - - if body is None: - raise AppwriteException('Missing required parameter: "body"') - - - api_params['messageId'] = message_id - api_params['title'] = title - api_params['body'] = body - api_params['topics'] = topics - api_params['users'] = users - api_params['targets'] = targets - api_params['data'] = data - api_params['action'] = action - api_params['icon'] = icon - api_params['sound'] = sound - api_params['color'] = color - api_params['tag'] = tag - api_params['badge'] = badge - api_params['status'] = status - api_params['scheduledAt'] = scheduled_at - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): - """Update a push notification.""" - - - api_path = '/messaging/messages/push/{messageId}' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - api_path = api_path.replace('{messageId}', message_id) - - api_params['topics'] = topics - api_params['users'] = users - api_params['targets'] = targets - api_params['title'] = title - api_params['body'] = body - api_params['data'] = data - api_params['action'] = action - api_params['icon'] = icon - api_params['sound'] = sound - api_params['color'] = color - api_params['tag'] = tag - api_params['badge'] = badge - api_params['status'] = status - api_params['scheduledAt'] = scheduled_at - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_sms(self, message_id, content, topics = None, users = None, targets = None, status = None, scheduled_at = None): - """Create an SMS.""" - - - api_path = '/messaging/messages/sms' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - if content is None: - raise AppwriteException('Missing required parameter: "content"') - - - api_params['messageId'] = message_id - api_params['content'] = content - api_params['topics'] = topics - api_params['users'] = users - api_params['targets'] = targets - api_params['status'] = status - api_params['scheduledAt'] = scheduled_at - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, status = None, scheduled_at = None): - """Update an SMS.""" - - - api_path = '/messaging/messages/sms/{messageId}' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - api_path = api_path.replace('{messageId}', message_id) - - api_params['topics'] = topics - api_params['users'] = users - api_params['targets'] = targets - api_params['content'] = content - api_params['status'] = status - api_params['scheduledAt'] = scheduled_at - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_message(self, message_id): - """Get a message""" - - - api_path = '/messaging/messages/{messageId}' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - api_path = api_path.replace('{messageId}', message_id) - - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete(self, message_id): - """Delete a message""" - - - api_path = '/messaging/messages/{messageId}' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - api_path = api_path.replace('{messageId}', message_id) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_message_logs(self, message_id, queries = None): - """List message logs""" - - - api_path = '/messaging/messages/{messageId}/logs' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - api_path = api_path.replace('{messageId}', message_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_targets(self, message_id, queries = None): - """List message targets""" - - - api_path = '/messaging/messages/{messageId}/targets' - api_params = {} - if message_id is None: - raise AppwriteException('Missing required parameter: "message_id"') - - api_path = api_path.replace('{messageId}', message_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_providers(self, queries = None, search = None): - """List providers""" - - - api_path = '/messaging/providers' - api_params = {} - - api_params['queries'] = queries - api_params['search'] = search - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, enabled = None): - """Create APNS provider""" - - - api_path = '/messaging/providers/apns' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['authKey'] = auth_key - api_params['authKeyId'] = auth_key_id - api_params['teamId'] = team_id - api_params['bundleId'] = bundle_id - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_apns_provider(self, provider_id, name = None, enabled = None, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None): - """Update APNS provider""" - - - api_path = '/messaging/providers/apns/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['enabled'] = enabled - api_params['authKey'] = auth_key - api_params['authKeyId'] = auth_key_id - api_params['teamId'] = team_id - api_params['bundleId'] = bundle_id - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_fcm_provider(self, provider_id, name, service_account_json = None, enabled = None): - """Create FCM provider""" - - - api_path = '/messaging/providers/fcm' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['serviceAccountJSON'] = service_account_json - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_fcm_provider(self, provider_id, name = None, enabled = None, service_account_json = None): - """Update FCM provider""" - - - api_path = '/messaging/providers/fcm/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['enabled'] = enabled - api_params['serviceAccountJSON'] = service_account_json - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_mailgun_provider(self, provider_id, name, api_key = None, domain = None, is_eu_region = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create Mailgun provider""" - - - api_path = '/messaging/providers/mailgun' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['apiKey'] = api_key - api_params['domain'] = domain - api_params['isEuRegion'] = is_eu_region - api_params['fromName'] = from_name - api_params['fromEmail'] = from_email - api_params['replyToName'] = reply_to_name - api_params['replyToEmail'] = reply_to_email - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_mailgun_provider(self, provider_id, name = None, api_key = None, domain = None, is_eu_region = None, enabled = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): - """Update Mailgun provider""" - - - api_path = '/messaging/providers/mailgun/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['apiKey'] = api_key - api_params['domain'] = domain - api_params['isEuRegion'] = is_eu_region - api_params['enabled'] = enabled - api_params['fromName'] = from_name - api_params['fromEmail'] = from_email - api_params['replyToName'] = reply_to_name - api_params['replyToEmail'] = reply_to_email - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_msg91_provider(self, provider_id, name, xfrom = None, sender_id = None, auth_key = None, enabled = None): - """Create Msg91 provider""" - - - api_path = '/messaging/providers/msg91' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['from'] = xfrom - api_params['senderId'] = sender_id - api_params['authKey'] = auth_key - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_msg91_provider(self, provider_id, name = None, enabled = None, sender_id = None, auth_key = None, xfrom = None): - """Update Msg91 provider""" - - - api_path = '/messaging/providers/msg91/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['enabled'] = enabled - api_params['senderId'] = sender_id - api_params['authKey'] = auth_key - api_params['from'] = xfrom - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create Sendgrid provider""" - - - api_path = '/messaging/providers/sendgrid' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['apiKey'] = api_key - api_params['fromName'] = from_name - api_params['fromEmail'] = from_email - api_params['replyToName'] = reply_to_name - api_params['replyToEmail'] = reply_to_email - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): - """Update Sendgrid provider""" - - - api_path = '/messaging/providers/sendgrid/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['enabled'] = enabled - api_params['apiKey'] = api_key - api_params['fromName'] = from_name - api_params['fromEmail'] = from_email - api_params['replyToName'] = reply_to_name - api_params['replyToEmail'] = reply_to_email - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_smtp_provider(self, provider_id, name, host, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create SMTP provider""" - - - api_path = '/messaging/providers/smtp' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - if host is None: - raise AppwriteException('Missing required parameter: "host"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['host'] = host - api_params['port'] = port - api_params['username'] = username - api_params['password'] = password - api_params['encryption'] = encryption - api_params['autoTLS'] = auto_tls - api_params['mailer'] = mailer - api_params['fromName'] = from_name - api_params['fromEmail'] = from_email - api_params['replyToName'] = reply_to_name - api_params['replyToEmail'] = reply_to_email - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_smtp_provider(self, provider_id, name = None, host = None, port = None, username = None, password = None, encryption = None, auto_tls = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Update SMTP provider""" - - - api_path = '/messaging/providers/smtp/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['host'] = host - api_params['port'] = port - api_params['username'] = username - api_params['password'] = password - api_params['encryption'] = encryption - api_params['autoTLS'] = auto_tls - api_params['fromName'] = from_name - api_params['fromEmail'] = from_email - api_params['replyToName'] = reply_to_name - api_params['replyToEmail'] = reply_to_email - api_params['enabled'] = enabled - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_telesign_provider(self, provider_id, name, xfrom = None, username = None, password = None, enabled = None): - """Create Telesign provider""" - - - api_path = '/messaging/providers/telesign' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['from'] = xfrom - api_params['username'] = username - api_params['password'] = password - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_telesign_provider(self, provider_id, name = None, enabled = None, username = None, password = None, xfrom = None): - """Update Telesign provider""" - - - api_path = '/messaging/providers/telesign/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['enabled'] = enabled - api_params['username'] = username - api_params['password'] = password - api_params['from'] = xfrom - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_textmagic_provider(self, provider_id, name, xfrom = None, username = None, api_key = None, enabled = None): - """Create Textmagic provider""" - - - api_path = '/messaging/providers/textmagic' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['from'] = xfrom - api_params['username'] = username - api_params['apiKey'] = api_key - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_textmagic_provider(self, provider_id, name = None, enabled = None, username = None, api_key = None, xfrom = None): - """Update Textmagic provider""" - - - api_path = '/messaging/providers/textmagic/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['enabled'] = enabled - api_params['username'] = username - api_params['apiKey'] = api_key - api_params['from'] = xfrom - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = None, auth_token = None, enabled = None): - """Create Twilio provider""" - - - api_path = '/messaging/providers/twilio' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['from'] = xfrom - api_params['accountSid'] = account_sid - api_params['authToken'] = auth_token - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_twilio_provider(self, provider_id, name = None, enabled = None, account_sid = None, auth_token = None, xfrom = None): - """Update Twilio provider""" - - - api_path = '/messaging/providers/twilio/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['enabled'] = enabled - api_params['accountSid'] = account_sid - api_params['authToken'] = auth_token - api_params['from'] = xfrom - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None, api_secret = None, enabled = None): - """Create Vonage provider""" - - - api_path = '/messaging/providers/vonage' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['providerId'] = provider_id - api_params['name'] = name - api_params['from'] = xfrom - api_params['apiKey'] = api_key - api_params['apiSecret'] = api_secret - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_vonage_provider(self, provider_id, name = None, enabled = None, api_key = None, api_secret = None, xfrom = None): - """Update Vonage provider""" - - - api_path = '/messaging/providers/vonage/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['name'] = name - api_params['enabled'] = enabled - api_params['apiKey'] = api_key - api_params['apiSecret'] = api_secret - api_params['from'] = xfrom - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_provider(self, provider_id): - """Get provider""" - - - api_path = '/messaging/providers/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete_provider(self, provider_id): - """Delete provider""" - - - api_path = '/messaging/providers/{providerId}' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_provider_logs(self, provider_id, queries = None): - """List provider logs""" - - - api_path = '/messaging/providers/{providerId}/logs' - api_params = {} - if provider_id is None: - raise AppwriteException('Missing required parameter: "provider_id"') - - api_path = api_path.replace('{providerId}', provider_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_subscriber_logs(self, subscriber_id, queries = None): - """List subscriber logs""" - - - api_path = '/messaging/subscribers/{subscriberId}/logs' - api_params = {} - if subscriber_id is None: - raise AppwriteException('Missing required parameter: "subscriber_id"') - - api_path = api_path.replace('{subscriberId}', subscriber_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_topics(self, queries = None, search = None): - """List topics.""" - - - api_path = '/messaging/topics' - api_params = {} - - api_params['queries'] = queries - api_params['search'] = search - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_topic(self, topic_id, name): - """Create a topic.""" - - - api_path = '/messaging/topics' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - - api_params['topicId'] = topic_id - api_params['name'] = name - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_topic(self, topic_id): - """Get a topic.""" - - - api_path = '/messaging/topics/{topicId}' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - api_path = api_path.replace('{topicId}', topic_id) - - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_topic(self, topic_id, name = None): - """Update a topic.""" - - - api_path = '/messaging/topics/{topicId}' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - api_path = api_path.replace('{topicId}', topic_id) - - api_params['name'] = name - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete_topic(self, topic_id): - """Delete a topic.""" - - - api_path = '/messaging/topics/{topicId}' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - api_path = api_path.replace('{topicId}', topic_id) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_topic_logs(self, topic_id, queries = None): - """List topic logs""" - - - api_path = '/messaging/topics/{topicId}/logs' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - api_path = api_path.replace('{topicId}', topic_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_subscribers(self, topic_id, queries = None, search = None): - """List subscribers.""" - - - api_path = '/messaging/topics/{topicId}/subscribers' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - api_path = api_path.replace('{topicId}', topic_id) - - api_params['queries'] = queries - api_params['search'] = search - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_subscriber(self, topic_id, subscriber_id, target_id): - """Create a subscriber.""" - - - api_path = '/messaging/topics/{topicId}/subscribers' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - if subscriber_id is None: - raise AppwriteException('Missing required parameter: "subscriber_id"') - - if target_id is None: - raise AppwriteException('Missing required parameter: "target_id"') - - api_path = api_path.replace('{topicId}', topic_id) - - api_params['subscriberId'] = subscriber_id - api_params['targetId'] = target_id - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_subscriber(self, topic_id, subscriber_id): - """Get a subscriber.""" - - - api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - if subscriber_id is None: - raise AppwriteException('Missing required parameter: "subscriber_id"') - - api_path = api_path.replace('{topicId}', topic_id) - api_path = api_path.replace('{subscriberId}', subscriber_id) - - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete_subscriber(self, topic_id, subscriber_id): - """Delete a subscriber.""" - - - api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' - api_params = {} - if topic_id is None: - raise AppwriteException('Missing required parameter: "topic_id"') - - if subscriber_id is None: - raise AppwriteException('Missing required parameter: "subscriber_id"') - - api_path = api_path.replace('{topicId}', topic_id) - api_path = api_path.replace('{subscriberId}', subscriber_id) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 4b2a235..2bcec8d 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -105,7 +105,7 @@ def list_identities(self, queries = None, search = None): }, api_params) def delete_identity(self, identity_id): - """Delete identity""" + """Delete Identity""" api_path = '/users/identities/{identityId}' @@ -383,50 +383,6 @@ def list_memberships(self, user_id): 'content-type': 'application/json', }, api_params) - def update_mfa(self, user_id, mfa): - """Update MFA""" - - - api_path = '/users/{userId}/mfa' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if mfa is None: - raise AppwriteException('Missing required parameter: "mfa"') - - api_path = api_path.replace('{userId}', user_id) - - api_params['mfa'] = mfa - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete_authenticator(self, user_id, provider, otp): - """Delete Authenticator""" - - - api_path = '/users/{userId}/mfa/{provider}' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if provider is None: - raise AppwriteException('Missing required parameter: "provider"') - - if otp is None: - raise AppwriteException('Missing required parameter: "otp"') - - api_path = api_path.replace('{userId}', user_id) - api_path = api_path.replace('{provider}', provider) - - api_params['otp'] = otp - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - def update_name(self, user_id, name): """Update name""" @@ -523,22 +479,6 @@ def update_prefs(self, user_id, prefs): 'content-type': 'application/json', }, api_params) - def list_providers(self, user_id): - """List Providers""" - - - api_path = '/users/{userId}/providers' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - api_path = api_path.replace('{userId}', user_id) - - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - def list_sessions(self, user_id): """List user sessions""" @@ -555,22 +495,6 @@ def list_sessions(self, user_id): 'content-type': 'application/json', }, api_params) - def create_session(self, user_id): - """Create session""" - - - api_path = '/users/{userId}/sessions' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - api_path = api_path.replace('{userId}', user_id) - - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - def delete_sessions(self, user_id): """Delete user sessions""" @@ -627,134 +551,6 @@ def update_status(self, user_id, status): 'content-type': 'application/json', }, api_params) - def list_targets(self, user_id, queries = None): - """List User Targets""" - - - api_path = '/users/{userId}/targets' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - api_path = api_path.replace('{userId}', user_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_target(self, user_id, target_id, provider_type, identifier, provider_id = None, name = None): - """Create User Target""" - - - api_path = '/users/{userId}/targets' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if target_id is None: - raise AppwriteException('Missing required parameter: "target_id"') - - if provider_type is None: - raise AppwriteException('Missing required parameter: "provider_type"') - - if identifier is None: - raise AppwriteException('Missing required parameter: "identifier"') - - api_path = api_path.replace('{userId}', user_id) - - api_params['targetId'] = target_id - api_params['providerType'] = provider_type - api_params['identifier'] = identifier - api_params['providerId'] = provider_id - api_params['name'] = name - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_target(self, user_id, target_id): - """Get User Target""" - - - api_path = '/users/{userId}/targets/{targetId}' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if target_id is None: - raise AppwriteException('Missing required parameter: "target_id"') - - api_path = api_path.replace('{userId}', user_id) - api_path = api_path.replace('{targetId}', target_id) - - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_target(self, user_id, target_id, identifier = None, provider_id = None, name = None): - """Update User target""" - - - api_path = '/users/{userId}/targets/{targetId}' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if target_id is None: - raise AppwriteException('Missing required parameter: "target_id"') - - api_path = api_path.replace('{userId}', user_id) - api_path = api_path.replace('{targetId}', target_id) - - api_params['identifier'] = identifier - api_params['providerId'] = provider_id - api_params['name'] = name - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete_target(self, user_id, target_id): - """Delete user target""" - - - api_path = '/users/{userId}/targets/{targetId}' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - if target_id is None: - raise AppwriteException('Missing required parameter: "target_id"') - - api_path = api_path.replace('{userId}', user_id) - api_path = api_path.replace('{targetId}', target_id) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_token(self, user_id, length = None, expire = None): - """Create token""" - - - api_path = '/users/{userId}/tokens' - api_params = {} - if user_id is None: - raise AppwriteException('Missing required parameter: "user_id"') - - api_path = api_path.replace('{userId}', user_id) - - api_params['length'] = length - api_params['expire'] = expire - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - def update_email_verification(self, user_id, email_verification): """Update email verification""" diff --git a/docs/examples/account/add-authenticator.md b/docs/examples/account/add-authenticator.md deleted file mode 100644 index d938332..0000000 --- a/docs/examples/account/add-authenticator.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from Appwrite.enums import AuthenticatorFactor - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) - -account = Account(client) - -result = account.add_authenticator(AuthenticatorFactor.TOTP) diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md deleted file mode 100644 index 71282f6..0000000 --- a/docs/examples/account/create-anonymous-session.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_anonymous_session() diff --git a/docs/examples/account/create-challenge.md b/docs/examples/account/create-challenge.md deleted file mode 100644 index 5a73bad..0000000 --- a/docs/examples/account/create-challenge.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from Appwrite.enums import AuthenticatorProvider - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_challenge(AuthenticatorProvider.TOTP) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md deleted file mode 100644 index 718159b..0000000 --- a/docs/examples/account/create-email-password-session.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_email_password_session('email@example.com', 'password') diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md deleted file mode 100644 index 00db0b3..0000000 --- a/docs/examples/account/create-email-token.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_email_token('[USER_ID]', 'email@example.com') diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md deleted file mode 100644 index 0889609..0000000 --- a/docs/examples/account/create-j-w-t.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_jwt() diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md deleted file mode 100644 index 390e9cb..0000000 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_magic_url_token('[USER_ID]', 'email@example.com') diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md deleted file mode 100644 index fcdb570..0000000 --- a/docs/examples/account/create-o-auth2session.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from Appwrite.enums import OAuthProvider - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_o_auth2_session(OAuthProvider.AMAZON) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md deleted file mode 100644 index c661de3..0000000 --- a/docs/examples/account/create-phone-token.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_phone_token('[USER_ID]', '+12065550100') diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index c4f3f6b..2203cdb 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e3937d5..21130fe 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md deleted file mode 100644 index 04d4ece..0000000 --- a/docs/examples/account/create-session.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create_session('[USER_ID]', '[SECRET]') diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index a9d7c27..c45d0d4 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md deleted file mode 100644 index 7c4428d..0000000 --- a/docs/examples/account/create.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.create('[USER_ID]', 'email@example.com', '') diff --git a/docs/examples/account/delete-authenticator.md b/docs/examples/account/delete-authenticator.md deleted file mode 100644 index 3d81d79..0000000 --- a/docs/examples/account/delete-authenticator.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from Appwrite.enums import AuthenticatorProvider - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) - -account = Account(client) - -result = account.delete_authenticator(AuthenticatorProvider.TOTP, '[OTP]') diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 02a80c3..bac4334 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index ac945fe..8095cdc 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 9057b73..1728d61 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 0b79b60..da2fd76 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index dc1d0de..25b8f03 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 752a823..f75bad7 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/list-factors.md b/docs/examples/account/list-factors.md deleted file mode 100644 index a5ec4a2..0000000 --- a/docs/examples/account/list-factors.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) - -account = Account(client) - -result = account.list_factors() diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index f14e5b4..3c166d1 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index da2d511..65802d8 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 2bdd710..12d5c81 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-challenge.md b/docs/examples/account/update-challenge.md deleted file mode 100644 index f262ea3..0000000 --- a/docs/examples/account/update-challenge.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) - -account = Account(client) - -result = account.update_challenge('[CHALLENGE_ID]', '[OTP]') diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 8e2bc67..f4a6776 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md deleted file mode 100644 index ccb6d77..0000000 --- a/docs/examples/account/update-m-f-a.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) - -account = Account(client) - -result = account.update_mfa(False) diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md deleted file mode 100644 index c75e94c..0000000 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ /dev/null @@ -1,12 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) - -account = Account(client) - -result = account.update_magic_url_session('[USER_ID]', '[SECRET]') diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 2aaa411..eb1eb62 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 365c733..955ada6 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 9d4fdbb..f2a75b4 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 7c1b218..aaee1f7 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index c554961..e96546b 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 4f14fa1..b4ea8aa 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,13 +1,14 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) -result = account.update_recovery('[USER_ID]', '[SECRET]', '') +result = account.update_recovery('[USER_ID]', '[SECRET]', 'password', 'password') diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index aca93ba..e7234f7 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index e7be5fb..5924d4d 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 3ae98a1..9a410a5 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/account/verify-authenticator.md b/docs/examples/account/verify-authenticator.md deleted file mode 100644 index 894a7ff..0000000 --- a/docs/examples/account/verify-authenticator.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from Appwrite.enums import AuthenticatorFactor - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) - -account = Account(client) - -result = account.verify_authenticator(AuthenticatorFactor.TOTP, '[OTP]') diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 0d2220f..9ed56d1 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from Appwrite.enums import Browser +from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) avatars = Avatars(client) -result = avatars.get_browser(Browser.AVANT_BROWSER) +result = avatars.get_browser('aa') diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index b2a9afd..9fa6b0f 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from Appwrite.enums import CreditCard +from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) avatars = Avatars(client) -result = avatars.get_credit_card(CreditCard.AMERICAN_EXPRESS) +result = avatars.get_credit_card('amex') diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index f3c5aed..75b0315 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 6c2fbee..70d2e5f 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from Appwrite.enums import Flag +from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) avatars = Avatars(client) -result = avatars.get_flag(Flag.AFGHANISTAN) +result = avatars.get_flag('af') diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 9c33063..35015d9 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 098d791..639fa03 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index b6191bd..27fc8e2 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) avatars = Avatars(client) diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index e7b223f..f073d3d 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 2d7c679..183c55c 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index c3039d1..5c77689 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index f7b05e0..aa95de9 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) databases = Databases(client) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 8b25aaa..92cdcb2 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index b35f591..df66f12 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index f4c1dd7..0bfe424 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index ba10266..78a7d33 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from Appwrite.enums import IndexType +from appwrite.services.databases import Databases client = Client() @@ -11,4 +11,4 @@ client = Client() databases = Databases(client) -result = databases.create_index('[DATABASE_ID]', '[COLLECTION_ID]', '', IndexType.KEY, []) +result = databases.create_index('[DATABASE_ID]', '[COLLECTION_ID]', '', 'key', []) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index d0619bd..b3cce2b 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index d211390..967d284 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 9bfb6c3..4f69eca 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from Appwrite.enums import RelationshipType +from appwrite.services.databases import Databases client = Client() @@ -11,4 +11,4 @@ client = Client() databases = Databases(client) -result = databases.create_relationship_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', RelationshipType.ONE_TO_ONE) +result = databases.create_relationship_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', 'oneToOne') diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 820f06a..00bbbe9 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index b6b5fb0..fd5b7f4 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index f2188b1..e4a8320 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 95f8166..41871b2 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index dea504c..998bb61 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 9c441a5..605b087 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) databases = Databases(client) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 6aff595..a53e06c 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index bb9c307..780e145 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 0c5a832..0a61052 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 8bba64c..90f57a3 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index d89a040..7085384 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) databases = Databases(client) diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index bc8852f..3213c66 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 654f5d6..93a46b3 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 500a273..632202c 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 34c3c61..d0c98da 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 014f54c..5eb03b2 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) databases = Databases(client) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index c4685f5..b4224be 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 41eb45a..3aa6839 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 0c4c727..e6a7d55 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 67c1a8b..4a38aab 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 28bb030..5c79257 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 5496516..c768c54 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) databases = Databases(client) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 567f10e..8148b01 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 626ccc8..65ef26f 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index ba5e25c..efbf1ad 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index dcf92be..61c74b8 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index e58e944..7d5a35d 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index c717550..7c426a6 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 22861aa..2ee236e 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 2924e5d..119c787 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index a3a3f13..d46692e 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index 8b3a95b..76888f8 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index a62d341..1ee1be0 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,5 +1,6 @@ from appwrite.client import Client from appwrite.input_file import InputFile +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 709ca07..7c04522 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 8198694..f33ed08 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index c05c56a..bf66396 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from Appwrite.enums import +from appwrite.services.functions import Functions client = Client() @@ -11,4 +11,4 @@ client = Client() functions = Functions(client) -result = functions.create('[FUNCTION_ID]', '[NAME]', .NODE-18.0) +result = functions.create('[FUNCTION_ID]', '[NAME]', 'node-18.0') diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index f5ec491..42d526e 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 1ee6b16..cae0f2d 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index ac5aa7f..e89213e 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/download-deployment.md index f86f56e..ee51f67 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/download-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index e324251..6257b59 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index f7c1f04..f0e4f0d 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 1bbce36..4e71bff 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 9ceed7b..30e1d59 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 51b89a6..d1797a1 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 112d884..d70f004 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 941f22e..19b85e2 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 1ae2f51..9a72bba 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 107dacf..b8442e5 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 08abe08..87dd097 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 452dcc4..ab5b43a 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 4dbbee5..3960054 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 80cb9c7..24226a5 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.graphql import Graphql client = Client() diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index cebf63c..8e1597c 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.graphql import Graphql client = Client() diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 0894ff7..fbfaf0e 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index e0d4f6b..40bc010 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 7fe0bf2..803dd73 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 4c63e6a..43ada69 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 09f2d81..3170559 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 6771209..4fb0266 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 576dd5e..4faff96 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 863fa58..c84b9be 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index c84460b..92e4e20 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 99ecad2..b798ad7 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 225d286..cc2c3bc 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index df77f45..95200f3 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index de2f90d..1c91663 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 79e47bf..8406de1 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 81dbde6..5a35588 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 1d3c016..bb2533e 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 89cec53..9fe313d 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index b4bc8e6..d3ff594 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 2e4f028..06b04f2 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) locale = Locale(client) diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 646d82e..3dc6cf8 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) locale = Locale(client) diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 75b78d8..ba9c94f 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index af224a8..ea4c43c 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 0b451c2..5a4cafe 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index c0c9008..f8ec83c 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) locale = Locale(client) diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 8501744..347e81c 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) locale = Locale(client) diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index c70d837..ce50a6e 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) locale = Locale(client) diff --git a/docs/examples/messaging/create-a-p-n-s-provider.md b/docs/examples/messaging/create-a-p-n-s-provider.md deleted file mode 100644 index ad05664..0000000 --- a/docs/examples/messaging/create-a-p-n-s-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_apns_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md deleted file mode 100644 index 72fc437..0000000 --- a/docs/examples/messaging/create-email.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_email('[MESSAGE_ID]', '[SUBJECT]', '[CONTENT]') diff --git a/docs/examples/messaging/create-f-c-m-provider.md b/docs/examples/messaging/create-f-c-m-provider.md deleted file mode 100644 index b6b2a7b..0000000 --- a/docs/examples/messaging/create-f-c-m-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_fcm_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md deleted file mode 100644 index 84fc1d5..0000000 --- a/docs/examples/messaging/create-mailgun-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_mailgun_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md deleted file mode 100644 index 5db7e0e..0000000 --- a/docs/examples/messaging/create-msg91provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_msg91_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md deleted file mode 100644 index 550f58b..0000000 --- a/docs/examples/messaging/create-push.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_push('[MESSAGE_ID]', '[TITLE]', '[BODY]') diff --git a/docs/examples/messaging/create-s-m-s.md b/docs/examples/messaging/create-s-m-s.md deleted file mode 100644 index d2eb41a..0000000 --- a/docs/examples/messaging/create-s-m-s.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_sms('[MESSAGE_ID]', '[CONTENT]') diff --git a/docs/examples/messaging/create-s-m-t-p-provider.md b/docs/examples/messaging/create-s-m-t-p-provider.md deleted file mode 100644 index f7af468..0000000 --- a/docs/examples/messaging/create-s-m-t-p-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_smtp_provider('[PROVIDER_ID]', '[NAME]', '[HOST]') diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md deleted file mode 100644 index 003a397..0000000 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_sendgrid_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md deleted file mode 100644 index 82e9976..0000000 --- a/docs/examples/messaging/create-subscriber.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -) - -messaging = Messaging(client) - -result = messaging.create_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]', '[TARGET_ID]') diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md deleted file mode 100644 index 4139ccf..0000000 --- a/docs/examples/messaging/create-telesign-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_telesign_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md deleted file mode 100644 index 5b0fcfc..0000000 --- a/docs/examples/messaging/create-textmagic-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_textmagic_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md deleted file mode 100644 index 9dd5ce8..0000000 --- a/docs/examples/messaging/create-topic.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_topic('[TOPIC_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md deleted file mode 100644 index e984b06..0000000 --- a/docs/examples/messaging/create-twilio-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_twilio_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md deleted file mode 100644 index 31115b7..0000000 --- a/docs/examples/messaging/create-vonage-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_vonage_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md deleted file mode 100644 index 894cb6f..0000000 --- a/docs/examples/messaging/delete-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.delete_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md deleted file mode 100644 index 04012a5..0000000 --- a/docs/examples/messaging/delete-subscriber.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -) - -messaging = Messaging(client) - -result = messaging.delete_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md deleted file mode 100644 index 4e6b380..0000000 --- a/docs/examples/messaging/delete-topic.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.delete_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md deleted file mode 100644 index 2839355..0000000 --- a/docs/examples/messaging/delete.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.delete('[MESSAGE_ID]') diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md deleted file mode 100644 index 19587e9..0000000 --- a/docs/examples/messaging/get-message.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.get_message('[MESSAGE_ID]') diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md deleted file mode 100644 index 9e02e14..0000000 --- a/docs/examples/messaging/get-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.get_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md deleted file mode 100644 index a170f60..0000000 --- a/docs/examples/messaging/get-subscriber.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.get_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md deleted file mode 100644 index ade0291..0000000 --- a/docs/examples/messaging/get-topic.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.get_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md deleted file mode 100644 index b77c8d9..0000000 --- a/docs/examples/messaging/list-message-logs.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_message_logs('[MESSAGE_ID]') diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md deleted file mode 100644 index eb8bdf6..0000000 --- a/docs/examples/messaging/list-messages.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_messages() diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md deleted file mode 100644 index c9ee22c..0000000 --- a/docs/examples/messaging/list-provider-logs.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_provider_logs('[PROVIDER_ID]') diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md deleted file mode 100644 index 5bb1223..0000000 --- a/docs/examples/messaging/list-providers.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_providers() diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md deleted file mode 100644 index 56a5544..0000000 --- a/docs/examples/messaging/list-subscriber-logs.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_subscriber_logs('[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md deleted file mode 100644 index 85f5972..0000000 --- a/docs/examples/messaging/list-subscribers.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_subscribers('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md deleted file mode 100644 index 1463533..0000000 --- a/docs/examples/messaging/list-targets.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_targets('[MESSAGE_ID]') diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md deleted file mode 100644 index 0eaac28..0000000 --- a/docs/examples/messaging/list-topic-logs.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_topic_logs('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md deleted file mode 100644 index 4f6265f..0000000 --- a/docs/examples/messaging/list-topics.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.list_topics() diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-a-p-n-s-provider.md deleted file mode 100644 index 74a3ade..0000000 --- a/docs/examples/messaging/update-a-p-n-s-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_apns_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md deleted file mode 100644 index a737e24..0000000 --- a/docs/examples/messaging/update-email.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_email('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-f-c-m-provider.md deleted file mode 100644 index 106d8af..0000000 --- a/docs/examples/messaging/update-f-c-m-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_fcm_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md deleted file mode 100644 index 995df6c..0000000 --- a/docs/examples/messaging/update-mailgun-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_mailgun_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md deleted file mode 100644 index 4504915..0000000 --- a/docs/examples/messaging/update-msg91provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_msg91_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md deleted file mode 100644 index 5b9a5d5..0000000 --- a/docs/examples/messaging/update-push.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_push('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-s-m-s.md b/docs/examples/messaging/update-s-m-s.md deleted file mode 100644 index bb8039a..0000000 --- a/docs/examples/messaging/update-s-m-s.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_sms('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-s-m-t-p-provider.md b/docs/examples/messaging/update-s-m-t-p-provider.md deleted file mode 100644 index 7faad9e..0000000 --- a/docs/examples/messaging/update-s-m-t-p-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_smtp_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md deleted file mode 100644 index d5fafdc..0000000 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_sendgrid_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md deleted file mode 100644 index 59a1411..0000000 --- a/docs/examples/messaging/update-telesign-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_telesign_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md deleted file mode 100644 index 70a0337..0000000 --- a/docs/examples/messaging/update-textmagic-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_textmagic_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md deleted file mode 100644 index 61adea6..0000000 --- a/docs/examples/messaging/update-topic.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md deleted file mode 100644 index 5091170..0000000 --- a/docs/examples/messaging/update-twilio-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_twilio_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md deleted file mode 100644 index 7cd819c..0000000 --- a/docs/examples/messaging/update-vonage-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_vonage_provider('[PROVIDER_ID]') diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 1fb104d..72ffdcc 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 643dc93..b469b5b 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,12 +1,13 @@ from appwrite.client import Client from appwrite.input_file import InputFile +from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) storage = Storage(client) diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 3741e9d..60dc107 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 6fc33f8..9bed0af 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) storage = Storage(client) diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index b4ef599..7ea64f2 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 39e67c5..e9f5cce 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) storage = Storage(client) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index e926f15..4e12291 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) storage = Storage(client) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 7036f40..01cbfaf 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) storage = Storage(client) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index e8b7af6..f83ed8a 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) storage = Storage(client) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 8b5eaa7..204fd95 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index f3a6c12..63101e2 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) storage = Storage(client) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 9cf6f02..fb1b76b 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index a504371..24a92e3 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) storage = Storage(client) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 0d58c58..cde8455 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index b524915..c690123 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 37af7f2..f8d8759 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index e1afd82..4fc0fa4 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 85a15a3..e9c62ae 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 4603fb9..40909fa 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) teams = Teams(client) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index e2284d5..fdca2fc 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 30e3945..63e662a 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index edb3575..e60cb60 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 8fee274..a6cd4cd 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) teams = Teams(client) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index e68ba08..816c6ad 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 4458bfb..929f4ec 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) teams = Teams(client) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 3579d2c..4176c62 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,11 +1,12 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) teams = Teams(client) diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index c0eebc7..be1e8ce 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 8f1e3af..77c9918 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index b01a5b0..f3ab3f8 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index efaab20..e715f47 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index 7e784a4..2a2db5a 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 4b3fdf4..0b42e98 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index cff12d7..b445623 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md deleted file mode 100644 index 44129de..0000000 --- a/docs/examples/users/create-session.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.create_session('[USER_ID]') diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md deleted file mode 100644 index 1aea0c2..0000000 --- a/docs/examples/users/create-target.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from Appwrite.enums import MessagingProviderType - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.create_target('[USER_ID]', '[TARGET_ID]', MessagingProviderType.EMAIL, '[IDENTIFIER]') diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md deleted file mode 100644 index 78bec21..0000000 --- a/docs/examples/users/create-token.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.create_token('[USER_ID]') diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index ff4c92a..05249c0 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md deleted file mode 100644 index 94aa014..0000000 --- a/docs/examples/users/delete-authenticator.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from Appwrite.enums import AuthenticatorProvider - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.delete_authenticator('[USER_ID]', AuthenticatorProvider.TOTP, '[OTP]') diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 5420468..d103824 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 45f0c8d..26b041d 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 8e6e285..dabe4f6 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md deleted file mode 100644 index 7d010e9..0000000 --- a/docs/examples/users/delete-target.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.delete_target('[USER_ID]', '[TARGET_ID]') diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index d09204f..7fdc775 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 79a7100..2bbaa88 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md deleted file mode 100644 index 1a77982..0000000 --- a/docs/examples/users/get-target.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.get_target('[USER_ID]', '[TARGET_ID]') diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index b74dcf5..463957d 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 279e9ce..0addd3e 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 0db92fc..ca3a5eb 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 52abcb5..0dfb97a 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-providers.md b/docs/examples/users/list-providers.md deleted file mode 100644 index cf95496..0000000 --- a/docs/examples/users/list-providers.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.list_providers('[USER_ID]') diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 24a7103..5f8fbd6 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md deleted file mode 100644 index 08f6fd2..0000000 --- a/docs/examples/users/list-targets.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.list_targets('[USER_ID]') diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index a5536b4..baaf42c 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 8582aa7..8be33ad 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 6d962e3..4899bd3 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 12e4b94..b2d4c2d 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md deleted file mode 100644 index 0882458..0000000 --- a/docs/examples/users/update-mfa.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.update_mfa('[USER_ID]', False) diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index bff47a9..66bb6b2 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 71b6c86..e79f125 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 5565ee3..e42317c 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index aabc4da..6df39fc 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 00309a9..53d1e52 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index fcd9b94..6d1577d 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md deleted file mode 100644 index be8f764..0000000 --- a/docs/examples/users/update-target.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -users = Users(client) - -result = users.update_target('[USER_ID]', '[TARGET_ID]') diff --git a/setup.py b/setup.py index ec85635..49f3672 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '5.0.0-rc.1', + version = '4.1.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/4.1.0.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From 10be5b721d4d671078285d6a82a25f37ac71e44e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 16 Feb 2024 23:03:50 +1300 Subject: [PATCH 06/60] Release candidate for 1.5.x --- README.md | 2 +- appwrite/client.py | 36 +- appwrite/encoders/__init__.py | 1 + appwrite/encoders/value_class_encoder.py | 81 ++ appwrite/enums/__init__.py | 1 + appwrite/enums/browser.py | 17 + appwrite/enums/compression.py | 6 + appwrite/enums/credit_card.py | 19 + appwrite/enums/execution_method.py | 9 + appwrite/enums/factor.py | 6 + appwrite/enums/flag.py | 197 ++++ appwrite/enums/image_format.py | 8 + appwrite/enums/image_gravity.py | 12 + appwrite/enums/index_type.py | 7 + appwrite/enums/message_status.py | 6 + appwrite/enums/messaging_provider_type.py | 6 + appwrite/enums/name.py | 15 + appwrite/enums/o_auth_provider.py | 42 + appwrite/enums/password_hash.py | 14 + appwrite/enums/relation_mutate.py | 6 + appwrite/enums/relationship_type.py | 7 + appwrite/enums/runtime.py | 7 + appwrite/enums/smtp_encryption.py | 6 + appwrite/enums/type.py | 4 + appwrite/query.py | 88 +- appwrite/services/account.py | 319 +++++- appwrite/services/health.py | 30 + appwrite/services/messaging.py | 1000 +++++++++++++++++ appwrite/services/users.py | 206 +++- docs/examples/account/add-authenticator.md | 14 + .../account/create-anonymous-session.md | 12 + .../account/create-email-password-session.md | 12 + docs/examples/account/create-email-token.md | 12 + docs/examples/account/create-j-w-t.md | 12 + .../account/create-magic-u-r-l-token.md | 12 + .../examples/account/create-o-auth2session.md | 13 + docs/examples/account/create-phone-token.md | 12 + .../account/create-phone-verification.md | 3 +- docs/examples/account/create-recovery.md | 3 +- docs/examples/account/create-session.md | 12 + docs/examples/account/create-verification.md | 3 +- docs/examples/account/create.md | 12 + docs/examples/account/create2f-a-challenge.md | 13 + docs/examples/account/delete-authenticator.md | 14 + docs/examples/account/delete-identity.md | 3 +- docs/examples/account/delete-session.md | 3 +- docs/examples/account/delete-sessions.md | 3 +- docs/examples/account/get-prefs.md | 3 +- docs/examples/account/get-session.md | 3 +- docs/examples/account/get.md | 3 +- docs/examples/account/list-factors.md | 13 + docs/examples/account/list-identities.md | 3 +- docs/examples/account/list-logs.md | 3 +- docs/examples/account/list-sessions.md | 3 +- docs/examples/account/update-challenge.md | 13 + docs/examples/account/update-email.md | 3 +- docs/examples/account/update-m-f-a.md | 13 + .../account/update-magic-u-r-l-session.md | 12 + docs/examples/account/update-name.md | 3 +- docs/examples/account/update-password.md | 3 +- .../account/update-phone-verification.md | 3 +- docs/examples/account/update-phone.md | 3 +- docs/examples/account/update-prefs.md | 3 +- docs/examples/account/update-recovery.md | 5 +- docs/examples/account/update-session.md | 3 +- docs/examples/account/update-status.md | 3 +- docs/examples/account/update-verification.md | 3 +- docs/examples/account/verify-authenticator.md | 14 + docs/examples/avatars/get-browser.md | 6 +- docs/examples/avatars/get-credit-card.md | 6 +- docs/examples/avatars/get-favicon.md | 3 +- docs/examples/avatars/get-flag.md | 6 +- docs/examples/avatars/get-image.md | 3 +- docs/examples/avatars/get-initials.md | 3 +- docs/examples/avatars/get-q-r.md | 3 +- .../databases/create-boolean-attribute.md | 1 - docs/examples/databases/create-collection.md | 1 - .../databases/create-datetime-attribute.md | 1 - docs/examples/databases/create-document.md | 3 +- .../databases/create-email-attribute.md | 1 - .../databases/create-enum-attribute.md | 1 - .../databases/create-float-attribute.md | 1 - docs/examples/databases/create-index.md | 4 +- .../databases/create-integer-attribute.md | 1 - .../examples/databases/create-ip-attribute.md | 1 - .../create-relationship-attribute.md | 4 +- .../databases/create-string-attribute.md | 1 - .../databases/create-url-attribute.md | 1 - docs/examples/databases/create.md | 1 - docs/examples/databases/delete-attribute.md | 1 - docs/examples/databases/delete-collection.md | 1 - docs/examples/databases/delete-document.md | 3 +- docs/examples/databases/delete-index.md | 1 - docs/examples/databases/delete.md | 1 - docs/examples/databases/get-attribute.md | 1 - docs/examples/databases/get-collection.md | 1 - docs/examples/databases/get-document.md | 3 +- docs/examples/databases/get-index.md | 1 - docs/examples/databases/get.md | 1 - docs/examples/databases/list-attributes.md | 1 - docs/examples/databases/list-collections.md | 1 - docs/examples/databases/list-documents.md | 3 +- docs/examples/databases/list-indexes.md | 1 - docs/examples/databases/list.md | 1 - .../databases/update-boolean-attribute.md | 1 - docs/examples/databases/update-collection.md | 1 - .../databases/update-datetime-attribute.md | 1 - docs/examples/databases/update-document.md | 3 +- .../databases/update-email-attribute.md | 1 - .../databases/update-enum-attribute.md | 1 - .../databases/update-float-attribute.md | 1 - .../databases/update-integer-attribute.md | 1 - .../examples/databases/update-ip-attribute.md | 1 - .../update-relationship-attribute.md | 1 - .../databases/update-string-attribute.md | 1 - .../databases/update-url-attribute.md | 1 - docs/examples/databases/update.md | 1 - docs/examples/functions/create-build.md | 1 - docs/examples/functions/create-deployment.md | 1 - docs/examples/functions/create-execution.md | 3 +- docs/examples/functions/create-variable.md | 1 - docs/examples/functions/create.md | 4 +- docs/examples/functions/delete-deployment.md | 1 - docs/examples/functions/delete-variable.md | 1 - docs/examples/functions/delete.md | 1 - .../examples/functions/download-deployment.md | 1 - docs/examples/functions/get-deployment.md | 1 - docs/examples/functions/get-execution.md | 3 +- docs/examples/functions/get-variable.md | 1 - docs/examples/functions/get.md | 1 - docs/examples/functions/list-deployments.md | 1 - docs/examples/functions/list-executions.md | 3 +- docs/examples/functions/list-runtimes.md | 1 - docs/examples/functions/list-variables.md | 1 - docs/examples/functions/list.md | 1 - docs/examples/functions/update-deployment.md | 1 - docs/examples/functions/update-variable.md | 1 - docs/examples/functions/update.md | 1 - docs/examples/graphql/mutation.md | 1 - docs/examples/graphql/query.md | 1 - docs/examples/health/get-antivirus.md | 1 - docs/examples/health/get-cache.md | 1 - docs/examples/health/get-certificate.md | 13 + docs/examples/health/get-d-b.md | 1 - docs/examples/health/get-failed-jobs.md | 14 + docs/examples/health/get-pub-sub.md | 1 - docs/examples/health/get-queue-builds.md | 1 - .../examples/health/get-queue-certificates.md | 1 - docs/examples/health/get-queue-databases.md | 1 - docs/examples/health/get-queue-deletes.md | 1 - docs/examples/health/get-queue-functions.md | 1 - docs/examples/health/get-queue-logs.md | 1 - docs/examples/health/get-queue-mails.md | 1 - docs/examples/health/get-queue-messaging.md | 1 - docs/examples/health/get-queue-migrations.md | 1 - docs/examples/health/get-queue-webhooks.md | 1 - docs/examples/health/get-queue.md | 1 - docs/examples/health/get-storage-local.md | 1 - docs/examples/health/get-time.md | 1 - docs/examples/health/get.md | 1 - docs/examples/locale/get.md | 3 +- docs/examples/locale/list-codes.md | 3 +- docs/examples/locale/list-continents.md | 3 +- docs/examples/locale/list-countries-e-u.md | 3 +- docs/examples/locale/list-countries-phones.md | 3 +- docs/examples/locale/list-countries.md | 3 +- docs/examples/locale/list-currencies.md | 3 +- docs/examples/locale/list-languages.md | 3 +- .../messaging/create-a-p-n-s-provider.md | 13 + docs/examples/messaging/create-email.md | 13 + .../messaging/create-f-c-m-provider.md | 13 + .../messaging/create-mailgun-provider.md | 13 + .../messaging/create-msg91provider.md | 13 + docs/examples/messaging/create-push.md | 13 + docs/examples/messaging/create-s-m-s.md | 13 + .../messaging/create-s-m-t-p-provider.md | 13 + .../messaging/create-sendgrid-provider.md | 13 + docs/examples/messaging/create-subscriber.md | 13 + .../messaging/create-telesign-provider.md | 13 + .../messaging/create-textmagic-provider.md | 13 + docs/examples/messaging/create-topic.md | 13 + .../messaging/create-twilio-provider.md | 13 + .../messaging/create-vonage-provider.md | 13 + docs/examples/messaging/delete-provider.md | 13 + docs/examples/messaging/delete-subscriber.md | 13 + docs/examples/messaging/delete-topic.md | 13 + docs/examples/messaging/delete.md | 13 + docs/examples/messaging/get-message.md | 13 + docs/examples/messaging/get-provider.md | 13 + docs/examples/messaging/get-subscriber.md | 13 + docs/examples/messaging/get-topic.md | 13 + docs/examples/messaging/list-message-logs.md | 13 + docs/examples/messaging/list-messages.md | 13 + docs/examples/messaging/list-provider-logs.md | 13 + docs/examples/messaging/list-providers.md | 13 + .../messaging/list-subscriber-logs.md | 13 + docs/examples/messaging/list-subscribers.md | 13 + docs/examples/messaging/list-targets.md | 13 + docs/examples/messaging/list-topic-logs.md | 13 + docs/examples/messaging/list-topics.md | 13 + .../messaging/update-a-p-n-s-provider.md | 13 + docs/examples/messaging/update-email.md | 13 + .../messaging/update-f-c-m-provider.md | 13 + .../messaging/update-mailgun-provider.md | 13 + .../messaging/update-msg91provider.md | 13 + docs/examples/messaging/update-push.md | 13 + docs/examples/messaging/update-s-m-s.md | 13 + .../messaging/update-s-m-t-p-provider.md | 13 + .../messaging/update-sendgrid-provider.md | 13 + .../messaging/update-telesign-provider.md | 13 + .../messaging/update-textmagic-provider.md | 13 + docs/examples/messaging/update-topic.md | 13 + .../messaging/update-twilio-provider.md | 13 + .../messaging/update-vonage-provider.md | 13 + docs/examples/storage/create-bucket.md | 1 - docs/examples/storage/create-file.md | 3 +- docs/examples/storage/delete-bucket.md | 1 - docs/examples/storage/delete-file.md | 3 +- docs/examples/storage/get-bucket.md | 1 - docs/examples/storage/get-file-download.md | 3 +- docs/examples/storage/get-file-preview.md | 3 +- docs/examples/storage/get-file-view.md | 3 +- docs/examples/storage/get-file.md | 3 +- docs/examples/storage/list-buckets.md | 1 - docs/examples/storage/list-files.md | 3 +- docs/examples/storage/update-bucket.md | 1 - docs/examples/storage/update-file.md | 3 +- docs/examples/teams/create-membership.md | 3 +- docs/examples/teams/create.md | 3 +- docs/examples/teams/delete-membership.md | 3 +- docs/examples/teams/delete.md | 3 +- docs/examples/teams/get-membership.md | 3 +- docs/examples/teams/get-prefs.md | 3 +- docs/examples/teams/get.md | 3 +- docs/examples/teams/list-memberships.md | 3 +- docs/examples/teams/list.md | 3 +- .../teams/update-membership-status.md | 3 +- docs/examples/teams/update-membership.md | 3 +- docs/examples/teams/update-name.md | 3 +- docs/examples/teams/update-prefs.md | 3 +- docs/examples/users/create-argon2user.md | 1 - docs/examples/users/create-bcrypt-user.md | 1 - docs/examples/users/create-m-d5user.md | 1 - docs/examples/users/create-p-h-pass-user.md | 1 - docs/examples/users/create-s-h-a-user.md | 1 - .../users/create-scrypt-modified-user.md | 1 - docs/examples/users/create-scrypt-user.md | 1 - docs/examples/users/create-session.md | 13 + docs/examples/users/create-target.md | 14 + docs/examples/users/create-token.md | 13 + docs/examples/users/create.md | 1 - docs/examples/users/delete-authenticator.md | 14 + docs/examples/users/delete-identity.md | 1 - docs/examples/users/delete-session.md | 1 - docs/examples/users/delete-sessions.md | 1 - docs/examples/users/delete-target.md | 13 + docs/examples/users/delete.md | 1 - docs/examples/users/get-prefs.md | 1 - docs/examples/users/get-target.md | 13 + docs/examples/users/get.md | 1 - docs/examples/users/list-factors.md | 13 + docs/examples/users/list-identities.md | 1 - docs/examples/users/list-logs.md | 1 - docs/examples/users/list-memberships.md | 1 - docs/examples/users/list-sessions.md | 1 - docs/examples/users/list-targets.md | 13 + docs/examples/users/list.md | 1 - .../users/update-email-verification.md | 1 - docs/examples/users/update-email.md | 1 - docs/examples/users/update-labels.md | 1 - docs/examples/users/update-mfa.md | 13 + docs/examples/users/update-name.md | 1 - docs/examples/users/update-password.md | 1 - .../users/update-phone-verification.md | 1 - docs/examples/users/update-phone.md | 1 - docs/examples/users/update-prefs.md | 1 - docs/examples/users/update-status.md | 1 - docs/examples/users/update-target.md | 13 + setup.py | 4 +- 279 files changed, 3157 insertions(+), 303 deletions(-) create mode 100644 appwrite/encoders/__init__.py create mode 100644 appwrite/encoders/value_class_encoder.py create mode 100644 appwrite/enums/__init__.py create mode 100644 appwrite/enums/browser.py create mode 100644 appwrite/enums/compression.py create mode 100644 appwrite/enums/credit_card.py create mode 100644 appwrite/enums/execution_method.py create mode 100644 appwrite/enums/factor.py create mode 100644 appwrite/enums/flag.py create mode 100644 appwrite/enums/image_format.py create mode 100644 appwrite/enums/image_gravity.py create mode 100644 appwrite/enums/index_type.py create mode 100644 appwrite/enums/message_status.py create mode 100644 appwrite/enums/messaging_provider_type.py create mode 100644 appwrite/enums/name.py create mode 100644 appwrite/enums/o_auth_provider.py create mode 100644 appwrite/enums/password_hash.py create mode 100644 appwrite/enums/relation_mutate.py create mode 100644 appwrite/enums/relationship_type.py create mode 100644 appwrite/enums/runtime.py create mode 100644 appwrite/enums/smtp_encryption.py create mode 100644 appwrite/enums/type.py create mode 100644 appwrite/services/messaging.py create mode 100644 docs/examples/account/add-authenticator.md create mode 100644 docs/examples/account/create-anonymous-session.md create mode 100644 docs/examples/account/create-email-password-session.md create mode 100644 docs/examples/account/create-email-token.md create mode 100644 docs/examples/account/create-j-w-t.md create mode 100644 docs/examples/account/create-magic-u-r-l-token.md create mode 100644 docs/examples/account/create-o-auth2session.md create mode 100644 docs/examples/account/create-phone-token.md create mode 100644 docs/examples/account/create-session.md create mode 100644 docs/examples/account/create.md create mode 100644 docs/examples/account/create2f-a-challenge.md create mode 100644 docs/examples/account/delete-authenticator.md create mode 100644 docs/examples/account/list-factors.md create mode 100644 docs/examples/account/update-challenge.md create mode 100644 docs/examples/account/update-m-f-a.md create mode 100644 docs/examples/account/update-magic-u-r-l-session.md create mode 100644 docs/examples/account/verify-authenticator.md create mode 100644 docs/examples/health/get-certificate.md create mode 100644 docs/examples/health/get-failed-jobs.md create mode 100644 docs/examples/messaging/create-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/create-email.md create mode 100644 docs/examples/messaging/create-f-c-m-provider.md create mode 100644 docs/examples/messaging/create-mailgun-provider.md create mode 100644 docs/examples/messaging/create-msg91provider.md create mode 100644 docs/examples/messaging/create-push.md create mode 100644 docs/examples/messaging/create-s-m-s.md create mode 100644 docs/examples/messaging/create-s-m-t-p-provider.md create mode 100644 docs/examples/messaging/create-sendgrid-provider.md create mode 100644 docs/examples/messaging/create-subscriber.md create mode 100644 docs/examples/messaging/create-telesign-provider.md create mode 100644 docs/examples/messaging/create-textmagic-provider.md create mode 100644 docs/examples/messaging/create-topic.md create mode 100644 docs/examples/messaging/create-twilio-provider.md create mode 100644 docs/examples/messaging/create-vonage-provider.md create mode 100644 docs/examples/messaging/delete-provider.md create mode 100644 docs/examples/messaging/delete-subscriber.md create mode 100644 docs/examples/messaging/delete-topic.md create mode 100644 docs/examples/messaging/delete.md create mode 100644 docs/examples/messaging/get-message.md create mode 100644 docs/examples/messaging/get-provider.md create mode 100644 docs/examples/messaging/get-subscriber.md create mode 100644 docs/examples/messaging/get-topic.md create mode 100644 docs/examples/messaging/list-message-logs.md create mode 100644 docs/examples/messaging/list-messages.md create mode 100644 docs/examples/messaging/list-provider-logs.md create mode 100644 docs/examples/messaging/list-providers.md create mode 100644 docs/examples/messaging/list-subscriber-logs.md create mode 100644 docs/examples/messaging/list-subscribers.md create mode 100644 docs/examples/messaging/list-targets.md create mode 100644 docs/examples/messaging/list-topic-logs.md create mode 100644 docs/examples/messaging/list-topics.md create mode 100644 docs/examples/messaging/update-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/update-email.md create mode 100644 docs/examples/messaging/update-f-c-m-provider.md create mode 100644 docs/examples/messaging/update-mailgun-provider.md create mode 100644 docs/examples/messaging/update-msg91provider.md create mode 100644 docs/examples/messaging/update-push.md create mode 100644 docs/examples/messaging/update-s-m-s.md create mode 100644 docs/examples/messaging/update-s-m-t-p-provider.md create mode 100644 docs/examples/messaging/update-sendgrid-provider.md create mode 100644 docs/examples/messaging/update-telesign-provider.md create mode 100644 docs/examples/messaging/update-textmagic-provider.md create mode 100644 docs/examples/messaging/update-topic.md create mode 100644 docs/examples/messaging/update-twilio-provider.md create mode 100644 docs/examples/messaging/update-vonage-provider.md create mode 100644 docs/examples/users/create-session.md create mode 100644 docs/examples/users/create-target.md create mode 100644 docs/examples/users/create-token.md create mode 100644 docs/examples/users/delete-authenticator.md create mode 100644 docs/examples/users/delete-target.md create mode 100644 docs/examples/users/get-target.md create mode 100644 docs/examples/users/list-factors.md create mode 100644 docs/examples/users/list-targets.md create mode 100644 docs/examples/users/update-mfa.md create mode 100644 docs/examples/users/update-target.md diff --git a/README.md b/README.md index 1f9ce4d..9f444c6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** +**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite/client.py b/appwrite/client.py index d5dd8c7..8b0eb1e 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -1,21 +1,23 @@ import io -import requests +import json import os +import requests from .input_file import InputFile from .exception import AppwriteException +from .encoders.value_class_encoder import ValueClassEncoder class Client: def __init__(self): self._chunk_size = 5*1024*1024 self._self_signed = False - self._endpoint = 'https://HOSTNAME/v1' + self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/4.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.2 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '4.1.0', + 'x-sdk-version': '5.0.0-rc.2', 'X-Appwrite-Response-Format' : '1.4.0', } @@ -53,6 +55,24 @@ def set_locale(self, value): self._global_headers['x-appwrite-locale'] = value return self + def set_session(self, value): + """The user session to authenticate with""" + + self._global_headers['x-appwrite-session'] = value + return self + + def set_forwarded_for(self, value): + """The IP address of the client that made the request""" + + self._global_headers['x-forwarded-for'] = value + return self + + def set_forwarded_user_agent(self, value): + """The user agent string of the client that made the request""" + + self._global_headers['x-forwarded-user-agent'] = value + return self + def call(self, method, path='', headers=None, params=None): if headers is None: headers = {} @@ -63,7 +83,6 @@ def call(self, method, path='', headers=None, params=None): params = {k: v for k, v in params.items() if v is not None} # Remove None values from params dictionary data = {} - json = {} files = {} stringify = False @@ -74,8 +93,7 @@ def call(self, method, path='', headers=None, params=None): params = {} if headers['content-type'].startswith('application/json'): - json = data - data = {} + data = json.dumps(data, cls=ValueClassEncoder) if headers['content-type'].startswith('multipart/form-data'): del headers['content-type'] @@ -84,14 +102,14 @@ def call(self, method, path='', headers=None, params=None): if isinstance(data[key], InputFile): files[key] = (data[key].filename, data[key].data) del data[key] + data = self.flatten(data, stringify=stringify) response = None try: response = requests.request( # call method dynamically https://stackoverflow.com/a/4246075/2299554 method=method, url=self._endpoint + path, params=self.flatten(params, stringify=stringify), - data=self.flatten(data), - json=json, + data=data, files=files, headers=headers, verify=(not self._self_signed), diff --git a/appwrite/encoders/__init__.py b/appwrite/encoders/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/appwrite/encoders/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py new file mode 100644 index 0000000..3bb85d6 --- /dev/null +++ b/appwrite/encoders/value_class_encoder.py @@ -0,0 +1,81 @@ +import json +from ..enums.factor import Factor +from ..enums.type import Type +from ..enums.o_auth_provider import OAuthProvider +from ..enums.browser import Browser +from ..enums.credit_card import CreditCard +from ..enums.flag import Flag +from ..enums.relationship_type import RelationshipType +from ..enums.relation_mutate import RelationMutate +from ..enums.index_type import IndexType +from ..enums.runtime import Runtime +from ..enums.execution_method import ExecutionMethod +from ..enums.name import Name +from ..enums.message_status import MessageStatus +from ..enums.smtp_encryption import SMTPEncryption +from ..enums.compression import Compression +from ..enums.image_gravity import ImageGravity +from ..enums.image_format import ImageFormat +from ..enums.password_hash import PasswordHash +from ..enums.messaging_provider_type import MessagingProviderType + +class ValueClassEncoder(json.JSONEncoder): + def default(self, o): + if isinstance(o, Factor): + return o.value + + if isinstance(o, Type): + return o.value + + if isinstance(o, OAuthProvider): + return o.value + + if isinstance(o, Browser): + return o.value + + if isinstance(o, CreditCard): + return o.value + + if isinstance(o, Flag): + return o.value + + if isinstance(o, RelationshipType): + return o.value + + if isinstance(o, RelationMutate): + return o.value + + if isinstance(o, IndexType): + return o.value + + if isinstance(o, Runtime): + return o.value + + if isinstance(o, ExecutionMethod): + return o.value + + if isinstance(o, Name): + return o.value + + if isinstance(o, MessageStatus): + return o.value + + if isinstance(o, SMTPEncryption): + return o.value + + if isinstance(o, Compression): + return o.value + + if isinstance(o, ImageGravity): + return o.value + + if isinstance(o, ImageFormat): + return o.value + + if isinstance(o, PasswordHash): + return o.value + + if isinstance(o, MessagingProviderType): + return o.value + + return super().default(o) \ No newline at end of file diff --git a/appwrite/enums/__init__.py b/appwrite/enums/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/appwrite/enums/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/appwrite/enums/browser.py b/appwrite/enums/browser.py new file mode 100644 index 0000000..02974ec --- /dev/null +++ b/appwrite/enums/browser.py @@ -0,0 +1,17 @@ +from enum import Enum + +class Browser(Enum): + AVANT_BROWSER = "aa" + ANDROID_WEBVIEW_BETA = "an" + GOOGLE_CHROME = "ch" + GOOGLE_CHROME_IOS = "ci" + GOOGLE_CHROME_MOBILE = "cm" + CHROMIUM = "cr" + MOZILLA_FIREFOX = "ff" + SAFARI = "sf" + MOBILE_SAFARI = "mf" + MICROSOFT_EDGE = "ps" + MICROSOFT_EDGE_IOS = "oi" + OPERA_MINI = "om" + OPERA = "op" + OPERA_NEXT = "on" diff --git a/appwrite/enums/compression.py b/appwrite/enums/compression.py new file mode 100644 index 0000000..6d2d21a --- /dev/null +++ b/appwrite/enums/compression.py @@ -0,0 +1,6 @@ +from enum import Enum + +class Compression(Enum): + NONE = "none" + GZIP = "gzip" + ZSTD = "zstd" diff --git a/appwrite/enums/credit_card.py b/appwrite/enums/credit_card.py new file mode 100644 index 0000000..127e077 --- /dev/null +++ b/appwrite/enums/credit_card.py @@ -0,0 +1,19 @@ +from enum import Enum + +class CreditCard(Enum): + AMERICAN_EXPRESS = "amex" + ARGENCARD = "argencard" + CABAL = "cabal" + CONSOSUD = "censosud" + DINERS_CLUB = "diners" + DISCOVER = "discover" + ELO = "elo" + HIPERCARD = "hipercard" + JCB = "jcb" + MASTERCARD = "mastercard" + NARANJA = "naranja" + TARJETA_SHOPPING = "targeta-shopping" + UNION_CHINA_PAY = "union-china-pay" + VISA = "visa" + MIR = "mir" + MAESTRO = "maestro" diff --git a/appwrite/enums/execution_method.py b/appwrite/enums/execution_method.py new file mode 100644 index 0000000..23df3b9 --- /dev/null +++ b/appwrite/enums/execution_method.py @@ -0,0 +1,9 @@ +from enum import Enum + +class ExecutionMethod(Enum): + GET = "GET" + POST = "POST" + PUT = "PUT" + PATCH = "PATCH" + DELETE = "DELETE" + OPTIONS = "OPTIONS" diff --git a/appwrite/enums/factor.py b/appwrite/enums/factor.py new file mode 100644 index 0000000..90e4ce3 --- /dev/null +++ b/appwrite/enums/factor.py @@ -0,0 +1,6 @@ +from enum import Enum + +class Factor(Enum): + TOTP = "totp" + PHONE = "phone" + EMAIL = "email" diff --git a/appwrite/enums/flag.py b/appwrite/enums/flag.py new file mode 100644 index 0000000..5988e11 --- /dev/null +++ b/appwrite/enums/flag.py @@ -0,0 +1,197 @@ +from enum import Enum + +class Flag(Enum): + AFGHANISTAN = "af" + ANGOLA = "ao" + ALBANIA = "al" + ANDORRA = "ad" + UNITED_ARAB_EMIRATES = "ae" + ARGENTINA = "ar" + ARMENIA = "am" + ANTIGUA_AND_BARBUDA = "ag" + AUSTRALIA = "au" + AUSTRIA = "at" + AZERBAIJAN = "az" + BURUNDI = "bi" + BELGIUM = "be" + BENIN = "bj" + BURKINA_FASO = "bf" + BANGLADESH = "bd" + BULGARIA = "bg" + BAHRAIN = "bh" + BAHAMAS = "bs" + BOSNIA_AND_HERZEGOVINA = "ba" + BELARUS = "by" + BELIZE = "bz" + BOLIVIA = "bo" + BRAZIL = "br" + BARBADOS = "bb" + BRUNEI_DARUSSALAM = "bn" + BHUTAN = "bt" + BOTSWANA = "bw" + CENTRAL_AFRICAN_REPUBLIC = "cf" + CANADA = "ca" + SWITZERLAND = "ch" + CHILE = "cl" + CHINA = "cn" + CôTE_D'IVOIRE = "ci" + CAMEROON = "cm" + DEMOCRATIC_REPUBLIC_OF_THE_CONGO = "cd" + REPUBLIC_OF_THE_CONGO = "cg" + COLOMBIA = "co" + COMOROS = "km" + CAPE_VERDE = "cv" + COSTA_RICA = "cr" + CUBA = "cu" + CYPRUS = "cy" + CZECH_REPUBLIC = "cz" + GERMANY = "de" + DJIBOUTI = "dj" + DOMINICA = "dm" + DENMARK = "dk" + DOMINICAN_REPUBLIC = "do" + ALGERIA = "dz" + ECUADOR = "ec" + EGYPT = "eg" + ERITREA = "er" + SPAIN = "es" + ESTONIA = "ee" + ETHIOPIA = "et" + FINLAND = "fi" + FIJI = "fj" + FRANCE = "fr" + MICRONESIA_FEDERATED_STATES_OF = "fm" + GABON = "ga" + UNITED_KINGDOM = "gb" + GEORGIA = "ge" + GHANA = "gh" + GUINEA = "gn" + GAMBIA = "gm" + GUINEABISSAU = "gw" + EQUATORIAL_GUINEA = "gq" + GREECE = "gr" + GRENADA = "gd" + GUATEMALA = "gt" + GUYANA = "gy" + HONDURAS = "hn" + CROATIA = "hr" + HAITI = "ht" + HUNGARY = "hu" + INDONESIA = "id" + INDIA = "in" + IRELAND = "ie" + IRAN_ISLAMIC_REPUBLIC_OF = "ir" + IRAQ = "iq" + ICELAND = "is" + ISRAEL = "il" + ITALY = "it" + JAMAICA = "jm" + JORDAN = "jo" + JAPAN = "jp" + KAZAKHSTAN = "kz" + KENYA = "ke" + KYRGYZSTAN = "kg" + CAMBODIA = "kh" + KIRIBATI = "ki" + SAINT_KITTS_AND_NEVIS = "kn" + SOUTH_KOREA = "kr" + KUWAIT = "kw" + LAO_PEOPLE'S_DEMOCRATIC_REPUBLIC = "la" + LEBANON = "lb" + LIBERIA = "lr" + LIBYA = "ly" + SAINT_LUCIA = "lc" + LIECHTENSTEIN = "li" + SRI_LANKA = "lk" + LESOTHO = "ls" + LITHUANIA = "lt" + LUXEMBOURG = "lu" + LATVIA = "lv" + MOROCCO = "ma" + MONACO = "mc" + MOLDOVA = "md" + MADAGASCAR = "mg" + MALDIVES = "mv" + MEXICO = "mx" + MARSHALL_ISLANDS = "mh" + NORTH_MACEDONIA = "mk" + MALI = "ml" + MALTA = "mt" + MYANMAR = "mm" + MONTENEGRO = "me" + MONGOLIA = "mn" + MOZAMBIQUE = "mz" + MAURITANIA = "mr" + MAURITIUS = "mu" + MALAWI = "mw" + MALAYSIA = "my" + NAMIBIA = "na" + NIGER = "ne" + NIGERIA = "ng" + NICARAGUA = "ni" + NETHERLANDS = "nl" + NORWAY = "no" + NEPAL = "np" + NAURU = "nr" + NEW_ZEALAND = "nz" + OMAN = "om" + PAKISTAN = "pk" + PANAMA = "pa" + PERU = "pe" + PHILIPPINES = "ph" + PALAU = "pw" + PAPUA_NEW_GUINEA = "pg" + POLAND = "pl" + NORTH_KOREA = "kp" + PORTUGAL = "pt" + PARAGUAY = "py" + QATAR = "qa" + ROMANIA = "ro" + RUSSIA = "ru" + RWANDA = "rw" + SAUDI_ARABIA = "sa" + SUDAN = "sd" + SENEGAL = "sn" + SINGAPORE = "sg" + SOLOMON_ISLANDS = "sb" + SIERRA_LEONE = "sl" + EL_SALVADOR = "sv" + SAN_MARINO = "sm" + SOMALIA = "so" + SERBIA = "rs" + SOUTH_SUDAN = "ss" + SAO_TOME_AND_PRINCIPE = "st" + SURINAME = "sr" + SLOVAKIA = "sk" + SLOVENIA = "si" + SWEDEN = "se" + ESWATINI = "sz" + SEYCHELLES = "sc" + SYRIA = "sy" + CHAD = "td" + TOGO = "tg" + THAILAND = "th" + TAJIKISTAN = "tj" + TURKMENISTAN = "tm" + TIMORLESTE = "tl" + TONGA = "to" + TRINIDAD_AND_TOBAGO = "tt" + TUNISIA = "tn" + TURKEY = "tr" + TUVALU = "tv" + TANZANIA = "tz" + UGANDA = "ug" + UKRAINE = "ua" + URUGUAY = "uy" + UNITED_STATES = "us" + UZBEKISTAN = "uz" + VATICAN_CITY = "va" + SAINT_VINCENT_AND_THE_GRENADINES = "vc" + VENEZUELA = "ve" + VIETNAM = "vn" + VANUATU = "vu" + SAMOA = "ws" + YEMEN = "ye" + SOUTH_AFRICA = "za" + ZAMBIA = "zm" + ZIMBABWE = "zw" diff --git a/appwrite/enums/image_format.py b/appwrite/enums/image_format.py new file mode 100644 index 0000000..7cdd8f3 --- /dev/null +++ b/appwrite/enums/image_format.py @@ -0,0 +1,8 @@ +from enum import Enum + +class ImageFormat(Enum): + JPG = "jpg" + JPEG = "jpeg" + GIF = "gif" + PNG = "png" + WEBP = "webp" diff --git a/appwrite/enums/image_gravity.py b/appwrite/enums/image_gravity.py new file mode 100644 index 0000000..1d365a9 --- /dev/null +++ b/appwrite/enums/image_gravity.py @@ -0,0 +1,12 @@ +from enum import Enum + +class ImageGravity(Enum): + CENTER = "center" + TOPLEFT = "top-left" + TOP = "top" + TOPRIGHT = "top-right" + LEFT = "left" + RIGHT = "right" + BOTTOMLEFT = "bottom-left" + BOTTOM = "bottom" + BOTTOMRIGHT = "bottom-right" diff --git a/appwrite/enums/index_type.py b/appwrite/enums/index_type.py new file mode 100644 index 0000000..842240f --- /dev/null +++ b/appwrite/enums/index_type.py @@ -0,0 +1,7 @@ +from enum import Enum + +class IndexType(Enum): + KEY = "key" + FULLTEXT = "fulltext" + UNIQUE = "unique" + SPATIAL = "spatial" diff --git a/appwrite/enums/message_status.py b/appwrite/enums/message_status.py new file mode 100644 index 0000000..572b98a --- /dev/null +++ b/appwrite/enums/message_status.py @@ -0,0 +1,6 @@ +from enum import Enum + +class MessageStatus(Enum): + DRAFT = "draft" + SCHEDULED = "scheduled" + PROCESSING = "processing" diff --git a/appwrite/enums/messaging_provider_type.py b/appwrite/enums/messaging_provider_type.py new file mode 100644 index 0000000..e6e7c07 --- /dev/null +++ b/appwrite/enums/messaging_provider_type.py @@ -0,0 +1,6 @@ +from enum import Enum + +class MessagingProviderType(Enum): + EMAIL = "email" + SMS = "sms" + PUSH = "push" diff --git a/appwrite/enums/name.py b/appwrite/enums/name.py new file mode 100644 index 0000000..aeeab59 --- /dev/null +++ b/appwrite/enums/name.py @@ -0,0 +1,15 @@ +from enum import Enum + +class Name(Enum): + V1DATABASE = "v1-database" + V1DELETES = "v1-deletes" + V1AUDITS = "v1-audits" + V1MAILS = "v1-mails" + V1FUNCTIONS = "v1-functions" + V1USAGE = "v1-usage" + WEBHOOKSV1 = "webhooksv1" + V1CERTIFICATES = "v1-certificates" + V1BUILDS = "v1-builds" + V1MESSAGING = "v1-messaging" + V1MIGRATIONS = "v1-migrations" + HAMSTERV1 = "hamsterv1" diff --git a/appwrite/enums/o_auth_provider.py b/appwrite/enums/o_auth_provider.py new file mode 100644 index 0000000..3d46c8e --- /dev/null +++ b/appwrite/enums/o_auth_provider.py @@ -0,0 +1,42 @@ +from enum import Enum + +class OAuthProvider(Enum): + AMAZON = "amazon" + APPLE = "apple" + AUTH0 = "auth0" + AUTHENTIK = "authentik" + AUTODESK = "autodesk" + BITBUCKET = "bitbucket" + BITLY = "bitly" + BOX = "box" + DAILYMOTION = "dailymotion" + DISCORD = "discord" + DISQUS = "disqus" + DROPBOX = "dropbox" + ETSY = "etsy" + FACEBOOK = "facebook" + GITHUB = "github" + GITLAB = "gitlab" + GOOGLE = "google" + LINKEDIN = "linkedin" + MICROSOFT = "microsoft" + NOTION = "notion" + OIDC = "oidc" + OKTA = "okta" + PAYPAL = "paypal" + PAYPALSANDBOX = "paypalSandbox" + PODIO = "podio" + SALESFORCE = "salesforce" + SLACK = "slack" + SPOTIFY = "spotify" + STRIPE = "stripe" + TRADESHIFT = "tradeshift" + TRADESHIFTBOX = "tradeshiftBox" + TWITCH = "twitch" + WORDPRESS = "wordpress" + YAHOO = "yahoo" + YAMMER = "yammer" + YANDEX = "yandex" + ZOHO = "zoho" + ZOOM = "zoom" + MOCK = "mock" diff --git a/appwrite/enums/password_hash.py b/appwrite/enums/password_hash.py new file mode 100644 index 0000000..af9fed2 --- /dev/null +++ b/appwrite/enums/password_hash.py @@ -0,0 +1,14 @@ +from enum import Enum + +class PasswordHash(Enum): + SHA1 = "sha1" + SHA224 = "sha224" + SHA256 = "sha256" + SHA384 = "sha384" + SHA512/224 = "sha512/224" + SHA512/256 = "sha512/256" + SHA512 = "sha512" + SHA3224 = "sha3-224" + SHA3256 = "sha3-256" + SHA3384 = "sha3-384" + SHA3512 = "sha3-512" diff --git a/appwrite/enums/relation_mutate.py b/appwrite/enums/relation_mutate.py new file mode 100644 index 0000000..ae52aa7 --- /dev/null +++ b/appwrite/enums/relation_mutate.py @@ -0,0 +1,6 @@ +from enum import Enum + +class RelationMutate(Enum): + CASCADE = "cascade" + RESTRICT = "restrict" + SETNULL = "setNull" diff --git a/appwrite/enums/relationship_type.py b/appwrite/enums/relationship_type.py new file mode 100644 index 0000000..7866ca6 --- /dev/null +++ b/appwrite/enums/relationship_type.py @@ -0,0 +1,7 @@ +from enum import Enum + +class RelationshipType(Enum): + ONETOONE = "oneToOne" + MANYTOONE = "manyToOne" + MANYTOMANY = "manyToMany" + ONETOMANY = "oneToMany" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py new file mode 100644 index 0000000..cca0f68 --- /dev/null +++ b/appwrite/enums/runtime.py @@ -0,0 +1,7 @@ +from enum import Enum + +class Runtime(Enum): + NODE180 = "node-18.0" + PHP80 = "php-8.0" + RUBY31 = "ruby-3.1" + PYTHON39 = "python-3.9" diff --git a/appwrite/enums/smtp_encryption.py b/appwrite/enums/smtp_encryption.py new file mode 100644 index 0000000..405fc60 --- /dev/null +++ b/appwrite/enums/smtp_encryption.py @@ -0,0 +1,6 @@ +from enum import Enum + +class SMTPEncryption(Enum): + NONE = "none" + SSL = "ssl" + TLS = "tls" diff --git a/appwrite/enums/type.py b/appwrite/enums/type.py new file mode 100644 index 0000000..62e58cf --- /dev/null +++ b/appwrite/enums/type.py @@ -0,0 +1,4 @@ +from enum import Enum + +class Type(Enum): + TOTP = "totp" diff --git a/appwrite/query.py b/appwrite/query.py index d970bd8..f25e33d 100644 --- a/appwrite/query.py +++ b/appwrite/query.py @@ -1,92 +1,108 @@ -class Query: +import json + + +# Inherit from dict to allow for easy serialization +class Query(): + def __init__(self, method, attribute=None, values=None): + self.method = method + + if attribute is not None: + self.attribute = attribute + + if values is not None: + self.values = values if isinstance(values, list) else [values] + + def __str__(self): + return json.dumps( + self.__dict__, + separators=(",", ":"), + default=lambda obj: obj.__dict__ + ) + @staticmethod def equal(attribute, value): - return Query.add_query(attribute, "equal", value) + return str(Query("equal", attribute, value)) @staticmethod def not_equal(attribute, value): - return Query.add_query(attribute, "notEqual", value) - + return str(Query("notEqual", attribute, value)) + @staticmethod def less_than(attribute, value): - return Query.add_query(attribute, "lessThan", value) - + return str(Query("lessThan", attribute, value)) + @staticmethod def less_than_equal(attribute, value): - return Query.add_query(attribute, "lessThanEqual", value) - + return str(Query("lessThanEqual", attribute, value)) + @staticmethod def greater_than(attribute, value): - return Query.add_query(attribute, "greaterThan", value) - + return str(Query("greaterThan", attribute, value)) + @staticmethod def greater_than_equal(attribute, value): - return Query.add_query(attribute, "greaterThanEqual", value) + return str(Query("greaterThanEqual", attribute, value)) @staticmethod def is_null(attribute): - return f'isNull("{attribute}")' + return str(Query("isNull", attribute, None)) @staticmethod def is_not_null(attribute): - return f'isNotNull("{attribute}")' + return str(Query("isNotNull", attribute, None)) @staticmethod def between(attribute, start, end): - return f'between("{attribute}", {Query.parseValues(start)}, {Query.parseValues(end)})' + return str(Query("between", attribute, [start, end])) @staticmethod def starts_with(attribute, value): - return Query.add_query(attribute, "startsWith", value) + return str(Query("startsWith", attribute, value)) @staticmethod def ends_with(attribute, value): - return Query.add_query(attribute, "endsWith", value) + return str(Query("endsWith", attribute, value)) @staticmethod def select(attributes): - return f'select([{",".join(map(Query.parseValues, attributes))}])' + return str(Query("select", None, attributes)) @staticmethod def search(attribute, value): - return Query.add_query(attribute, "search", value) + return str(Query("search", attribute, value)) @staticmethod def order_asc(attribute): - return f'orderAsc("{attribute}")' + return str(Query("orderAsc", attribute, None)) @staticmethod def order_desc(attribute): - return f'orderDesc("{attribute}")' + return str(Query("orderDesc", attribute, None)) @staticmethod def cursor_before(id): - return f'cursorBefore("{id}")' + return str(Query("cursorBefore", None, id)) @staticmethod def cursor_after(id): - return f'cursorAfter("{id}")' + return str(Query("cursorAfter", None, id)) @staticmethod def limit(limit): - return f'limit({limit})' + return str(Query("limit", None, limit)) @staticmethod def offset(offset): - return f'offset({offset})' + return str(Query("offset", None, offset)) + + @staticmethod + def contains(attribute, value): + return str(Query("contains", attribute, value)) @staticmethod - def add_query(attribute, method, value): - if type(value) == list: - return f'{method}("{attribute}", [{",".join(map(Query.parseValues, value))}])' - else: - return f'{method}("{attribute}", [{Query.parseValues(value)}])' + def or_queries(queries): + return str(Query("or", None, [json.loads(query) for query in queries])) @staticmethod - def parseValues(value): - if type(value) == str: - return f'"{value}"' - elif type(value) == bool: - return str(value).lower() - else: - return str(value) \ No newline at end of file + def and_queries(queries): + return str(Query("and", None, [json.loads(query) for query in queries])) diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 278d890..153cf15 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -17,6 +17,31 @@ def get(self): 'content-type': 'application/json', }, api_params) + def create(self, user_id, email, password, name = None): + """Create account""" + + + api_path = '/account' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if email is None: + raise AppwriteException('Missing required parameter: "email"') + + if password is None: + raise AppwriteException('Missing required parameter: "password"') + + + api_params['userId'] = user_id + api_params['email'] = email + api_params['password'] = password + api_params['name'] = name + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_email(self, email, password): """Update email""" @@ -51,7 +76,7 @@ def list_identities(self, queries = None): }, api_params) def delete_identity(self, identity_id): - """Delete Identity""" + """Delete identity""" api_path = '/account/identities/{identityId}' @@ -66,6 +91,17 @@ def delete_identity(self, identity_id): 'content-type': 'application/json', }, api_params) + def create_jwt(self): + """Create JWT""" + + + api_path = '/account/jwt' + api_params = {} + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def list_logs(self, queries = None): """List logs""" @@ -79,6 +115,125 @@ def list_logs(self, queries = None): 'content-type': 'application/json', }, api_params) + def update_mfa(self, mfa): + """Update MFA""" + + + api_path = '/account/mfa' + api_params = {} + if mfa is None: + raise AppwriteException('Missing required parameter: "mfa"') + + + api_params['mfa'] = mfa + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create2_fa_challenge(self, factor): + """Create 2FA Challenge""" + + + api_path = '/account/mfa/challenge' + api_params = {} + if factor is None: + raise AppwriteException('Missing required parameter: "factor"') + + + api_params['factor'] = factor + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_challenge(self, challenge_id, otp): + """Create MFA Challenge (confirmation)""" + + + api_path = '/account/mfa/challenge' + api_params = {} + if challenge_id is None: + raise AppwriteException('Missing required parameter: "challenge_id"') + + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + + api_params['challengeId'] = challenge_id + api_params['otp'] = otp + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_factors(self): + """List Factors""" + + + api_path = '/account/mfa/factors' + api_params = {} + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def add_authenticator(self, type): + """Add Authenticator""" + + + api_path = '/account/mfa/{type}' + api_params = {} + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + api_path = api_path.replace('{type}', type) + + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def verify_authenticator(self, type, otp): + """Verify Authenticator""" + + + api_path = '/account/mfa/{type}' + api_params = {} + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + api_path = api_path.replace('{type}', type) + + api_params['otp'] = otp + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_authenticator(self, type, otp): + """Delete Authenticator""" + + + api_path = '/account/mfa/{type}' + api_params = {} + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + api_path = api_path.replace('{type}', type) + + api_params['otp'] = otp + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_name(self, name): """Update name""" @@ -179,7 +334,7 @@ def create_recovery(self, email, url): 'content-type': 'application/json', }, api_params) - def update_recovery(self, user_id, secret, password, password_again): + def update_recovery(self, user_id, secret, password): """Create password recovery (confirmation)""" @@ -194,14 +349,10 @@ def update_recovery(self, user_id, secret, password, password_again): if password is None: raise AppwriteException('Missing required parameter: "password"') - if password_again is None: - raise AppwriteException('Missing required parameter: "password_again"') - api_params['userId'] = user_id api_params['secret'] = secret api_params['password'] = password - api_params['passwordAgain'] = password_again return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -229,6 +380,97 @@ def delete_sessions(self): 'content-type': 'application/json', }, api_params) + def create_anonymous_session(self): + """Create anonymous session""" + + + api_path = '/account/sessions/anonymous' + api_params = {} + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_email_password_session(self, email, password): + """Create email password session""" + + + api_path = '/account/sessions/email' + api_params = {} + if email is None: + raise AppwriteException('Missing required parameter: "email"') + + if password is None: + raise AppwriteException('Missing required parameter: "password"') + + + api_params['email'] = email + api_params['password'] = password + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_magic_url_session(self, user_id, secret): + """Create session (deprecated)""" + + + api_path = '/account/sessions/magic-url' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if secret is None: + raise AppwriteException('Missing required parameter: "secret"') + + + api_params['userId'] = user_id + api_params['secret'] = secret + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_o_auth2_session(self, provider, success = None, failure = None, token = None, scopes = None): + """Create OAuth2 session""" + + + api_path = '/account/sessions/oauth2/{provider}' + api_params = {} + if provider is None: + raise AppwriteException('Missing required parameter: "provider"') + + api_path = api_path.replace('{provider}', provider) + + api_params['success'] = success + api_params['failure'] = failure + api_params['token'] = token + api_params['scopes'] = scopes + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_session(self, user_id, secret): + """Create session""" + + + api_path = '/account/sessions/token' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if secret is None: + raise AppwriteException('Missing required parameter: "secret"') + + + api_params['userId'] = user_id + api_params['secret'] = secret + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def get_session(self, session_id): """Get session""" @@ -246,7 +488,7 @@ def get_session(self, session_id): }, api_params) def update_session(self, session_id): - """Update OAuth session (refresh tokens)""" + """Update (or renew) a session""" api_path = '/account/sessions/{sessionId}' @@ -288,6 +530,69 @@ def update_status(self): 'content-type': 'application/json', }, api_params) + def create_email_token(self, user_id, email, phrase = None): + """Create email token (OTP)""" + + + api_path = '/account/tokens/email' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if email is None: + raise AppwriteException('Missing required parameter: "email"') + + + api_params['userId'] = user_id + api_params['email'] = email + api_params['phrase'] = phrase + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_magic_url_token(self, user_id, email, url = None, phrase = None): + """Create magic URL token""" + + + api_path = '/account/tokens/magic-url' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if email is None: + raise AppwriteException('Missing required parameter: "email"') + + + api_params['userId'] = user_id + api_params['email'] = email + api_params['url'] = url + api_params['phrase'] = phrase + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_phone_token(self, user_id, phone): + """Create phone token""" + + + api_path = '/account/tokens/phone' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if phone is None: + raise AppwriteException('Missing required parameter: "phone"') + + + api_params['userId'] = user_id + api_params['phone'] = phone + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def create_verification(self, url): """Create email verification""" diff --git a/appwrite/services/health.py b/appwrite/services/health.py index b4f1bf1..d2b5cac 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -39,6 +39,19 @@ def get_cache(self): 'content-type': 'application/json', }, api_params) + def get_certificate(self, domain = None): + """Get the SSL certificate for a domain""" + + + api_path = '/health/certificate' + api_params = {} + + api_params['domain'] = domain + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + def get_db(self): """Get DB""" @@ -125,6 +138,23 @@ def get_queue_deletes(self, threshold = None): 'content-type': 'application/json', }, api_params) + def get_failed_jobs(self, name, threshold = None): + """Get number of failed queue jobs""" + + + api_path = '/health/queue/failed/{name}' + api_params = {} + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + api_path = api_path.replace('{name}', name) + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + def get_queue_functions(self, threshold = None): """Get functions queue""" diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py new file mode 100644 index 0000000..6bc0ade --- /dev/null +++ b/appwrite/services/messaging.py @@ -0,0 +1,1000 @@ +from ..service import Service +from ..exception import AppwriteException + +class Messaging(Service): + + def __init__(self, client): + super(Messaging, self).__init__(client) + + def list_messages(self, queries = None, search = None): + """List messages""" + + + api_path = '/messaging/messages' + api_params = {} + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, status = None, html = None, scheduled_at = None): + """Create an email.""" + + + api_path = '/messaging/messages/email' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + if subject is None: + raise AppwriteException('Missing required parameter: "subject"') + + if content is None: + raise AppwriteException('Missing required parameter: "content"') + + + api_params['messageId'] = message_id + api_params['subject'] = subject + api_params['content'] = content + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['cc'] = cc + api_params['bcc'] = bcc + api_params['status'] = status + api_params['html'] = html + api_params['scheduledAt'] = scheduled_at + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, status = None, html = None, cc = None, bcc = None, scheduled_at = None): + """Update an email.""" + + + api_path = '/messaging/messages/email/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['subject'] = subject + api_params['content'] = content + api_params['status'] = status + api_params['html'] = html + api_params['cc'] = cc + api_params['bcc'] = bcc + api_params['scheduledAt'] = scheduled_at + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): + """Create a push notification.""" + + + api_path = '/messaging/messages/push' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + if title is None: + raise AppwriteException('Missing required parameter: "title"') + + if body is None: + raise AppwriteException('Missing required parameter: "body"') + + + api_params['messageId'] = message_id + api_params['title'] = title + api_params['body'] = body + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['data'] = data + api_params['action'] = action + api_params['icon'] = icon + api_params['sound'] = sound + api_params['color'] = color + api_params['tag'] = tag + api_params['badge'] = badge + api_params['status'] = status + api_params['scheduledAt'] = scheduled_at + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): + """Update a push notification.""" + + + api_path = '/messaging/messages/push/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['title'] = title + api_params['body'] = body + api_params['data'] = data + api_params['action'] = action + api_params['icon'] = icon + api_params['sound'] = sound + api_params['color'] = color + api_params['tag'] = tag + api_params['badge'] = badge + api_params['status'] = status + api_params['scheduledAt'] = scheduled_at + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_sms(self, message_id, content, topics = None, users = None, targets = None, status = None, scheduled_at = None): + """Create an SMS.""" + + + api_path = '/messaging/messages/sms' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + if content is None: + raise AppwriteException('Missing required parameter: "content"') + + + api_params['messageId'] = message_id + api_params['content'] = content + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['status'] = status + api_params['scheduledAt'] = scheduled_at + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, status = None, scheduled_at = None): + """Update an SMS.""" + + + api_path = '/messaging/messages/sms/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['topics'] = topics + api_params['users'] = users + api_params['targets'] = targets + api_params['content'] = content + api_params['status'] = status + api_params['scheduledAt'] = scheduled_at + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_message(self, message_id): + """Get a message""" + + + api_path = '/messaging/messages/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete(self, message_id): + """Delete a message""" + + + api_path = '/messaging/messages/{messageId}' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_message_logs(self, message_id, queries = None): + """List message logs""" + + + api_path = '/messaging/messages/{messageId}/logs' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_targets(self, message_id, queries = None): + """List message targets""" + + + api_path = '/messaging/messages/{messageId}/targets' + api_params = {} + if message_id is None: + raise AppwriteException('Missing required parameter: "message_id"') + + api_path = api_path.replace('{messageId}', message_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_providers(self, queries = None, search = None): + """List providers""" + + + api_path = '/messaging/providers' + api_params = {} + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, enabled = None): + """Create APNS provider""" + + + api_path = '/messaging/providers/apns' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['authKey'] = auth_key + api_params['authKeyId'] = auth_key_id + api_params['teamId'] = team_id + api_params['bundleId'] = bundle_id + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_apns_provider(self, provider_id, name = None, enabled = None, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None): + """Update APNS provider""" + + + api_path = '/messaging/providers/apns/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['authKey'] = auth_key + api_params['authKeyId'] = auth_key_id + api_params['teamId'] = team_id + api_params['bundleId'] = bundle_id + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_fcm_provider(self, provider_id, name, service_account_json = None, enabled = None): + """Create FCM provider""" + + + api_path = '/messaging/providers/fcm' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['serviceAccountJSON'] = service_account_json + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_fcm_provider(self, provider_id, name = None, enabled = None, service_account_json = None): + """Update FCM provider""" + + + api_path = '/messaging/providers/fcm/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['serviceAccountJSON'] = service_account_json + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_mailgun_provider(self, provider_id, name, api_key = None, domain = None, is_eu_region = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): + """Create Mailgun provider""" + + + api_path = '/messaging/providers/mailgun' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['apiKey'] = api_key + api_params['domain'] = domain + api_params['isEuRegion'] = is_eu_region + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_mailgun_provider(self, provider_id, name = None, api_key = None, domain = None, is_eu_region = None, enabled = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): + """Update Mailgun provider""" + + + api_path = '/messaging/providers/mailgun/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['apiKey'] = api_key + api_params['domain'] = domain + api_params['isEuRegion'] = is_eu_region + api_params['enabled'] = enabled + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_msg91_provider(self, provider_id, name, xfrom = None, sender_id = None, auth_key = None, enabled = None): + """Create Msg91 provider""" + + + api_path = '/messaging/providers/msg91' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['senderId'] = sender_id + api_params['authKey'] = auth_key + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_msg91_provider(self, provider_id, name = None, enabled = None, sender_id = None, auth_key = None, xfrom = None): + """Update Msg91 provider""" + + + api_path = '/messaging/providers/msg91/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['senderId'] = sender_id + api_params['authKey'] = auth_key + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): + """Create Sendgrid provider""" + + + api_path = '/messaging/providers/sendgrid' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['apiKey'] = api_key + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): + """Update Sendgrid provider""" + + + api_path = '/messaging/providers/sendgrid/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['apiKey'] = api_key + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_smtp_provider(self, provider_id, name, host, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): + """Create SMTP provider""" + + + api_path = '/messaging/providers/smtp' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + if host is None: + raise AppwriteException('Missing required parameter: "host"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['host'] = host + api_params['port'] = port + api_params['username'] = username + api_params['password'] = password + api_params['encryption'] = encryption + api_params['autoTLS'] = auto_tls + api_params['mailer'] = mailer + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_smtp_provider(self, provider_id, name = None, host = None, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): + """Update SMTP provider""" + + + api_path = '/messaging/providers/smtp/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['host'] = host + api_params['port'] = port + api_params['username'] = username + api_params['password'] = password + api_params['encryption'] = encryption + api_params['autoTLS'] = auto_tls + api_params['mailer'] = mailer + api_params['fromName'] = from_name + api_params['fromEmail'] = from_email + api_params['replyToName'] = reply_to_name + api_params['replyToEmail'] = reply_to_email + api_params['enabled'] = enabled + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_telesign_provider(self, provider_id, name, xfrom = None, customer_id = None, api_key = None, enabled = None): + """Create Telesign provider""" + + + api_path = '/messaging/providers/telesign' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['customerId'] = customer_id + api_params['apiKey'] = api_key + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_telesign_provider(self, provider_id, name = None, enabled = None, customer_id = None, api_key = None, xfrom = None): + """Update Telesign provider""" + + + api_path = '/messaging/providers/telesign/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['customerId'] = customer_id + api_params['apiKey'] = api_key + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_textmagic_provider(self, provider_id, name, xfrom = None, username = None, api_key = None, enabled = None): + """Create Textmagic provider""" + + + api_path = '/messaging/providers/textmagic' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['username'] = username + api_params['apiKey'] = api_key + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_textmagic_provider(self, provider_id, name = None, enabled = None, username = None, api_key = None, xfrom = None): + """Update Textmagic provider""" + + + api_path = '/messaging/providers/textmagic/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['username'] = username + api_params['apiKey'] = api_key + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = None, auth_token = None, enabled = None): + """Create Twilio provider""" + + + api_path = '/messaging/providers/twilio' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['accountSid'] = account_sid + api_params['authToken'] = auth_token + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_twilio_provider(self, provider_id, name = None, enabled = None, account_sid = None, auth_token = None, xfrom = None): + """Update Twilio provider""" + + + api_path = '/messaging/providers/twilio/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['accountSid'] = account_sid + api_params['authToken'] = auth_token + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None, api_secret = None, enabled = None): + """Create Vonage provider""" + + + api_path = '/messaging/providers/vonage' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['providerId'] = provider_id + api_params['name'] = name + api_params['from'] = xfrom + api_params['apiKey'] = api_key + api_params['apiSecret'] = api_secret + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_vonage_provider(self, provider_id, name = None, enabled = None, api_key = None, api_secret = None, xfrom = None): + """Update Vonage provider""" + + + api_path = '/messaging/providers/vonage/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['name'] = name + api_params['enabled'] = enabled + api_params['apiKey'] = api_key + api_params['apiSecret'] = api_secret + api_params['from'] = xfrom + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_provider(self, provider_id): + """Get provider""" + + + api_path = '/messaging/providers/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_provider(self, provider_id): + """Delete provider""" + + + api_path = '/messaging/providers/{providerId}' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_provider_logs(self, provider_id, queries = None): + """List provider logs""" + + + api_path = '/messaging/providers/{providerId}/logs' + api_params = {} + if provider_id is None: + raise AppwriteException('Missing required parameter: "provider_id"') + + api_path = api_path.replace('{providerId}', provider_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_subscriber_logs(self, subscriber_id, queries = None): + """List subscriber logs""" + + + api_path = '/messaging/subscribers/{subscriberId}/logs' + api_params = {} + if subscriber_id is None: + raise AppwriteException('Missing required parameter: "subscriber_id"') + + api_path = api_path.replace('{subscriberId}', subscriber_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_topics(self, queries = None, search = None): + """List topics.""" + + + api_path = '/messaging/topics' + api_params = {} + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_topic(self, topic_id, name, subscribe = None): + """Create a topic.""" + + + api_path = '/messaging/topics' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + + api_params['topicId'] = topic_id + api_params['name'] = name + api_params['subscribe'] = subscribe + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_topic(self, topic_id): + """Get a topic.""" + + + api_path = '/messaging/topics/{topicId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_topic(self, topic_id, name = None): + """Update a topic.""" + + + api_path = '/messaging/topics/{topicId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + api_params['name'] = name + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_topic(self, topic_id): + """Delete a topic.""" + + + api_path = '/messaging/topics/{topicId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_topic_logs(self, topic_id, queries = None): + """List topic logs""" + + + api_path = '/messaging/topics/{topicId}/logs' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_subscribers(self, topic_id, queries = None, search = None): + """List subscribers.""" + + + api_path = '/messaging/topics/{topicId}/subscribers' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_subscriber(self, topic_id, subscriber_id, target_id): + """Create a subscriber.""" + + + api_path = '/messaging/topics/{topicId}/subscribers' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + if subscriber_id is None: + raise AppwriteException('Missing required parameter: "subscriber_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + api_path = api_path.replace('{topicId}', topic_id) + + api_params['subscriberId'] = subscriber_id + api_params['targetId'] = target_id + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_subscriber(self, topic_id, subscriber_id): + """Get a subscriber.""" + + + api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + if subscriber_id is None: + raise AppwriteException('Missing required parameter: "subscriber_id"') + + api_path = api_path.replace('{topicId}', topic_id) + api_path = api_path.replace('{subscriberId}', subscriber_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_subscriber(self, topic_id, subscriber_id): + """Delete a subscriber.""" + + + api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' + api_params = {} + if topic_id is None: + raise AppwriteException('Missing required parameter: "topic_id"') + + if subscriber_id is None: + raise AppwriteException('Missing required parameter: "subscriber_id"') + + api_path = api_path.replace('{topicId}', topic_id) + api_path = api_path.replace('{subscriberId}', subscriber_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 2bcec8d..72ca1f9 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -105,7 +105,7 @@ def list_identities(self, queries = None, search = None): }, api_params) def delete_identity(self, identity_id): - """Delete Identity""" + """Delete identity""" api_path = '/users/identities/{identityId}' @@ -383,6 +383,66 @@ def list_memberships(self, user_id): 'content-type': 'application/json', }, api_params) + def update_mfa(self, user_id, mfa): + """Update MFA""" + + + api_path = '/users/{userId}/mfa' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if mfa is None: + raise AppwriteException('Missing required parameter: "mfa"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['mfa'] = mfa + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_factors(self, user_id): + """List Factors""" + + + api_path = '/users/{userId}/mfa/factors' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_authenticator(self, user_id, type, otp): + """Delete Authenticator""" + + + api_path = '/users/{userId}/mfa/{type}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{type}', type) + + api_params['otp'] = otp + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_name(self, user_id, name): """Update name""" @@ -495,6 +555,22 @@ def list_sessions(self, user_id): 'content-type': 'application/json', }, api_params) + def create_session(self, user_id): + """Create session""" + + + api_path = '/users/{userId}/sessions' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def delete_sessions(self, user_id): """Delete user sessions""" @@ -551,6 +627,134 @@ def update_status(self, user_id, status): 'content-type': 'application/json', }, api_params) + def list_targets(self, user_id, queries = None): + """List User Targets""" + + + api_path = '/users/{userId}/targets' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_target(self, user_id, target_id, provider_type, identifier, provider_id = None, name = None): + """Create User Target""" + + + api_path = '/users/{userId}/targets' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + if provider_type is None: + raise AppwriteException('Missing required parameter: "provider_type"') + + if identifier is None: + raise AppwriteException('Missing required parameter: "identifier"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['targetId'] = target_id + api_params['providerType'] = provider_type + api_params['identifier'] = identifier + api_params['providerId'] = provider_id + api_params['name'] = name + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_target(self, user_id, target_id): + """Get User Target""" + + + api_path = '/users/{userId}/targets/{targetId}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{targetId}', target_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_target(self, user_id, target_id, identifier = None, provider_id = None, name = None): + """Update User target""" + + + api_path = '/users/{userId}/targets/{targetId}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{targetId}', target_id) + + api_params['identifier'] = identifier + api_params['providerId'] = provider_id + api_params['name'] = name + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_target(self, user_id, target_id): + """Delete user target""" + + + api_path = '/users/{userId}/targets/{targetId}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if target_id is None: + raise AppwriteException('Missing required parameter: "target_id"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{targetId}', target_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_token(self, user_id, length = None, expire = None): + """Create token""" + + + api_path = '/users/{userId}/tokens' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['length'] = length + api_params['expire'] = expire + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_email_verification(self, user_id, email_verification): """Update email verification""" diff --git a/docs/examples/account/add-authenticator.md b/docs/examples/account/add-authenticator.md new file mode 100644 index 0000000..30e7d69 --- /dev/null +++ b/docs/examples/account/add-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.add_authenticator(.TOTP) diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md new file mode 100644 index 0000000..71282f6 --- /dev/null +++ b/docs/examples/account/create-anonymous-session.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_anonymous_session() diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md new file mode 100644 index 0000000..718159b --- /dev/null +++ b/docs/examples/account/create-email-password-session.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_email_password_session('email@example.com', 'password') diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md new file mode 100644 index 0000000..00db0b3 --- /dev/null +++ b/docs/examples/account/create-email-token.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_email_token('[USER_ID]', 'email@example.com') diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md new file mode 100644 index 0000000..0889609 --- /dev/null +++ b/docs/examples/account/create-j-w-t.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_jwt() diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md new file mode 100644 index 0000000..390e9cb --- /dev/null +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_magic_url_token('[USER_ID]', 'email@example.com') diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md new file mode 100644 index 0000000..fcdb570 --- /dev/null +++ b/docs/examples/account/create-o-auth2session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from Appwrite.enums import OAuthProvider + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_o_auth2_session(OAuthProvider.AMAZON) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md new file mode 100644 index 0000000..c661de3 --- /dev/null +++ b/docs/examples/account/create-phone-token.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_phone_token('[USER_ID]', '+12065550100') diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 2203cdb..c4f3f6b 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 21130fe..e3937d5 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md new file mode 100644 index 0000000..04d4ece --- /dev/null +++ b/docs/examples/account/create-session.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create_session('[USER_ID]', '[SECRET]') diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index c45d0d4..a9d7c27 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md new file mode 100644 index 0000000..7c4428d --- /dev/null +++ b/docs/examples/account/create.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create('[USER_ID]', 'email@example.com', '') diff --git a/docs/examples/account/create2f-a-challenge.md b/docs/examples/account/create2f-a-challenge.md new file mode 100644 index 0000000..5d71dc7 --- /dev/null +++ b/docs/examples/account/create2f-a-challenge.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from Appwrite.enums import + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.create2_fa_challenge(.TOTP) diff --git a/docs/examples/account/delete-authenticator.md b/docs/examples/account/delete-authenticator.md new file mode 100644 index 0000000..2a7ab08 --- /dev/null +++ b/docs/examples/account/delete-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.delete_authenticator(.TOTP, '[OTP]') diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index bac4334..02a80c3 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 8095cdc..ac945fe 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 1728d61..9057b73 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index da2fd76..0b79b60 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 25b8f03..dc1d0de 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index f75bad7..752a823 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/list-factors.md b/docs/examples/account/list-factors.md new file mode 100644 index 0000000..a5ec4a2 --- /dev/null +++ b/docs/examples/account/list-factors.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.list_factors() diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 3c166d1..f14e5b4 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 65802d8..da2d511 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 12d5c81..2bdd710 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-challenge.md b/docs/examples/account/update-challenge.md new file mode 100644 index 0000000..f262ea3 --- /dev/null +++ b/docs/examples/account/update-challenge.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.update_challenge('[CHALLENGE_ID]', '[OTP]') diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index f4a6776..8e2bc67 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md new file mode 100644 index 0000000..ccb6d77 --- /dev/null +++ b/docs/examples/account/update-m-f-a.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.update_mfa(False) diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md new file mode 100644 index 0000000..c75e94c --- /dev/null +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -0,0 +1,12 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID +) + +account = Account(client) + +result = account.update_magic_url_session('[USER_ID]', '[SECRET]') diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index eb1eb62..2aaa411 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 955ada6..365c733 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index f2a75b4..9d4fdbb 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index aaee1f7..7c1b218 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index e96546b..c554961 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index b4ea8aa..4f14fa1 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,14 +1,13 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) -result = account.update_recovery('[USER_ID]', '[SECRET]', 'password', 'password') +result = account.update_recovery('[USER_ID]', '[SECRET]', '') diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index e7234f7..aca93ba 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 5924d4d..e7be5fb 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 9a410a5..3ae98a1 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.account import Account client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) account = Account(client) diff --git a/docs/examples/account/verify-authenticator.md b/docs/examples/account/verify-authenticator.md new file mode 100644 index 0000000..9430eae --- /dev/null +++ b/docs/examples/account/verify-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_session('') # The user session to authenticate with +) + +account = Account(client) + +result = account.verify_authenticator(.TOTP, '[OTP]') diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 9ed56d1..0d2220f 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars +from Appwrite.enums import Browser client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) -result = avatars.get_browser('aa') +result = avatars.get_browser(Browser.AVANT_BROWSER) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 9fa6b0f..b2a9afd 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars +from Appwrite.enums import CreditCard client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) -result = avatars.get_credit_card('amex') +result = avatars.get_credit_card(CreditCard.AMERICAN_EXPRESS) diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 75b0315..f3c5aed 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 70d2e5f..6c2fbee 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars +from Appwrite.enums import Flag client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) -result = avatars.get_flag('af') +result = avatars.get_flag(Flag.AFGHANISTAN) diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 35015d9..9c33063 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 639fa03..098d791 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 27fc8e2..b6191bd 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.avatars import Avatars client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) avatars = Avatars(client) diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index f073d3d..e7b223f 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 183c55c..2d7c679 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 5c77689..c3039d1 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index aa95de9..f7b05e0 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 92cdcb2..8b25aaa 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index df66f12..b35f591 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 0bfe424..f4c1dd7 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 78a7d33..ba10266 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.services.databases import Databases +from Appwrite.enums import IndexType client = Client() @@ -11,4 +11,4 @@ client = Client() databases = Databases(client) -result = databases.create_index('[DATABASE_ID]', '[COLLECTION_ID]', '', 'key', []) +result = databases.create_index('[DATABASE_ID]', '[COLLECTION_ID]', '', IndexType.KEY, []) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index b3cce2b..d0619bd 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 967d284..d211390 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 4f69eca..9bfb6c3 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.services.databases import Databases +from Appwrite.enums import RelationshipType client = Client() @@ -11,4 +11,4 @@ client = Client() databases = Databases(client) -result = databases.create_relationship_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', 'oneToOne') +result = databases.create_relationship_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', RelationshipType.ONE_TO_ONE) diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 00bbbe9..820f06a 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index fd5b7f4..b6b5fb0 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index e4a8320..f2188b1 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 41871b2..95f8166 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 998bb61..dea504c 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 605b087..9c441a5 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index a53e06c..6aff595 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 780e145..bb9c307 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 0a61052..0c5a832 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 90f57a3..8bba64c 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 7085384..d89a040 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 3213c66..bc8852f 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 93a46b3..654f5d6 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 632202c..500a273 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index d0c98da..34c3c61 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 5eb03b2..014f54c 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index b4224be..c4685f5 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 3aa6839..41eb45a 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index e6a7d55..0c4c727 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 4a38aab..67c1a8b 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 5c79257..28bb030 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index c768c54..5496516 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) databases = Databases(client) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 8148b01..567f10e 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 65ef26f..626ccc8 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index efbf1ad..ba5e25c 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 61c74b8..dcf92be 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 7d5a35d..e58e944 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 7c426a6..c717550 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 2ee236e..22861aa 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 119c787..2924e5d 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index d46692e..a3a3f13 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.databases import Databases client = Client() diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index 76888f8..8b3a95b 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 1ee1be0..a62d341 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,6 +1,5 @@ from appwrite.client import Client from appwrite.input_file import InputFile -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 7c04522..709ca07 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) functions = Functions(client) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index f33ed08..8198694 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index bf66396..c05c56a 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.services.functions import Functions +from Appwrite.enums import client = Client() @@ -11,4 +11,4 @@ client = Client() functions = Functions(client) -result = functions.create('[FUNCTION_ID]', '[NAME]', 'node-18.0') +result = functions.create('[FUNCTION_ID]', '[NAME]', .NODE-18.0) diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 42d526e..f5ec491 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index cae0f2d..1ee6b16 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index e89213e..ac5aa7f 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/download-deployment.md index ee51f67..f86f56e 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/download-deployment.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 6257b59..e324251 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index f0e4f0d..f7c1f04 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) functions = Functions(client) diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 4e71bff..1bbce36 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 30e1d59..9ceed7b 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index d1797a1..51b89a6 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index d70f004..112d884 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) functions = Functions(client) diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 19b85e2..941f22e 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 9a72bba..1ae2f51 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index b8442e5..107dacf 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 87dd097..08abe08 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index ab5b43a..452dcc4 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 3960054..4dbbee5 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.functions import Functions client = Client() diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 24226a5..80cb9c7 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.graphql import Graphql client = Client() diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 8e1597c..cebf63c 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.graphql import Graphql client = Client() diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index fbfaf0e..0894ff7 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 40bc010..e0d4f6b 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md new file mode 100644 index 0000000..5221e18 --- /dev/null +++ b/docs/examples/health/get-certificate.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_certificate() diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 803dd73..7fe0bf2 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md new file mode 100644 index 0000000..be42733 --- /dev/null +++ b/docs/examples/health/get-failed-jobs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_failed_jobs(.V1-DATABASE) diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 43ada69..4c63e6a 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 3170559..09f2d81 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 4fb0266..6771209 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 4faff96..576dd5e 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index c84b9be..863fa58 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 92e4e20..c84460b 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index b798ad7..99ecad2 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index cc2c3bc..225d286 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 95200f3..df77f45 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 1c91663..de2f90d 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 8406de1..79e47bf 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 5a35588..81dbde6 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index bb2533e..1d3c016 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 9fe313d..89cec53 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index d3ff594..b4bc8e6 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.health import Health client = Client() diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 06b04f2..2e4f028 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 3dc6cf8..646d82e 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index ba9c94f..75b78d8 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index ea4c43c..af224a8 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 5a4cafe..0b451c2 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index f8ec83c..c0c9008 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 347e81c..8501744 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index ce50a6e..c70d837 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.locale import Locale client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) locale = Locale(client) diff --git a/docs/examples/messaging/create-a-p-n-s-provider.md b/docs/examples/messaging/create-a-p-n-s-provider.md new file mode 100644 index 0000000..ad05664 --- /dev/null +++ b/docs/examples/messaging/create-a-p-n-s-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_apns_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md new file mode 100644 index 0000000..72fc437 --- /dev/null +++ b/docs/examples/messaging/create-email.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_email('[MESSAGE_ID]', '[SUBJECT]', '[CONTENT]') diff --git a/docs/examples/messaging/create-f-c-m-provider.md b/docs/examples/messaging/create-f-c-m-provider.md new file mode 100644 index 0000000..b6b2a7b --- /dev/null +++ b/docs/examples/messaging/create-f-c-m-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_fcm_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000..84fc1d5 --- /dev/null +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_mailgun_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md new file mode 100644 index 0000000..5db7e0e --- /dev/null +++ b/docs/examples/messaging/create-msg91provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_msg91_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md new file mode 100644 index 0000000..550f58b --- /dev/null +++ b/docs/examples/messaging/create-push.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_push('[MESSAGE_ID]', '[TITLE]', '[BODY]') diff --git a/docs/examples/messaging/create-s-m-s.md b/docs/examples/messaging/create-s-m-s.md new file mode 100644 index 0000000..d2eb41a --- /dev/null +++ b/docs/examples/messaging/create-s-m-s.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_sms('[MESSAGE_ID]', '[CONTENT]') diff --git a/docs/examples/messaging/create-s-m-t-p-provider.md b/docs/examples/messaging/create-s-m-t-p-provider.md new file mode 100644 index 0000000..f7af468 --- /dev/null +++ b/docs/examples/messaging/create-s-m-t-p-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_smtp_provider('[PROVIDER_ID]', '[NAME]', '[HOST]') diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000..003a397 --- /dev/null +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_sendgrid_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md new file mode 100644 index 0000000..82e9976 --- /dev/null +++ b/docs/examples/messaging/create-subscriber.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token +) + +messaging = Messaging(client) + +result = messaging.create_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]', '[TARGET_ID]') diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000..4139ccf --- /dev/null +++ b/docs/examples/messaging/create-telesign-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_telesign_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000..5b0fcfc --- /dev/null +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_textmagic_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md new file mode 100644 index 0000000..9dd5ce8 --- /dev/null +++ b/docs/examples/messaging/create-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_topic('[TOPIC_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000..e984b06 --- /dev/null +++ b/docs/examples/messaging/create-twilio-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_twilio_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000..31115b7 --- /dev/null +++ b/docs/examples/messaging/create-vonage-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.create_vonage_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md new file mode 100644 index 0000000..894cb6f --- /dev/null +++ b/docs/examples/messaging/delete-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.delete_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000..04012a5 --- /dev/null +++ b/docs/examples/messaging/delete-subscriber.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token +) + +messaging = Messaging(client) + +result = messaging.delete_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md new file mode 100644 index 0000000..4e6b380 --- /dev/null +++ b/docs/examples/messaging/delete-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.delete_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md new file mode 100644 index 0000000..2839355 --- /dev/null +++ b/docs/examples/messaging/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.delete('[MESSAGE_ID]') diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md new file mode 100644 index 0000000..19587e9 --- /dev/null +++ b/docs/examples/messaging/get-message.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.get_message('[MESSAGE_ID]') diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md new file mode 100644 index 0000000..9e02e14 --- /dev/null +++ b/docs/examples/messaging/get-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.get_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md new file mode 100644 index 0000000..a170f60 --- /dev/null +++ b/docs/examples/messaging/get-subscriber.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.get_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md new file mode 100644 index 0000000..ade0291 --- /dev/null +++ b/docs/examples/messaging/get-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.get_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md new file mode 100644 index 0000000..b77c8d9 --- /dev/null +++ b/docs/examples/messaging/list-message-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_message_logs('[MESSAGE_ID]') diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md new file mode 100644 index 0000000..eb8bdf6 --- /dev/null +++ b/docs/examples/messaging/list-messages.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_messages() diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000..c9ee22c --- /dev/null +++ b/docs/examples/messaging/list-provider-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_provider_logs('[PROVIDER_ID]') diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md new file mode 100644 index 0000000..5bb1223 --- /dev/null +++ b/docs/examples/messaging/list-providers.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_providers() diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000..56a5544 --- /dev/null +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_subscriber_logs('[SUBSCRIBER_ID]') diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md new file mode 100644 index 0000000..85f5972 --- /dev/null +++ b/docs/examples/messaging/list-subscribers.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_subscribers('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md new file mode 100644 index 0000000..1463533 --- /dev/null +++ b/docs/examples/messaging/list-targets.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_targets('[MESSAGE_ID]') diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000..0eaac28 --- /dev/null +++ b/docs/examples/messaging/list-topic-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_topic_logs('[TOPIC_ID]') diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md new file mode 100644 index 0000000..4f6265f --- /dev/null +++ b/docs/examples/messaging/list-topics.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.list_topics() diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-a-p-n-s-provider.md new file mode 100644 index 0000000..74a3ade --- /dev/null +++ b/docs/examples/messaging/update-a-p-n-s-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_apns_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md new file mode 100644 index 0000000..a737e24 --- /dev/null +++ b/docs/examples/messaging/update-email.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_email('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-f-c-m-provider.md new file mode 100644 index 0000000..106d8af --- /dev/null +++ b/docs/examples/messaging/update-f-c-m-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_fcm_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000..995df6c --- /dev/null +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_mailgun_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md new file mode 100644 index 0000000..4504915 --- /dev/null +++ b/docs/examples/messaging/update-msg91provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_msg91_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md new file mode 100644 index 0000000..5b9a5d5 --- /dev/null +++ b/docs/examples/messaging/update-push.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_push('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-s-m-s.md b/docs/examples/messaging/update-s-m-s.md new file mode 100644 index 0000000..bb8039a --- /dev/null +++ b/docs/examples/messaging/update-s-m-s.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_sms('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-s-m-t-p-provider.md b/docs/examples/messaging/update-s-m-t-p-provider.md new file mode 100644 index 0000000..7faad9e --- /dev/null +++ b/docs/examples/messaging/update-s-m-t-p-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_smtp_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000..d5fafdc --- /dev/null +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_sendgrid_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000..59a1411 --- /dev/null +++ b/docs/examples/messaging/update-telesign-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_telesign_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000..70a0337 --- /dev/null +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_textmagic_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md new file mode 100644 index 0000000..61adea6 --- /dev/null +++ b/docs/examples/messaging/update-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_topic('[TOPIC_ID]') diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000..5091170 --- /dev/null +++ b/docs/examples/messaging/update-twilio-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_twilio_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000..7cd819c --- /dev/null +++ b/docs/examples/messaging/update-vonage-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +messaging = Messaging(client) + +result = messaging.update_vonage_provider('[PROVIDER_ID]') diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 72ffdcc..1fb104d 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index b469b5b..643dc93 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,13 +1,12 @@ from appwrite.client import Client from appwrite.input_file import InputFile -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 60dc107..3741e9d 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 9bed0af..6fc33f8 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 7ea64f2..b4ef599 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index e9f5cce..39e67c5 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 4e12291..e926f15 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 01cbfaf..7036f40 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index f83ed8a..e8b7af6 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 204fd95..8b5eaa7 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 63101e2..f3a6c12 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index fb1b76b..9cf6f02 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 24a92e3..a504371 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.storage import Storage client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) storage = Storage(client) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index cde8455..0d58c58 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index c690123..b524915 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index f8d8759..37af7f2 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 4fc0fa4..e1afd82 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index e9c62ae..85a15a3 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 40909fa..4603fb9 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index fdca2fc..e2284d5 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 63e662a..30e3945 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index e60cb60..edb3575 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index a6cd4cd..8fee274 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 816c6ad..e68ba08 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 929f4ec..4458bfb 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 4176c62..3579d2c 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,12 +1,11 @@ from appwrite.client import Client -from appwrite.services.teams import Teams client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_session('') # The user session to authenticate with ) teams = Teams(client) diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index be1e8ce..c0eebc7 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 77c9918..8f1e3af 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index f3ab3f8..b01a5b0 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index e715f47..efaab20 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index 2a2db5a..7e784a4 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 0b42e98..4b3fdf4 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index b445623..cff12d7 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md new file mode 100644 index 0000000..44129de --- /dev/null +++ b/docs/examples/users/create-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.create_session('[USER_ID]') diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md new file mode 100644 index 0000000..1aea0c2 --- /dev/null +++ b/docs/examples/users/create-target.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import MessagingProviderType + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.create_target('[USER_ID]', '[TARGET_ID]', MessagingProviderType.EMAIL, '[IDENTIFIER]') diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md new file mode 100644 index 0000000..78bec21 --- /dev/null +++ b/docs/examples/users/create-token.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.create_token('[USER_ID]') diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 05249c0..ff4c92a 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md new file mode 100644 index 0000000..18b6a11 --- /dev/null +++ b/docs/examples/users/delete-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from Appwrite.enums import + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.delete_authenticator('[USER_ID]', .TOTP, '[OTP]') diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index d103824..5420468 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 26b041d..45f0c8d 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index dabe4f6..8e6e285 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md new file mode 100644 index 0000000..7d010e9 --- /dev/null +++ b/docs/examples/users/delete-target.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.delete_target('[USER_ID]', '[TARGET_ID]') diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 7fdc775..d09204f 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 2bbaa88..79a7100 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md new file mode 100644 index 0000000..1a77982 --- /dev/null +++ b/docs/examples/users/get-target.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.get_target('[USER_ID]', '[TARGET_ID]') diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 463957d..b74dcf5 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-factors.md b/docs/examples/users/list-factors.md new file mode 100644 index 0000000..f22e879 --- /dev/null +++ b/docs/examples/users/list-factors.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.list_factors('[USER_ID]') diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 0addd3e..279e9ce 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index ca3a5eb..0db92fc 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 0dfb97a..52abcb5 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 5f8fbd6..24a7103 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md new file mode 100644 index 0000000..08f6fd2 --- /dev/null +++ b/docs/examples/users/list-targets.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.list_targets('[USER_ID]') diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index baaf42c..a5536b4 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 8be33ad..8582aa7 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 4899bd3..6d962e3 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index b2d4c2d..12e4b94 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md new file mode 100644 index 0000000..0882458 --- /dev/null +++ b/docs/examples/users/update-mfa.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.update_mfa('[USER_ID]', False) diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 66bb6b2..bff47a9 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index e79f125..71b6c86 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index e42317c..5565ee3 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 6df39fc..aabc4da 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 53d1e52..00309a9 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 6d1577d..fcd9b94 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,5 +1,4 @@ from appwrite.client import Client -from appwrite.services.users import Users client = Client() diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md new file mode 100644 index 0000000..be8f764 --- /dev/null +++ b/docs/examples/users/update-target.md @@ -0,0 +1,13 @@ +from appwrite.client import Client + +client = Client() + +(client + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.update_target('[USER_ID]', '[TARGET_ID]') diff --git a/setup.py b/setup.py index 49f3672..f8962ce 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '4.1.0', + version = '5.0.0-rc.2', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/4.1.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.2.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From 987cc342e1992dbeb1d96e055b20d678aa0860b1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 19 Feb 2024 17:04:37 +1300 Subject: [PATCH 07/60] Release candidate for 1.5.x --- appwrite/client.py | 6 +++--- appwrite/encoders/value_class_encoder.py | 8 ++++---- appwrite/enums/{factor.py => authentication_factor.py} | 2 +- appwrite/enums/{type.py => authenticator_type.py} | 2 +- docs/examples/account/add-authenticator.md | 4 ++-- docs/examples/account/create2f-a-challenge.md | 4 ++-- docs/examples/account/delete-authenticator.md | 4 ++-- docs/examples/account/verify-authenticator.md | 4 ++-- docs/examples/users/delete-authenticator.md | 4 ++-- setup.py | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) rename appwrite/enums/{factor.py => authentication_factor.py} (70%) rename appwrite/enums/{type.py => authenticator_type.py} (56%) diff --git a/appwrite/client.py b/appwrite/client.py index 8b0eb1e..167eca9 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,12 +13,12 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.2 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.3 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.0-rc.2', - 'X-Appwrite-Response-Format' : '1.4.0', + 'x-sdk-version': '5.0.0-rc.3', + 'X-Appwrite-Response-Format' : '1.5.0', } def set_self_signed(self, status=True): diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py index 3bb85d6..98a306a 100644 --- a/appwrite/encoders/value_class_encoder.py +++ b/appwrite/encoders/value_class_encoder.py @@ -1,6 +1,6 @@ import json -from ..enums.factor import Factor -from ..enums.type import Type +from ..enums.authentication_factor import AuthenticationFactor +from ..enums.authenticator_type import AuthenticatorType from ..enums.o_auth_provider import OAuthProvider from ..enums.browser import Browser from ..enums.credit_card import CreditCard @@ -21,10 +21,10 @@ class ValueClassEncoder(json.JSONEncoder): def default(self, o): - if isinstance(o, Factor): + if isinstance(o, AuthenticationFactor): return o.value - if isinstance(o, Type): + if isinstance(o, AuthenticatorType): return o.value if isinstance(o, OAuthProvider): diff --git a/appwrite/enums/factor.py b/appwrite/enums/authentication_factor.py similarity index 70% rename from appwrite/enums/factor.py rename to appwrite/enums/authentication_factor.py index 90e4ce3..8da9da9 100644 --- a/appwrite/enums/factor.py +++ b/appwrite/enums/authentication_factor.py @@ -1,6 +1,6 @@ from enum import Enum -class Factor(Enum): +class AuthenticationFactor(Enum): TOTP = "totp" PHONE = "phone" EMAIL = "email" diff --git a/appwrite/enums/type.py b/appwrite/enums/authenticator_type.py similarity index 56% rename from appwrite/enums/type.py rename to appwrite/enums/authenticator_type.py index 62e58cf..ee9f94a 100644 --- a/appwrite/enums/type.py +++ b/appwrite/enums/authenticator_type.py @@ -1,4 +1,4 @@ from enum import Enum -class Type(Enum): +class AuthenticatorType(Enum): TOTP = "totp" diff --git a/docs/examples/account/add-authenticator.md b/docs/examples/account/add-authenticator.md index 30e7d69..e8c249d 100644 --- a/docs/examples/account/add-authenticator.md +++ b/docs/examples/account/add-authenticator.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from Appwrite.enums import +from Appwrite.enums import AuthenticatorType client = Client() @@ -11,4 +11,4 @@ client = Client() account = Account(client) -result = account.add_authenticator(.TOTP) +result = account.add_authenticator(AuthenticatorType.TOTP) diff --git a/docs/examples/account/create2f-a-challenge.md b/docs/examples/account/create2f-a-challenge.md index 5d71dc7..b69fdb8 100644 --- a/docs/examples/account/create2f-a-challenge.md +++ b/docs/examples/account/create2f-a-challenge.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from Appwrite.enums import +from Appwrite.enums import AuthenticationFactor client = Client() @@ -10,4 +10,4 @@ client = Client() account = Account(client) -result = account.create2_fa_challenge(.TOTP) +result = account.create2_fa_challenge(AuthenticationFactor.TOTP) diff --git a/docs/examples/account/delete-authenticator.md b/docs/examples/account/delete-authenticator.md index 2a7ab08..c87087b 100644 --- a/docs/examples/account/delete-authenticator.md +++ b/docs/examples/account/delete-authenticator.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from Appwrite.enums import +from Appwrite.enums import AuthenticatorType client = Client() @@ -11,4 +11,4 @@ client = Client() account = Account(client) -result = account.delete_authenticator(.TOTP, '[OTP]') +result = account.delete_authenticator(AuthenticatorType.TOTP, '[OTP]') diff --git a/docs/examples/account/verify-authenticator.md b/docs/examples/account/verify-authenticator.md index 9430eae..8cd2553 100644 --- a/docs/examples/account/verify-authenticator.md +++ b/docs/examples/account/verify-authenticator.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from Appwrite.enums import +from Appwrite.enums import AuthenticatorType client = Client() @@ -11,4 +11,4 @@ client = Client() account = Account(client) -result = account.verify_authenticator(.TOTP, '[OTP]') +result = account.verify_authenticator(AuthenticatorType.TOTP, '[OTP]') diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md index 18b6a11..7e09393 100644 --- a/docs/examples/users/delete-authenticator.md +++ b/docs/examples/users/delete-authenticator.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from Appwrite.enums import +from Appwrite.enums import AuthenticatorType client = Client() @@ -11,4 +11,4 @@ client = Client() users = Users(client) -result = users.delete_authenticator('[USER_ID]', .TOTP, '[OTP]') +result = users.delete_authenticator('[USER_ID]', AuthenticatorType.TOTP, '[OTP]') diff --git a/setup.py b/setup.py index f8962ce..c166efb 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '5.0.0-rc.2', + version = '5.0.0-rc.3', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.2.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.3.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From 889402ad7fc42e52753188e6038693dc5cdaf083 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 21 Feb 2024 23:37:17 +1300 Subject: [PATCH 08/60] Release candidate 4 for 1.5.x --- README.md | 2 +- appwrite/client.py | 4 +- appwrite/encoders/value_class_encoder.py | 4 +- .../{smtp_encryption.py => encryption.py} | 2 +- appwrite/enums/runtime.py | 32 +++++++++++++++ appwrite/services/messaging.py | 39 ++++++++++--------- docs/examples/account/add-authenticator.md | 15 ++++--- .../account/create-anonymous-session.md | 7 +--- .../account/create-email-password-session.md | 12 +++--- docs/examples/account/create-email-token.md | 13 ++++--- docs/examples/account/create-j-w-t.md | 7 +--- .../account/create-magic-u-r-l-token.md | 14 ++++--- .../examples/account/create-o-auth2session.md | 17 ++++---- docs/examples/account/create-phone-token.md | 12 +++--- .../account/create-phone-verification.md | 9 ++--- docs/examples/account/create-recovery.md | 14 +++---- docs/examples/account/create-session.md | 12 +++--- docs/examples/account/create-verification.md | 13 +++---- docs/examples/account/create.md | 14 ++++--- docs/examples/account/create2f-a-challenge.md | 13 +++---- docs/examples/account/delete-authenticator.md | 16 ++++---- docs/examples/account/delete-identity.md | 13 +++---- docs/examples/account/delete-session.md | 13 +++---- docs/examples/account/delete-sessions.md | 9 ++--- docs/examples/account/get-prefs.md | 9 ++--- docs/examples/account/get-session.md | 13 +++---- docs/examples/account/get.md | 9 ++--- docs/examples/account/list-factors.md | 9 ++--- docs/examples/account/list-identities.md | 13 +++---- docs/examples/account/list-logs.md | 13 +++---- docs/examples/account/list-sessions.md | 9 ++--- docs/examples/account/update-challenge.md | 14 +++---- docs/examples/account/update-email.md | 14 +++---- docs/examples/account/update-m-f-a.md | 13 +++---- .../account/update-magic-u-r-l-session.md | 12 +++--- docs/examples/account/update-name.md | 13 +++---- docs/examples/account/update-password.md | 14 +++---- .../account/update-phone-verification.md | 14 +++---- docs/examples/account/update-phone.md | 14 +++---- docs/examples/account/update-prefs.md | 13 +++---- docs/examples/account/update-recovery.md | 15 +++---- docs/examples/account/update-session.md | 13 +++---- docs/examples/account/update-status.md | 9 ++--- docs/examples/account/update-verification.md | 14 +++---- docs/examples/account/verify-authenticator.md | 16 ++++---- docs/examples/avatars/get-browser.md | 18 +++++---- docs/examples/avatars/get-credit-card.md | 18 +++++---- docs/examples/avatars/get-favicon.md | 13 +++---- docs/examples/avatars/get-flag.md | 18 +++++---- docs/examples/avatars/get-image.md | 15 +++---- docs/examples/avatars/get-initials.md | 16 ++++---- docs/examples/avatars/get-q-r.md | 16 ++++---- .../databases/create-boolean-attribute.md | 18 +++++---- docs/examples/databases/create-collection.md | 18 +++++---- .../databases/create-datetime-attribute.md | 18 +++++---- docs/examples/databases/create-document.md | 17 ++++---- .../databases/create-email-attribute.md | 18 +++++---- .../databases/create-enum-attribute.md | 19 +++++---- .../databases/create-float-attribute.md | 20 ++++++---- docs/examples/databases/create-index.md | 20 ++++++---- .../databases/create-integer-attribute.md | 20 ++++++---- .../examples/databases/create-ip-attribute.md | 18 +++++---- .../create-relationship-attribute.md | 22 +++++++---- .../databases/create-string-attribute.md | 20 ++++++---- .../databases/create-url-attribute.md | 18 +++++---- docs/examples/databases/create.md | 15 +++---- docs/examples/databases/delete-attribute.md | 15 +++---- docs/examples/databases/delete-collection.md | 14 +++---- docs/examples/databases/delete-document.md | 15 +++---- docs/examples/databases/delete-index.md | 15 +++---- docs/examples/databases/delete.md | 13 +++---- docs/examples/databases/get-attribute.md | 15 +++---- docs/examples/databases/get-collection.md | 14 +++---- docs/examples/databases/get-document.md | 16 ++++---- docs/examples/databases/get-index.md | 15 +++---- docs/examples/databases/get.md | 13 +++---- docs/examples/databases/list-attributes.md | 15 +++---- docs/examples/databases/list-collections.md | 15 +++---- docs/examples/databases/list-documents.md | 15 +++---- docs/examples/databases/list-indexes.md | 15 +++---- docs/examples/databases/list.md | 14 +++---- .../databases/update-boolean-attribute.md | 17 ++++---- docs/examples/databases/update-collection.md | 18 +++++---- .../databases/update-datetime-attribute.md | 17 ++++---- docs/examples/databases/update-document.md | 17 ++++---- .../databases/update-email-attribute.md | 17 ++++---- .../databases/update-enum-attribute.md | 18 +++++---- .../databases/update-float-attribute.md | 19 +++++---- .../databases/update-integer-attribute.md | 19 +++++---- .../examples/databases/update-ip-attribute.md | 17 ++++---- .../update-relationship-attribute.md | 16 ++++---- .../databases/update-string-attribute.md | 17 ++++---- .../databases/update-url-attribute.md | 17 ++++---- docs/examples/databases/update.md | 15 +++---- docs/examples/functions/create-build.md | 15 +++---- docs/examples/functions/create-deployment.md | 17 ++++---- docs/examples/functions/create-execution.md | 18 +++++---- docs/examples/functions/create-variable.md | 15 +++---- docs/examples/functions/create.md | 34 ++++++++++++---- docs/examples/functions/delete-deployment.md | 14 +++---- docs/examples/functions/delete-variable.md | 14 +++---- docs/examples/functions/delete.md | 13 +++---- .../examples/functions/download-deployment.md | 14 +++---- docs/examples/functions/get-deployment.md | 14 +++---- docs/examples/functions/get-execution.md | 14 +++---- docs/examples/functions/get-variable.md | 14 +++---- docs/examples/functions/get.md | 13 +++---- docs/examples/functions/list-deployments.md | 15 +++---- docs/examples/functions/list-executions.md | 15 +++---- docs/examples/functions/list-runtimes.md | 9 ++--- docs/examples/functions/list-variables.md | 13 +++---- docs/examples/functions/list.md | 14 +++---- docs/examples/functions/update-deployment.md | 14 +++---- docs/examples/functions/update-variable.md | 16 ++++---- docs/examples/functions/update.md | 28 +++++++++---- docs/examples/graphql/mutation.md | 13 +++---- docs/examples/graphql/query.md | 13 +++---- docs/examples/health/get-antivirus.md | 9 ++--- docs/examples/health/get-cache.md | 9 ++--- docs/examples/health/get-certificate.md | 13 +++---- docs/examples/health/get-d-b.md | 9 ++--- docs/examples/health/get-failed-jobs.md | 16 ++++---- docs/examples/health/get-pub-sub.md | 9 ++--- docs/examples/health/get-queue-builds.md | 13 +++---- .../examples/health/get-queue-certificates.md | 13 +++---- docs/examples/health/get-queue-databases.md | 14 +++---- docs/examples/health/get-queue-deletes.md | 13 +++---- docs/examples/health/get-queue-functions.md | 13 +++---- docs/examples/health/get-queue-logs.md | 13 +++---- docs/examples/health/get-queue-mails.md | 13 +++---- docs/examples/health/get-queue-messaging.md | 13 +++---- docs/examples/health/get-queue-migrations.md | 13 +++---- docs/examples/health/get-queue-webhooks.md | 13 +++---- docs/examples/health/get-queue.md | 9 ++--- docs/examples/health/get-storage-local.md | 9 ++--- docs/examples/health/get-time.md | 9 ++--- docs/examples/health/get.md | 9 ++--- docs/examples/locale/get.md | 9 ++--- docs/examples/locale/list-codes.md | 9 ++--- docs/examples/locale/list-continents.md | 9 ++--- docs/examples/locale/list-countries-e-u.md | 9 ++--- docs/examples/locale/list-countries-phones.md | 9 ++--- docs/examples/locale/list-countries.md | 9 ++--- docs/examples/locale/list-currencies.md | 9 ++--- docs/examples/locale/list-languages.md | 9 ++--- .../messaging/create-a-p-n-s-provider.md | 13 ------- .../messaging/create-apns-provider.md | 18 +++++++++ docs/examples/messaging/create-email.md | 24 ++++++++---- .../messaging/create-f-c-m-provider.md | 13 ------- .../examples/messaging/create-fcm-provider.md | 15 +++++++ .../messaging/create-mailgun-provider.md | 22 +++++++---- .../messaging/create-msg91provider.md | 18 +++++---- docs/examples/messaging/create-push.md | 28 +++++++++---- docs/examples/messaging/create-s-m-s.md | 13 ------- .../messaging/create-s-m-t-p-provider.md | 13 ------- .../messaging/create-sendgrid-provider.md | 20 ++++++---- docs/examples/messaging/create-sms.md | 18 +++++++++ .../messaging/create-smtp-provider.md | 25 ++++++++++++ docs/examples/messaging/create-subscriber.md | 15 +++---- .../messaging/create-telesign-provider.md | 18 +++++---- .../messaging/create-textmagic-provider.md | 18 +++++---- docs/examples/messaging/create-topic.md | 15 +++---- .../messaging/create-twilio-provider.md | 18 +++++---- .../messaging/create-vonage-provider.md | 18 +++++---- docs/examples/messaging/delete-provider.md | 13 +++---- docs/examples/messaging/delete-subscriber.md | 14 +++---- docs/examples/messaging/delete-topic.md | 13 +++---- docs/examples/messaging/delete.md | 13 +++---- docs/examples/messaging/get-message.md | 13 +++---- docs/examples/messaging/get-provider.md | 13 +++---- docs/examples/messaging/get-subscriber.md | 14 +++---- docs/examples/messaging/get-topic.md | 13 +++---- docs/examples/messaging/list-message-logs.md | 14 +++---- docs/examples/messaging/list-messages.md | 14 +++---- docs/examples/messaging/list-provider-logs.md | 14 +++---- docs/examples/messaging/list-providers.md | 14 +++---- .../messaging/list-subscriber-logs.md | 14 +++---- docs/examples/messaging/list-subscribers.md | 15 +++---- docs/examples/messaging/list-targets.md | 14 +++---- docs/examples/messaging/list-topic-logs.md | 14 +++---- docs/examples/messaging/list-topics.md | 14 +++---- .../messaging/update-a-p-n-s-provider.md | 19 +++++---- docs/examples/messaging/update-email.md | 23 +++++++---- .../messaging/update-f-c-m-provider.md | 16 ++++---- .../messaging/update-mailgun-provider.md | 22 +++++++---- .../messaging/update-msg91provider.md | 18 +++++---- docs/examples/messaging/update-push.md | 28 +++++++++---- docs/examples/messaging/update-s-m-s.md | 13 ------- .../messaging/update-s-m-t-p-provider.md | 13 ------- .../messaging/update-sendgrid-provider.md | 20 ++++++---- docs/examples/messaging/update-sms.md | 18 +++++++++ .../messaging/update-smtp-provider.md | 25 ++++++++++++ .../messaging/update-telesign-provider.md | 18 +++++---- .../messaging/update-textmagic-provider.md | 18 +++++---- docs/examples/messaging/update-topic.md | 14 +++---- .../messaging/update-twilio-provider.md | 18 +++++---- .../messaging/update-vonage-provider.md | 18 +++++---- docs/examples/storage/create-bucket.md | 22 +++++++---- docs/examples/storage/create-file.md | 16 ++++---- docs/examples/storage/delete-bucket.md | 13 +++---- docs/examples/storage/delete-file.md | 14 +++---- docs/examples/storage/get-bucket.md | 13 +++---- docs/examples/storage/get-file-download.md | 14 +++---- docs/examples/storage/get-file-preview.md | 25 ++++++++---- docs/examples/storage/get-file-view.md | 14 +++---- docs/examples/storage/get-file.md | 14 +++---- docs/examples/storage/list-buckets.md | 14 +++---- docs/examples/storage/list-files.md | 15 +++---- docs/examples/storage/update-bucket.md | 22 +++++++---- docs/examples/storage/update-file.md | 16 ++++---- docs/examples/teams/create-membership.md | 19 +++++---- docs/examples/teams/create.md | 15 +++---- docs/examples/teams/delete-membership.md | 14 +++---- docs/examples/teams/delete.md | 13 +++---- docs/examples/teams/get-membership.md | 14 +++---- docs/examples/teams/get-prefs.md | 13 +++---- docs/examples/teams/get.md | 13 +++---- docs/examples/teams/list-memberships.md | 15 +++---- docs/examples/teams/list.md | 14 +++---- .../teams/update-membership-status.md | 16 ++++---- docs/examples/teams/update-membership.md | 15 +++---- docs/examples/teams/update-name.md | 14 +++---- docs/examples/teams/update-prefs.md | 14 +++---- docs/examples/users/create-argon2user.md | 16 ++++---- docs/examples/users/create-bcrypt-user.md | 16 ++++---- docs/examples/users/create-m-d5user.md | 16 ++++---- docs/examples/users/create-p-h-pass-user.md | 16 ++++---- docs/examples/users/create-s-h-a-user.md | 17 ++++---- .../users/create-scrypt-modified-user.md | 19 +++++---- docs/examples/users/create-scrypt-user.md | 21 ++++++---- docs/examples/users/create-session.md | 13 +++---- docs/examples/users/create-target.md | 20 ++++++---- docs/examples/users/create-token.md | 15 +++---- docs/examples/users/create.md | 17 ++++---- docs/examples/users/delete-authenticator.md | 17 ++++---- docs/examples/users/delete-identity.md | 13 +++---- docs/examples/users/delete-session.md | 14 +++---- docs/examples/users/delete-sessions.md | 13 +++---- docs/examples/users/delete-target.md | 14 +++---- docs/examples/users/delete.md | 13 +++---- docs/examples/users/get-prefs.md | 13 +++---- docs/examples/users/get-target.md | 14 +++---- docs/examples/users/get.md | 13 +++---- docs/examples/users/list-factors.md | 13 +++---- docs/examples/users/list-identities.md | 14 +++---- docs/examples/users/list-logs.md | 14 +++---- docs/examples/users/list-memberships.md | 13 +++---- docs/examples/users/list-sessions.md | 13 +++---- docs/examples/users/list-targets.md | 14 +++---- docs/examples/users/list.md | 14 +++---- .../users/update-email-verification.md | 14 +++---- docs/examples/users/update-email.md | 14 +++---- docs/examples/users/update-labels.md | 14 +++---- docs/examples/users/update-mfa.md | 14 +++---- docs/examples/users/update-name.md | 14 +++---- docs/examples/users/update-password.md | 14 +++---- .../users/update-phone-verification.md | 14 +++---- docs/examples/users/update-phone.md | 14 +++---- docs/examples/users/update-prefs.md | 14 +++---- docs/examples/users/update-status.md | 14 +++---- docs/examples/users/update-target.md | 17 ++++---- setup.py | 4 +- 262 files changed, 2111 insertions(+), 1782 deletions(-) rename appwrite/enums/{smtp_encryption.py => encryption.py} (72%) delete mode 100644 docs/examples/messaging/create-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/create-apns-provider.md delete mode 100644 docs/examples/messaging/create-f-c-m-provider.md create mode 100644 docs/examples/messaging/create-fcm-provider.md delete mode 100644 docs/examples/messaging/create-s-m-s.md delete mode 100644 docs/examples/messaging/create-s-m-t-p-provider.md create mode 100644 docs/examples/messaging/create-sms.md create mode 100644 docs/examples/messaging/create-smtp-provider.md delete mode 100644 docs/examples/messaging/update-s-m-s.md delete mode 100644 docs/examples/messaging/update-s-m-t-p-provider.md create mode 100644 docs/examples/messaging/update-sms.md create mode 100644 docs/examples/messaging/update-smtp-provider.md diff --git a/README.md b/README.md index 9f444c6..fdaf33e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.4.13-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.5.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index 167eca9..e4a5aae 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.3 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.4 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.0-rc.3', + 'x-sdk-version': '5.0.0-rc.4', 'X-Appwrite-Response-Format' : '1.5.0', } diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py index 98a306a..88c7451 100644 --- a/appwrite/encoders/value_class_encoder.py +++ b/appwrite/encoders/value_class_encoder.py @@ -12,7 +12,7 @@ from ..enums.execution_method import ExecutionMethod from ..enums.name import Name from ..enums.message_status import MessageStatus -from ..enums.smtp_encryption import SMTPEncryption +from ..enums.encryption import Encryption from ..enums.compression import Compression from ..enums.image_gravity import ImageGravity from ..enums.image_format import ImageFormat @@ -60,7 +60,7 @@ def default(self, o): if isinstance(o, MessageStatus): return o.value - if isinstance(o, SMTPEncryption): + if isinstance(o, Encryption): return o.value if isinstance(o, Compression): diff --git a/appwrite/enums/smtp_encryption.py b/appwrite/enums/encryption.py similarity index 72% rename from appwrite/enums/smtp_encryption.py rename to appwrite/enums/encryption.py index 405fc60..4850cc1 100644 --- a/appwrite/enums/smtp_encryption.py +++ b/appwrite/enums/encryption.py @@ -1,6 +1,6 @@ from enum import Enum -class SMTPEncryption(Enum): +class Encryption(Enum): NONE = "none" SSL = "ssl" TLS = "tls" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index cca0f68..2ab9ffc 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -1,7 +1,39 @@ from enum import Enum class Runtime(Enum): + NODE145 = "node-14.5" + NODE160 = "node-16.0" NODE180 = "node-18.0" + NODE190 = "node-19.0" + NODE200 = "node-20.0" PHP80 = "php-8.0" + PHP81 = "php-8.1" + PHP82 = "php-8.2" + RUBY30 = "ruby-3.0" RUBY31 = "ruby-3.1" + RUBY32 = "ruby-3.2" + PYTHON38 = "python-3.8" PYTHON39 = "python-3.9" + PYTHON310 = "python-3.10" + PYTHON311 = "python-3.11" + PYTHON312 = "python-3.12" + DART215 = "dart-2.15" + DART216 = "dart-2.16" + DART217 = "dart-2.17" + DART218 = "dart-2.18" + DART30 = "dart-3.0" + DART31 = "dart-3.1" + DOTNET31 = "dotnet-3.1" + DOTNET60 = "dotnet-6.0" + DOTNET70 = "dotnet-7.0" + JAVA80 = "java-8.0" + JAVA110 = "java-11.0" + JAVA170 = "java-17.0" + JAVA180 = "java-18.0" + SWIFT55 = "swift-5.5" + SWIFT58 = "swift-5.8" + KOTLIN16 = "kotlin-1.6" + KOTLIN18 = "kotlin-1.8" + CPP17 = "cpp-17" + CPP20 = "cpp-20" + BUN10 = "bun-1.0" diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 6bc0ade..58379b4 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -20,8 +20,8 @@ def list_messages(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, status = None, html = None, scheduled_at = None): - """Create an email.""" + def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, attachments = None, status = None, html = None, scheduled_at = None): + """Create an email""" api_path = '/messaging/messages/email' @@ -44,6 +44,7 @@ def create_email(self, message_id, subject, content, topics = None, users = None api_params['targets'] = targets api_params['cc'] = cc api_params['bcc'] = bcc + api_params['attachments'] = attachments api_params['status'] = status api_params['html'] = html api_params['scheduledAt'] = scheduled_at @@ -53,7 +54,7 @@ def create_email(self, message_id, subject, content, topics = None, users = None }, api_params) def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, status = None, html = None, cc = None, bcc = None, scheduled_at = None): - """Update an email.""" + """Update an email""" api_path = '/messaging/messages/email/{messageId}' @@ -78,8 +79,8 @@ def update_email(self, message_id, topics = None, users = None, targets = None, 'content-type': 'application/json', }, api_params) - def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): - """Create a push notification.""" + def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): + """Create a push notification""" api_path = '/messaging/messages/push' @@ -102,6 +103,7 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ api_params['targets'] = targets api_params['data'] = data api_params['action'] = action + api_params['image'] = image api_params['icon'] = icon api_params['sound'] = sound api_params['color'] = color @@ -114,8 +116,8 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ 'content-type': 'application/json', }, api_params) - def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): - """Update a push notification.""" + def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): + """Update a push notification""" api_path = '/messaging/messages/push/{messageId}' @@ -132,6 +134,7 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t api_params['body'] = body api_params['data'] = data api_params['action'] = action + api_params['image'] = image api_params['icon'] = icon api_params['sound'] = sound api_params['color'] = color @@ -145,7 +148,7 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t }, api_params) def create_sms(self, message_id, content, topics = None, users = None, targets = None, status = None, scheduled_at = None): - """Create an SMS.""" + """Create an SMS""" api_path = '/messaging/messages/sms' @@ -170,7 +173,7 @@ def create_sms(self, message_id, content, topics = None, users = None, targets = }, api_params) def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, status = None, scheduled_at = None): - """Update an SMS.""" + """Update an SMS""" api_path = '/messaging/messages/sms/{messageId}' @@ -817,7 +820,7 @@ def list_subscriber_logs(self, subscriber_id, queries = None): }, api_params) def list_topics(self, queries = None, search = None): - """List topics.""" + """List topics""" api_path = '/messaging/topics' @@ -831,7 +834,7 @@ def list_topics(self, queries = None, search = None): }, api_params) def create_topic(self, topic_id, name, subscribe = None): - """Create a topic.""" + """Create a topic""" api_path = '/messaging/topics' @@ -852,7 +855,7 @@ def create_topic(self, topic_id, name, subscribe = None): }, api_params) def get_topic(self, topic_id): - """Get a topic.""" + """Get a topic""" api_path = '/messaging/topics/{topicId}' @@ -868,7 +871,7 @@ def get_topic(self, topic_id): }, api_params) def update_topic(self, topic_id, name = None): - """Update a topic.""" + """Update a topic""" api_path = '/messaging/topics/{topicId}' @@ -885,7 +888,7 @@ def update_topic(self, topic_id, name = None): }, api_params) def delete_topic(self, topic_id): - """Delete a topic.""" + """Delete a topic""" api_path = '/messaging/topics/{topicId}' @@ -918,7 +921,7 @@ def list_topic_logs(self, topic_id, queries = None): }, api_params) def list_subscribers(self, topic_id, queries = None, search = None): - """List subscribers.""" + """List subscribers""" api_path = '/messaging/topics/{topicId}/subscribers' @@ -936,7 +939,7 @@ def list_subscribers(self, topic_id, queries = None, search = None): }, api_params) def create_subscriber(self, topic_id, subscriber_id, target_id): - """Create a subscriber.""" + """Create a subscriber""" api_path = '/messaging/topics/{topicId}/subscribers' @@ -960,7 +963,7 @@ def create_subscriber(self, topic_id, subscriber_id, target_id): }, api_params) def get_subscriber(self, topic_id, subscriber_id): - """Get a subscriber.""" + """Get a subscriber""" api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' @@ -980,7 +983,7 @@ def get_subscriber(self, topic_id, subscriber_id): }, api_params) def delete_subscriber(self, topic_id, subscriber_id): - """Delete a subscriber.""" + """Delete a subscriber""" api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' diff --git a/docs/examples/account/add-authenticator.md b/docs/examples/account/add-authenticator.md index e8c249d..3c52b89 100644 --- a/docs/examples/account/add-authenticator.md +++ b/docs/examples/account/add-authenticator.md @@ -1,14 +1,13 @@ from appwrite.client import Client -from Appwrite.enums import AuthenticatorType +from appwrite.enums import AuthenticatorType client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.add_authenticator(AuthenticatorType.TOTP) +result = account.add_authenticator( + type = AuthenticatorType.TOTP +) diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 71282f6..afaa76b 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,11 +1,8 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 718159b..667d85a 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,12 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create_email_password_session('email@example.com', 'password') +result = account.create_email_password_session( + email = 'email@example.com', + password = 'password' +) diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 00db0b3..090bfd5 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,12 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create_email_token('[USER_ID]', 'email@example.com') +result = account.create_email_token( + user_id = '[USER_ID]', + email = 'email@example.com', + phrase = False # optional +) diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 0889609..bc9b684 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -1,11 +1,8 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 390e9cb..c43cfaf 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -1,12 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create_magic_url_token('[USER_ID]', 'email@example.com') +result = account.create_magic_url_token( + user_id = '[USER_ID]', + email = 'email@example.com', + url = 'https://example.com', # optional + phrase = False # optional +) diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md index fcdb570..948a35b 100644 --- a/docs/examples/account/create-o-auth2session.md +++ b/docs/examples/account/create-o-auth2session.md @@ -1,13 +1,16 @@ from appwrite.client import Client -from Appwrite.enums import OAuthProvider +from appwrite.enums import OAuthProvider client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create_o_auth2_session(OAuthProvider.AMAZON) +result = account.create_o_auth2_session( + provider = OAuthProvider.AMAZON, + success = 'https://example.com', # optional + failure = 'https://example.com', # optional + token = False, # optional + scopes = [] # optional +) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index c661de3..00cd40c 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,12 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create_phone_token('[USER_ID]', '+12065550100') +result = account.create_phone_token( + user_id = '[USER_ID]', + phone = '+12065550100' +) diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index c4f3f6b..ca46b01 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e3937d5..c16be97 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.create_recovery('email@example.com', 'https://example.com') +result = account.create_recovery( + email = 'email@example.com', + url = 'https://example.com' +) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 04d4ece..e363222 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,12 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create_session('[USER_ID]', '[SECRET]') +result = account.create_session( + user_id = '[USER_ID]', + secret = '[SECRET]' +) diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index a9d7c27..6138686 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.create_verification('https://example.com') +result = account.create_verification( + url = 'https://example.com' +) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 7c4428d..efc1b55 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,12 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create('[USER_ID]', 'email@example.com', '') +result = account.create( + user_id = '[USER_ID]', + email = 'email@example.com', + password = '', + name = '[NAME]' # optional +) diff --git a/docs/examples/account/create2f-a-challenge.md b/docs/examples/account/create2f-a-challenge.md index b69fdb8..60141a5 100644 --- a/docs/examples/account/create2f-a-challenge.md +++ b/docs/examples/account/create2f-a-challenge.md @@ -1,13 +1,12 @@ from appwrite.client import Client -from Appwrite.enums import AuthenticationFactor +from appwrite.enums import AuthenticationFactor client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create2_fa_challenge(AuthenticationFactor.TOTP) +result = account.create2_fa_challenge( + factor = AuthenticationFactor.TOTP +) diff --git a/docs/examples/account/delete-authenticator.md b/docs/examples/account/delete-authenticator.md index c87087b..f7a74e8 100644 --- a/docs/examples/account/delete-authenticator.md +++ b/docs/examples/account/delete-authenticator.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from Appwrite.enums import AuthenticatorType +from appwrite.enums import AuthenticatorType client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.delete_authenticator(AuthenticatorType.TOTP, '[OTP]') +result = account.delete_authenticator( + type = AuthenticatorType.TOTP, + otp = '[OTP]' +) diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 02a80c3..e6520c3 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.delete_identity('[IDENTITY_ID]') +result = account.delete_identity( + identity_id = '[IDENTITY_ID]' +) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index ac945fe..3452eb8 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.delete_session('[SESSION_ID]') +result = account.delete_session( + session_id = '[SESSION_ID]' +) diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 9057b73..182c375 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 0b79b60..102f4dc 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index dc1d0de..4d191ea 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.get_session('[SESSION_ID]') +result = account.get_session( + session_id = '[SESSION_ID]' +) diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 752a823..cc66fe6 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-factors.md b/docs/examples/account/list-factors.md index a5ec4a2..5b0c259 100644 --- a/docs/examples/account/list-factors.md +++ b/docs/examples/account/list-factors.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index f14e5b4..3e0d4e0 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.list_identities() +result = account.list_identities( + queries = [] # optional +) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index da2d511..0c0b28a 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.list_logs() +result = account.list_logs( + queries = [] # optional +) diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 2bdd710..23398dc 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-challenge.md b/docs/examples/account/update-challenge.md index f262ea3..8a28538 100644 --- a/docs/examples/account/update-challenge.md +++ b/docs/examples/account/update-challenge.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_challenge('[CHALLENGE_ID]', '[OTP]') +result = account.update_challenge( + challenge_id = '[CHALLENGE_ID]', + otp = '[OTP]' +) diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 8e2bc67..353edb0 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_email('email@example.com', 'password') +result = account.update_email( + email = 'email@example.com', + password = 'password' +) diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index ccb6d77..b59ede8 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_mfa(False) +result = account.update_mfa( + mfa = False +) diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index c75e94c..7676d4f 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -1,12 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.update_magic_url_session('[USER_ID]', '[SECRET]') +result = account.update_magic_url_session( + user_id = '[USER_ID]', + secret = '[SECRET]' +) diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 2aaa411..f837534 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_name('[NAME]') +result = account.update_name( + name = '[NAME]' +) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 365c733..7d651c2 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_password('') +result = account.update_password( + password = '', + old_password = 'password' # optional +) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 9d4fdbb..46d8808 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_phone_verification('[USER_ID]', '[SECRET]') +result = account.update_phone_verification( + user_id = '[USER_ID]', + secret = '[SECRET]' +) diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 7c1b218..c05bb16 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_phone('+12065550100', 'password') +result = account.update_phone( + phone = '+12065550100', + password = 'password' +) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index c554961..2c58cca 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_prefs({}) +result = account.update_prefs( + prefs = {} +) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 4f14fa1..286fb38 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_recovery('[USER_ID]', '[SECRET]', '') +result = account.update_recovery( + user_id = '[USER_ID]', + secret = '[SECRET]', + password = '' +) diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index aca93ba..2e0bfaa 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_session('[SESSION_ID]') +result = account.update_session( + session_id = '[SESSION_ID]' +) diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index e7be5fb..5c17fa1 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 3ae98a1..a1bcd4c 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_verification('[USER_ID]', '[SECRET]') +result = account.update_verification( + user_id = '[USER_ID]', + secret = '[SECRET]' +) diff --git a/docs/examples/account/verify-authenticator.md b/docs/examples/account/verify-authenticator.md index 8cd2553..769e0d7 100644 --- a/docs/examples/account/verify-authenticator.md +++ b/docs/examples/account/verify-authenticator.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from Appwrite.enums import AuthenticatorType +from appwrite.enums import AuthenticatorType client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with account = Account(client) -result = account.verify_authenticator(AuthenticatorType.TOTP, '[OTP]') +result = account.verify_authenticator( + type = AuthenticatorType.TOTP, + otp = '[OTP]' +) diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 0d2220f..1de5eab 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,14 +1,16 @@ from appwrite.client import Client -from Appwrite.enums import Browser +from appwrite.enums import Browser client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_browser(Browser.AVANT_BROWSER) +result = avatars.get_browser( + code = Browser.AVANT_BROWSER, + width = 0, # optional + height = 0, # optional + quality = 0 # optional +) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index b2a9afd..9437ff8 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,14 +1,16 @@ from appwrite.client import Client -from Appwrite.enums import CreditCard +from appwrite.enums import CreditCard client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_credit_card(CreditCard.AMERICAN_EXPRESS) +result = avatars.get_credit_card( + code = CreditCard.AMERICAN_EXPRESS, + width = 0, # optional + height = 0, # optional + quality = 0 # optional +) diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index f3c5aed..2867696 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_favicon('https://example.com') +result = avatars.get_favicon( + url = 'https://example.com' +) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 6c2fbee..37ac482 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,14 +1,16 @@ from appwrite.client import Client -from Appwrite.enums import Flag +from appwrite.enums import Flag client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_flag(Flag.AFGHANISTAN) +result = avatars.get_flag( + code = Flag.AFGHANISTAN, + width = 0, # optional + height = 0, # optional + quality = 0 # optional +) diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 9c33063..00afe0c 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_image('https://example.com') +result = avatars.get_image( + url = 'https://example.com', + width = 0, # optional + height = 0 # optional +) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 098d791..915d430 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_initials() +result = avatars.get_initials( + name = '[NAME]', # optional + width = 0, # optional + height = 0, # optional + background = '' # optional +) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index b6191bd..c719750 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_qr('[TEXT]') +result = avatars.get_qr( + text = '[TEXT]', + size = 1, # optional + margin = 0, # optional + download = False # optional +) diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index e7b223f..1b97943 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_boolean_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False) +result = databases.create_boolean_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = False, # optional + array = False # optional +) diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 2d7c679..e82f774 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_collection('[DATABASE_ID]', '[COLLECTION_ID]', '[NAME]') +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 +) diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index c3039d1..cd108f9 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_datetime_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False) +result = databases.create_datetime_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = '', # optional + array = False # optional +) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index f7b05e0..a67091f 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with databases = Databases(client) -result = databases.create_document('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]', {}) +result = databases.create_document( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + document_id = '[DOCUMENT_ID]', + data = {}, + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 8b25aaa..edcf4ab 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_email_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False) +result = databases.create_email_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = 'email@example.com', # optional + array = False # optional +) diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index b35f591..b12b2ee 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,13 +1,18 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_enum_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', [], False) +result = databases.create_enum_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + elements = [], + required = False, + default = '[DEFAULT]', # optional + array = False # optional +) diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index f4c1dd7..639ed4b 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,13 +1,19 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_float_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False) +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 +) diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index ba10266..e68d32e 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,14 +1,18 @@ from appwrite.client import Client -from Appwrite.enums import IndexType +from appwrite.enums import IndexType client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_index('[DATABASE_ID]', '[COLLECTION_ID]', '', IndexType.KEY, []) +result = databases.create_index( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + type = IndexType.KEY, + attributes = [], + orders = [] # optional +) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index d0619bd..730f334 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,13 +1,19 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_integer_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False) +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 +) diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index d211390..00ab05b 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_ip_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False) +result = databases.create_ip_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = '', # optional + array = False # optional +) diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 9bfb6c3..c48da10 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,14 +1,20 @@ from appwrite.client import Client -from Appwrite.enums import RelationshipType +from appwrite.enums import RelationshipType client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_relationship_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', RelationshipType.ONE_TO_ONE) +result = databases.create_relationship_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + related_collection_id = '[RELATED_COLLECTION_ID]', + type = RelationshipType.ONE_TO_ONE, + two_way = False, # optional + key = '', # optional + two_way_key = '', # optional + on_delete = RelationMutate.CASCADE # optional +) diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 820f06a..c94736c 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,13 +1,19 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_string_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', 1, False) +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 +) diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index b6b5fb0..ea061da 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create_url_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False) +result = databases.create_url_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = 'https://example.com', # optional + array = False # optional +) diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index f2188b1..a71a0c5 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.create('[DATABASE_ID]', '[NAME]') +result = databases.create( + database_id = '[DATABASE_ID]', + name = '[NAME]', + enabled = False # optional +) diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 95f8166..b7d3438 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.delete_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '') +result = databases.delete_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '' +) diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index dea504c..d353922 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.delete_collection('[DATABASE_ID]', '[COLLECTION_ID]') +result = databases.delete_collection( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]' +) diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 9c441a5..8d457aa 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with databases = Databases(client) -result = databases.delete_document('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]') +result = databases.delete_document( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + document_id = '[DOCUMENT_ID]' +) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 6aff595..3131a7b 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.delete_index('[DATABASE_ID]', '[COLLECTION_ID]', '') +result = databases.delete_index( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '' +) diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index bb9c307..fe3e973 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.delete('[DATABASE_ID]') +result = databases.delete( + database_id = '[DATABASE_ID]' +) diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 0c5a832..f4990d7 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.get_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '') +result = databases.get_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '' +) diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 8bba64c..b8935c4 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.get_collection('[DATABASE_ID]', '[COLLECTION_ID]') +result = databases.get_collection( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]' +) diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index d89a040..15cb6e4 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with databases = Databases(client) -result = databases.get_document('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]') +result = databases.get_document( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + document_id = '[DOCUMENT_ID]', + queries = [] # optional +) diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index bc8852f..2d354f5 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.get_index('[DATABASE_ID]', '[COLLECTION_ID]', '') +result = databases.get_index( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '' +) diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 654f5d6..bf125a1 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.get('[DATABASE_ID]') +result = databases.get( + database_id = '[DATABASE_ID]' +) diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 500a273..d174bf0 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.list_attributes('[DATABASE_ID]', '[COLLECTION_ID]') +result = databases.list_attributes( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + queries = [] # optional +) diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 34c3c61..7e66bab 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.list_collections('[DATABASE_ID]') +result = databases.list_collections( + database_id = '[DATABASE_ID]', + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 014f54c..5379a81 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with databases = Databases(client) -result = databases.list_documents('[DATABASE_ID]', '[COLLECTION_ID]') +result = databases.list_documents( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + queries = [] # optional +) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index c4685f5..0c35f6c 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.list_indexes('[DATABASE_ID]', '[COLLECTION_ID]') +result = databases.list_indexes( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + queries = [] # optional +) diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 41eb45a..2f87238 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.list() +result = databases.list( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 0c4c727..fc5f101 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_boolean_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False, False) +result = databases.update_boolean_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = False +) diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 67c1a8b..3cc2321 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_collection('[DATABASE_ID]', '[COLLECTION_ID]', '[NAME]') +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 +) diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 28bb030..9c4cafa 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_datetime_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False, '') +result = databases.update_datetime_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = '' +) diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 5496516..6671149 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with databases = Databases(client) -result = databases.update_document('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]') +result = databases.update_document( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + document_id = '[DOCUMENT_ID]', + data = {}, # optional + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 567f10e..97be2de 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_email_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False, 'email@example.com') +result = databases.update_email_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = 'email@example.com' +) diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 626ccc8..5587158 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_enum_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', [], False, '[DEFAULT]') +result = databases.update_enum_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + elements = [], + required = False, + default = '[DEFAULT]' +) diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index ba5e25c..b101782 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,13 +1,18 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_float_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False, None, None, None) +result = databases.update_float_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + min = None, + max = None, + default = None +) diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index dcf92be..53b792b 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,13 +1,18 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_integer_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False, None, None, None) +result = databases.update_integer_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + min = None, + max = None, + default = None +) diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index e58e944..c858a93 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_ip_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False, '') +result = databases.update_ip_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = '' +) diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index c717550..98b0d71 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_relationship_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '') +result = databases.update_relationship_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + on_delete = RelationMutate.CASCADE # optional +) diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 22861aa..d4f3ee6 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_string_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False, '[DEFAULT]') +result = databases.update_string_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = '[DEFAULT]' +) diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 2924e5d..fd56cfc 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update_url_attribute('[DATABASE_ID]', '[COLLECTION_ID]', '', False, 'https://example.com') +result = databases.update_url_attribute( + database_id = '[DATABASE_ID]', + collection_id = '[COLLECTION_ID]', + key = '', + required = False, + default = 'https://example.com' +) diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index a3a3f13..ccc0e9c 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) -result = databases.update('[DATABASE_ID]', '[NAME]') +result = databases.update( + database_id = '[DATABASE_ID]', + name = '[NAME]', + enabled = False # optional +) diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index 8b3a95b..d816f8b 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.create_build('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]') +result = functions.create_build( + function_id = '[FUNCTION_ID]', + deployment_id = '[DEPLOYMENT_ID]', + build_id = '[BUILD_ID]' +) diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index a62d341..139acb5 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -2,13 +2,16 @@ from appwrite.client import Client from appwrite.input_file import InputFile client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.create_deployment('[FUNCTION_ID]', InputFile.from_path('file.png'), False) +result = functions.create_deployment( + function_id = '[FUNCTION_ID]', + code = InputFile.from_path('file.png'), + activate = False, + entrypoint = '[ENTRYPOINT]', # optional + commands = '[COMMANDS]' # optional +) diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 709ca07..964c16a 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with functions = Functions(client) -result = functions.create_execution('[FUNCTION_ID]') +result = functions.create_execution( + function_id = '[FUNCTION_ID]', + body = '[BODY]', # optional + async = False, # optional + path = '[PATH]', # optional + method = ExecutionMethod.GET, # optional + headers = {} # optional +) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 8198694..6b6bd2f 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.create_variable('[FUNCTION_ID]', '[KEY]', '[VALUE]') +result = functions.create_variable( + function_id = '[FUNCTION_ID]', + key = '[KEY]', + value = '[VALUE]' +) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index c05c56a..ed4ab10 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,14 +1,32 @@ from appwrite.client import Client -from Appwrite.enums import +from appwrite.enums import client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.create('[FUNCTION_ID]', '[NAME]', .NODE-18.0) +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 + 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 +) diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index f5ec491..49d4645 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.delete_deployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]') +result = functions.delete_deployment( + function_id = '[FUNCTION_ID]', + deployment_id = '[DEPLOYMENT_ID]' +) diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 1ee6b16..8e1144b 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.delete_variable('[FUNCTION_ID]', '[VARIABLE_ID]') +result = functions.delete_variable( + function_id = '[FUNCTION_ID]', + variable_id = '[VARIABLE_ID]' +) diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index ac5aa7f..551fade 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.delete('[FUNCTION_ID]') +result = functions.delete( + function_id = '[FUNCTION_ID]' +) diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/download-deployment.md index f86f56e..915cd11 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/download-deployment.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.download_deployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]') +result = functions.download_deployment( + function_id = '[FUNCTION_ID]', + deployment_id = '[DEPLOYMENT_ID]' +) diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index e324251..957d5d3 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.get_deployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]') +result = functions.get_deployment( + function_id = '[FUNCTION_ID]', + deployment_id = '[DEPLOYMENT_ID]' +) diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index f7c1f04..67f2b5d 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with functions = Functions(client) -result = functions.get_execution('[FUNCTION_ID]', '[EXECUTION_ID]') +result = functions.get_execution( + function_id = '[FUNCTION_ID]', + execution_id = '[EXECUTION_ID]' +) diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 1bbce36..3f22537 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.get_variable('[FUNCTION_ID]', '[VARIABLE_ID]') +result = functions.get_variable( + function_id = '[FUNCTION_ID]', + variable_id = '[VARIABLE_ID]' +) diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 9ceed7b..9bb505c 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.get('[FUNCTION_ID]') +result = functions.get( + function_id = '[FUNCTION_ID]' +) diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 51b89a6..aeed916 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.list_deployments('[FUNCTION_ID]') +result = functions.list_deployments( + function_id = '[FUNCTION_ID]', + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 112d884..8c6cbc9 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with functions = Functions(client) -result = functions.list_executions('[FUNCTION_ID]') +result = functions.list_executions( + function_id = '[FUNCTION_ID]', + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 941f22e..ae64245 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 1ae2f51..83e93c5 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.list_variables('[FUNCTION_ID]') +result = functions.list_variables( + function_id = '[FUNCTION_ID]' +) diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 107dacf..7a2bd24 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.list() +result = functions.list( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 08abe08..d1e1079 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.update_deployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]') +result = functions.update_deployment( + function_id = '[FUNCTION_ID]', + deployment_id = '[DEPLOYMENT_ID]' +) diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 452dcc4..e8ce4c0 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.update_variable('[FUNCTION_ID]', '[VARIABLE_ID]', '[KEY]') +result = functions.update_variable( + function_id = '[FUNCTION_ID]', + variable_id = '[VARIABLE_ID]', + key = '[KEY]', + value = '[VALUE]' # optional +) diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 4dbbee5..f005f01 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,13 +1,27 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) -result = functions.update('[FUNCTION_ID]', '[NAME]') +result = functions.update( + function_id = '[FUNCTION_ID]', + name = '[NAME]', + runtime = .NODE-14.5, # optional + execute = ["any"], # optional + events = [], # optional + schedule = '', # optional + timeout = 1, # optional + enabled = False, # optional + logging = False, # optional + entrypoint = '[ENTRYPOINT]', # optional + commands = '[COMMANDS]', # 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 +) diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 80cb9c7..3d9ad02 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key graphql = Graphql(client) -result = graphql.mutation({}) +result = graphql.mutation( + query = {} +) diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index cebf63c..deb07a8 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key graphql = Graphql(client) -result = graphql.query({}) +result = graphql.query( + query = {} +) diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 0894ff7..5ba2199 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index e0d4f6b..02b85b3 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 5221e18..83018cf 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_certificate() +result = health.get_certificate( + domain = '' # optional +) diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 7fe0bf2..5446df5 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index be42733..0991b92 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,14 +1,14 @@ from appwrite.client import Client -from Appwrite.enums import +from appwrite.enums import client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_failed_jobs(.V1-DATABASE) +result = health.get_failed_jobs( + name = .V1-DATABASE, + threshold = None # optional +) diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 4c63e6a..84ffd97 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 09f2d81..b513c2c 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_builds() +result = health.get_queue_builds( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 6771209..bbeece1 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_certificates() +result = health.get_queue_certificates( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 576dd5e..06d0ba9 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_databases() +result = health.get_queue_databases( + name = '[NAME]', # optional + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 863fa58..b39b445 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_deletes() +result = health.get_queue_deletes( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index c84460b..a989a6a 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_functions() +result = health.get_queue_functions( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 99ecad2..47a56f7 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_logs() +result = health.get_queue_logs( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 225d286..39fc879 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_mails() +result = health.get_queue_mails( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index df77f45..3862c9e 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_messaging() +result = health.get_queue_messaging( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index de2f90d..85a5e56 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_migrations() +result = health.get_queue_migrations( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 79e47bf..435ba95 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) -result = health.get_queue_webhooks() +result = health.get_queue_webhooks( + threshold = None # optional +) diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 81dbde6..81ea4ba 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 1d3c016..c262455 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 89cec53..02405db 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index b4bc8e6..22034e7 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 2e4f028..8915eb1 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 646d82e..9d2c939 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 75b78d8..fadd5f3 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index af224a8..2f3bd50 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 0b451c2..134ddaa 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index c0c9008..f344cc1 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 8501744..19d831f 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index c70d837..6de06d3 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,12 +1,9 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/messaging/create-a-p-n-s-provider.md b/docs/examples/messaging/create-a-p-n-s-provider.md deleted file mode 100644 index ad05664..0000000 --- a/docs/examples/messaging/create-a-p-n-s-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_apns_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000..d33cc52 --- /dev/null +++ b/docs/examples/messaging/create-apns-provider.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_apns_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + auth_key = '[AUTH_KEY]', # optional + auth_key_id = '[AUTH_KEY_ID]', # optional + team_id = '[TEAM_ID]', # optional + bundle_id = '[BUNDLE_ID]', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 72fc437..dc2fa36 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,13 +1,23 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_email('[MESSAGE_ID]', '[SUBJECT]', '[CONTENT]') +result = messaging.create_email( + message_id = '[MESSAGE_ID]', + subject = '[SUBJECT]', + content = '[CONTENT]', + topics = [], # optional + users = [], # optional + targets = [], # optional + cc = [], # optional + bcc = [], # optional + attachments = [], # optional + status = MessageStatus.DRAFT, # optional + html = False, # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/messaging/create-f-c-m-provider.md b/docs/examples/messaging/create-f-c-m-provider.md deleted file mode 100644 index b6b2a7b..0000000 --- a/docs/examples/messaging/create-f-c-m-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_fcm_provider('[PROVIDER_ID]', '[NAME]') diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000..7bcbc4e --- /dev/null +++ b/docs/examples/messaging/create-fcm-provider.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_fcm_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + service_account_json = {}, # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 84fc1d5..e5cdc72 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,13 +1,21 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_mailgun_provider('[PROVIDER_ID]', '[NAME]') +result = messaging.create_mailgun_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + api_key = '[API_KEY]', # optional + domain = '[DOMAIN]', # optional + is_eu_region = False, # optional + from_name = '[FROM_NAME]', # optional + from_email = 'email@example.com', # optional + reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 5db7e0e..5ebf23a 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_msg91_provider('[PROVIDER_ID]', '[NAME]') +result = messaging.create_msg91_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + from = '+12065550100', # optional + sender_id = '[SENDER_ID]', # optional + auth_key = '[AUTH_KEY]', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 550f58b..e941921 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,13 +1,27 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_push('[MESSAGE_ID]', '[TITLE]', '[BODY]') +result = messaging.create_push( + message_id = '[MESSAGE_ID]', + title = '[TITLE]', + body = '[BODY]', + topics = [], # optional + users = [], # optional + targets = [], # optional + data = {}, # optional + action = '[ACTION]', # optional + image = '[ID1:ID2]', # optional + icon = '[ICON]', # optional + sound = '[SOUND]', # optional + color = '[COLOR]', # optional + tag = '[TAG]', # optional + badge = '[BADGE]', # optional + status = MessageStatus.DRAFT, # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/messaging/create-s-m-s.md b/docs/examples/messaging/create-s-m-s.md deleted file mode 100644 index d2eb41a..0000000 --- a/docs/examples/messaging/create-s-m-s.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_sms('[MESSAGE_ID]', '[CONTENT]') diff --git a/docs/examples/messaging/create-s-m-t-p-provider.md b/docs/examples/messaging/create-s-m-t-p-provider.md deleted file mode 100644 index f7af468..0000000 --- a/docs/examples/messaging/create-s-m-t-p-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_smtp_provider('[PROVIDER_ID]', '[NAME]', '[HOST]') diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 003a397..622e00e 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,13 +1,19 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_sendgrid_provider('[PROVIDER_ID]', '[NAME]') +result = messaging.create_sendgrid_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + api_key = '[API_KEY]', # optional + from_name = '[FROM_NAME]', # optional + from_email = 'email@example.com', # optional + reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md new file mode 100644 index 0000000..a1fcb07 --- /dev/null +++ b/docs/examples/messaging/create-sms.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_sms( + message_id = '[MESSAGE_ID]', + content = '[CONTENT]', + topics = [], # optional + users = [], # optional + targets = [], # optional + status = MessageStatus.DRAFT, # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000..a7a5612 --- /dev/null +++ b/docs/examples/messaging/create-smtp-provider.md @@ -0,0 +1,25 @@ +from appwrite.client import Client + +client = Client() +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_smtp_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + host = '[HOST]', + port = 1, # optional + username = '[USERNAME]', # optional + password = '[PASSWORD]', # optional + encryption = .NONE, # optional + auto_tls = False, # optional + mailer = '[MAILER]', # optional + from_name = '[FROM_NAME]', # optional + from_email = 'email@example.com', # optional + reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 82e9976..a08f397 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token messaging = Messaging(client) -result = messaging.create_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]', '[TARGET_ID]') +result = messaging.create_subscriber( + topic_id = '[TOPIC_ID]', + subscriber_id = '[SUBSCRIBER_ID]', + target_id = '[TARGET_ID]' +) diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 4139ccf..8006f2a 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_telesign_provider('[PROVIDER_ID]', '[NAME]') +result = messaging.create_telesign_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + from = '+12065550100', # optional + customer_id = '[CUSTOMER_ID]', # optional + api_key = '[API_KEY]', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 5b0fcfc..e358b75 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_textmagic_provider('[PROVIDER_ID]', '[NAME]') +result = messaging.create_textmagic_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + from = '+12065550100', # optional + username = '[USERNAME]', # optional + api_key = '[API_KEY]', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 9dd5ce8..ad612d6 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_topic('[TOPIC_ID]', '[NAME]') +result = messaging.create_topic( + topic_id = '[TOPIC_ID]', + name = '[NAME]', + subscribe = ["any"] # optional +) diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index e984b06..eb6ff37 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_twilio_provider('[PROVIDER_ID]', '[NAME]') +result = messaging.create_twilio_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + from = '+12065550100', # optional + account_sid = '[ACCOUNT_SID]', # optional + auth_token = '[AUTH_TOKEN]', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 31115b7..041d7f8 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_vonage_provider('[PROVIDER_ID]', '[NAME]') +result = messaging.create_vonage_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', + from = '+12065550100', # optional + api_key = '[API_KEY]', # optional + api_secret = '[API_SECRET]', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 894cb6f..cb65226 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.delete_provider('[PROVIDER_ID]') +result = messaging.delete_provider( + provider_id = '[PROVIDER_ID]' +) diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 04012a5..84dca4d 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token messaging = Messaging(client) -result = messaging.delete_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]') +result = messaging.delete_subscriber( + topic_id = '[TOPIC_ID]', + subscriber_id = '[SUBSCRIBER_ID]' +) diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 4e6b380..b035a89 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.delete_topic('[TOPIC_ID]') +result = messaging.delete_topic( + topic_id = '[TOPIC_ID]' +) diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 2839355..6c19557 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.delete('[MESSAGE_ID]') +result = messaging.delete( + message_id = '[MESSAGE_ID]' +) diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 19587e9..12b14fe 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.get_message('[MESSAGE_ID]') +result = messaging.get_message( + message_id = '[MESSAGE_ID]' +) diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 9e02e14..ca00786 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.get_provider('[PROVIDER_ID]') +result = messaging.get_provider( + provider_id = '[PROVIDER_ID]' +) diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index a170f60..e2f105f 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.get_subscriber('[TOPIC_ID]', '[SUBSCRIBER_ID]') +result = messaging.get_subscriber( + topic_id = '[TOPIC_ID]', + subscriber_id = '[SUBSCRIBER_ID]' +) diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index ade0291..a4eb54e 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.get_topic('[TOPIC_ID]') +result = messaging.get_topic( + topic_id = '[TOPIC_ID]' +) diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index b77c8d9..36beb11 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_message_logs('[MESSAGE_ID]') +result = messaging.list_message_logs( + message_id = '[MESSAGE_ID]', + queries = [] # optional +) diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index eb8bdf6..c070081 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_messages() +result = messaging.list_messages( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index c9ee22c..b1ce05b 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_provider_logs('[PROVIDER_ID]') +result = messaging.list_provider_logs( + provider_id = '[PROVIDER_ID]', + queries = [] # optional +) diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 5bb1223..dfb9cda 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_providers() +result = messaging.list_providers( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 56a5544..4acf7d8 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_subscriber_logs('[SUBSCRIBER_ID]') +result = messaging.list_subscriber_logs( + subscriber_id = '[SUBSCRIBER_ID]', + queries = [] # optional +) diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 85f5972..7fddddc 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_subscribers('[TOPIC_ID]') +result = messaging.list_subscribers( + topic_id = '[TOPIC_ID]', + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 1463533..a05bda9 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_targets('[MESSAGE_ID]') +result = messaging.list_targets( + message_id = '[MESSAGE_ID]', + queries = [] # optional +) diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 0eaac28..7448c19 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_topic_logs('[TOPIC_ID]') +result = messaging.list_topic_logs( + topic_id = '[TOPIC_ID]', + queries = [] # optional +) diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 4f6265f..491e317 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.list_topics() +result = messaging.list_topics( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-a-p-n-s-provider.md index 74a3ade..02b9dd8 100644 --- a/docs/examples/messaging/update-a-p-n-s-provider.md +++ b/docs/examples/messaging/update-a-p-n-s-provider.md @@ -1,13 +1,18 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_apns_provider('[PROVIDER_ID]') +result = messaging.update_apns_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + enabled = False, # optional + auth_key = '[AUTH_KEY]', # optional + auth_key_id = '[AUTH_KEY_ID]', # optional + team_id = '[TEAM_ID]', # optional + bundle_id = '[BUNDLE_ID]' # optional +) diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index a737e24..3a9c08a 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,13 +1,22 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_email('[MESSAGE_ID]') +result = messaging.update_email( + message_id = '[MESSAGE_ID]', + topics = [], # optional + users = [], # optional + targets = [], # optional + subject = '[SUBJECT]', # optional + content = '[CONTENT]', # optional + status = MessageStatus.DRAFT, # optional + html = False, # optional + cc = [], # optional + bcc = [], # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-f-c-m-provider.md index 106d8af..e767772 100644 --- a/docs/examples/messaging/update-f-c-m-provider.md +++ b/docs/examples/messaging/update-f-c-m-provider.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_fcm_provider('[PROVIDER_ID]') +result = messaging.update_fcm_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + enabled = False, # optional + service_account_json = {} # optional +) diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 995df6c..0279932 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,13 +1,21 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_mailgun_provider('[PROVIDER_ID]') +result = messaging.update_mailgun_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + api_key = '[API_KEY]', # optional + domain = '[DOMAIN]', # optional + is_eu_region = False, # optional + enabled = False, # optional + from_name = '[FROM_NAME]', # optional + from_email = 'email@example.com', # optional + reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_email = '[REPLY_TO_EMAIL]' # optional +) diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 4504915..34494dc 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_msg91_provider('[PROVIDER_ID]') +result = messaging.update_msg91_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + enabled = False, # optional + sender_id = '[SENDER_ID]', # optional + auth_key = '[AUTH_KEY]', # optional + from = '[FROM]' # optional +) diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 5b9a5d5..f71bc44 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,13 +1,27 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_push('[MESSAGE_ID]') +result = messaging.update_push( + message_id = '[MESSAGE_ID]', + topics = [], # optional + users = [], # optional + targets = [], # optional + title = '[TITLE]', # optional + body = '[BODY]', # optional + data = {}, # optional + action = '[ACTION]', # optional + image = '[ID1:ID2]', # optional + icon = '[ICON]', # optional + sound = '[SOUND]', # optional + color = '[COLOR]', # optional + tag = '[TAG]', # optional + badge = None, # optional + status = MessageStatus.DRAFT, # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/messaging/update-s-m-s.md b/docs/examples/messaging/update-s-m-s.md deleted file mode 100644 index bb8039a..0000000 --- a/docs/examples/messaging/update-s-m-s.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_sms('[MESSAGE_ID]') diff --git a/docs/examples/messaging/update-s-m-t-p-provider.md b/docs/examples/messaging/update-s-m-t-p-provider.md deleted file mode 100644 index 7faad9e..0000000 --- a/docs/examples/messaging/update-s-m-t-p-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.update_smtp_provider('[PROVIDER_ID]') diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index d5fafdc..b6975f8 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,13 +1,19 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_sendgrid_provider('[PROVIDER_ID]') +result = messaging.update_sendgrid_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + enabled = False, # optional + api_key = '[API_KEY]', # optional + from_name = '[FROM_NAME]', # optional + from_email = 'email@example.com', # optional + reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_email = '[REPLY_TO_EMAIL]' # optional +) diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md new file mode 100644 index 0000000..ca1cdfd --- /dev/null +++ b/docs/examples/messaging/update-sms.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_sms( + message_id = '[MESSAGE_ID]', + topics = [], # optional + users = [], # optional + targets = [], # optional + content = '[CONTENT]', # optional + status = MessageStatus.DRAFT, # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000..dd23a3e --- /dev/null +++ b/docs/examples/messaging/update-smtp-provider.md @@ -0,0 +1,25 @@ +from appwrite.client import Client + +client = Client() +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_smtp_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + host = '[HOST]', # optional + port = 1, # optional + username = '[USERNAME]', # optional + password = '[PASSWORD]', # optional + encryption = .NONE, # optional + auto_tls = False, # optional + mailer = '[MAILER]', # optional + from_name = '[FROM_NAME]', # optional + from_email = 'email@example.com', # optional + reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_email = '[REPLY_TO_EMAIL]', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 59a1411..e816020 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_telesign_provider('[PROVIDER_ID]') +result = messaging.update_telesign_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + enabled = False, # optional + customer_id = '[CUSTOMER_ID]', # optional + api_key = '[API_KEY]', # optional + from = '[FROM]' # optional +) diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 70a0337..f2164ff 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_textmagic_provider('[PROVIDER_ID]') +result = messaging.update_textmagic_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + enabled = False, # optional + username = '[USERNAME]', # optional + api_key = '[API_KEY]', # optional + from = '[FROM]' # optional +) diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 61adea6..80ca389 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_topic('[TOPIC_ID]') +result = messaging.update_topic( + topic_id = '[TOPIC_ID]', + name = '[NAME]' # optional +) diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 5091170..8ba7a83 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_twilio_provider('[PROVIDER_ID]') +result = messaging.update_twilio_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + enabled = False, # optional + account_sid = '[ACCOUNT_SID]', # optional + auth_token = '[AUTH_TOKEN]', # optional + from = '[FROM]' # optional +) diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 7cd819c..21b3f72 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,13 +1,17 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.update_vonage_provider('[PROVIDER_ID]') +result = messaging.update_vonage_provider( + provider_id = '[PROVIDER_ID]', + name = '[NAME]', # optional + enabled = False, # optional + api_key = '[API_KEY]', # optional + api_secret = '[API_SECRET]', # optional + from = '[FROM]' # optional +) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 1fb104d..19f878b 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,13 +1,21 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) -result = storage.create_bucket('[BUCKET_ID]', '[NAME]') +result = storage.create_bucket( + bucket_id = '[BUCKET_ID]', + name = '[NAME]', + permissions = ["read("any")"], # optional + file_security = False, # optional + enabled = False, # optional + maximum_file_size = 1, # optional + allowed_file_extensions = [], # optional + compression = .NONE, # optional + encryption = False, # optional + antivirus = False # optional +) diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 643dc93..21e98f2 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -2,13 +2,15 @@ from appwrite.client import Client from appwrite.input_file import InputFile client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.create_file('[BUCKET_ID]', '[FILE_ID]', InputFile.from_path('file.png')) +result = storage.create_file( + bucket_id = '[BUCKET_ID]', + file_id = '[FILE_ID]', + file = InputFile.from_path('file.png'), + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 3741e9d..bcc83f3 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) -result = storage.delete_bucket('[BUCKET_ID]') +result = storage.delete_bucket( + bucket_id = '[BUCKET_ID]' +) diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 6fc33f8..1330c97 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.delete_file('[BUCKET_ID]', '[FILE_ID]') +result = storage.delete_file( + bucket_id = '[BUCKET_ID]', + file_id = '[FILE_ID]' +) diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index b4ef599..1337ccd 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) -result = storage.get_bucket('[BUCKET_ID]') +result = storage.get_bucket( + bucket_id = '[BUCKET_ID]' +) diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 39e67c5..b9a0708 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.get_file_download('[BUCKET_ID]', '[FILE_ID]') +result = storage.get_file_download( + bucket_id = '[BUCKET_ID]', + file_id = '[FILE_ID]' +) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index e926f15..f25272a 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,13 +1,24 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.get_file_preview('[BUCKET_ID]', '[FILE_ID]') +result = storage.get_file_preview( + bucket_id = '[BUCKET_ID]', + file_id = '[FILE_ID]', + width = 0, # optional + height = 0, # optional + gravity = ImageGravity.CENTER, # optional + quality = 0, # optional + border_width = 0, # optional + border_color = '', # optional + border_radius = 0, # optional + opacity = 0, # optional + rotation = -360, # optional + background = '', # optional + output = ImageFormat.JPG # optional +) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 7036f40..bf46a58 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.get_file_view('[BUCKET_ID]', '[FILE_ID]') +result = storage.get_file_view( + bucket_id = '[BUCKET_ID]', + file_id = '[FILE_ID]' +) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index e8b7af6..a961728 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.get_file('[BUCKET_ID]', '[FILE_ID]') +result = storage.get_file( + bucket_id = '[BUCKET_ID]', + file_id = '[FILE_ID]' +) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 8b5eaa7..48e92a9 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) -result = storage.list_buckets() +result = storage.list_buckets( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index f3a6c12..8f02147 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.list_files('[BUCKET_ID]') +result = storage.list_files( + bucket_id = '[BUCKET_ID]', + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 9cf6f02..a22d6a3 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,13 +1,21 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) -result = storage.update_bucket('[BUCKET_ID]', '[NAME]') +result = storage.update_bucket( + bucket_id = '[BUCKET_ID]', + name = '[NAME]', + permissions = ["read("any")"], # optional + file_security = False, # optional + enabled = False, # optional + maximum_file_size = 1, # optional + allowed_file_extensions = [], # optional + compression = .NONE, # optional + encryption = False, # optional + antivirus = False # optional +) diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index a504371..1f25493 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.update_file('[BUCKET_ID]', '[FILE_ID]') +result = storage.update_file( + bucket_id = '[BUCKET_ID]', + file_id = '[FILE_ID]', + name = '[NAME]', # optional + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 0d58c58..8d0d5a2 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,13 +1,18 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.create_membership('[TEAM_ID]', []) +result = teams.create_membership( + team_id = '[TEAM_ID]', + roles = [], + email = 'email@example.com', # optional + user_id = '[USER_ID]', # optional + phone = '+12065550100', # optional + url = 'https://example.com', # optional + name = '[NAME]' # optional +) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index b524915..cb0f1dc 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.create('[TEAM_ID]', '[NAME]') +result = teams.create( + team_id = '[TEAM_ID]', + name = '[NAME]', + roles = [] # optional +) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 37af7f2..0233561 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.delete_membership('[TEAM_ID]', '[MEMBERSHIP_ID]') +result = teams.delete_membership( + team_id = '[TEAM_ID]', + membership_id = '[MEMBERSHIP_ID]' +) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index e1afd82..3a5ed25 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.delete('[TEAM_ID]') +result = teams.delete( + team_id = '[TEAM_ID]' +) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 85a15a3..396b62d 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.get_membership('[TEAM_ID]', '[MEMBERSHIP_ID]') +result = teams.get_membership( + team_id = '[TEAM_ID]', + membership_id = '[MEMBERSHIP_ID]' +) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 4603fb9..65eca1c 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.get_prefs('[TEAM_ID]') +result = teams.get_prefs( + team_id = '[TEAM_ID]' +) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index e2284d5..5433d7b 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.get('[TEAM_ID]') +result = teams.get( + team_id = '[TEAM_ID]' +) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 30e3945..2712fce 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.list_memberships('[TEAM_ID]') +result = teams.list_memberships( + team_id = '[TEAM_ID]', + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index edb3575..cf189c9 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.list() +result = teams.list( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 8fee274..22cdebc 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.update_membership_status('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]') +result = teams.update_membership_status( + team_id = '[TEAM_ID]', + membership_id = '[MEMBERSHIP_ID]', + user_id = '[USER_ID]', + secret = '[SECRET]' +) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index e68ba08..4a0acc8 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.update_membership('[TEAM_ID]', '[MEMBERSHIP_ID]', []) +result = teams.update_membership( + team_id = '[TEAM_ID]', + membership_id = '[MEMBERSHIP_ID]', + roles = [] +) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 4458bfb..cc07333 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.update_name('[TEAM_ID]', '[NAME]') +result = teams.update_name( + team_id = '[TEAM_ID]', + name = '[NAME]' +) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 3579d2c..6e501b2 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_session('') # The user session to authenticate with -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with teams = Teams(client) -result = teams.update_prefs('[TEAM_ID]', {}) +result = teams.update_prefs( + team_id = '[TEAM_ID]', + prefs = {} +) diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index c0eebc7..2d41dd4 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_argon2_user('[USER_ID]', 'email@example.com', 'password') +result = users.create_argon2_user( + user_id = '[USER_ID]', + email = 'email@example.com', + password = 'password', + name = '[NAME]' # optional +) diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 8f1e3af..0c12e74 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_bcrypt_user('[USER_ID]', 'email@example.com', 'password') +result = users.create_bcrypt_user( + user_id = '[USER_ID]', + email = 'email@example.com', + password = 'password', + name = '[NAME]' # optional +) diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index b01a5b0..cd0f1f2 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_md5_user('[USER_ID]', 'email@example.com', 'password') +result = users.create_md5_user( + user_id = '[USER_ID]', + email = 'email@example.com', + password = 'password', + name = '[NAME]' # optional +) diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index efaab20..1ff4ea8 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,13 +1,15 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_ph_pass_user('[USER_ID]', 'email@example.com', 'password') +result = users.create_ph_pass_user( + user_id = '[USER_ID]', + email = 'email@example.com', + password = 'password', + name = '[NAME]' # optional +) diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index 7e784a4..a261f8a 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_sha_user('[USER_ID]', 'email@example.com', 'password') +result = users.create_sha_user( + user_id = '[USER_ID]', + email = 'email@example.com', + password = 'password', + password_version = PasswordHash.SHA1, # optional + name = '[NAME]' # optional +) diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 4b3fdf4..2f52a08 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,13 +1,18 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_scrypt_modified_user('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', '[PASSWORD_SALT_SEPARATOR]', '[PASSWORD_SIGNER_KEY]') +result = users.create_scrypt_modified_user( + user_id = '[USER_ID]', + email = 'email@example.com', + password = 'password', + password_salt = '[PASSWORD_SALT]', + password_salt_separator = '[PASSWORD_SALT_SEPARATOR]', + password_signer_key = '[PASSWORD_SIGNER_KEY]', + name = '[NAME]' # optional +) diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index cff12d7..956c511 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,13 +1,20 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_scrypt_user('[USER_ID]', 'email@example.com', 'password', '[PASSWORD_SALT]', None, None, None, None) +result = users.create_scrypt_user( + user_id = '[USER_ID]', + email = 'email@example.com', + password = 'password', + password_salt = '[PASSWORD_SALT]', + password_cpu = None, + password_memory = None, + password_parallel = None, + password_length = None, + name = '[NAME]' # optional +) diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 44129de..f5239c5 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_session('[USER_ID]') +result = users.create_session( + user_id = '[USER_ID]' +) diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 1aea0c2..987e193 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,14 +1,18 @@ from appwrite.client import Client -from Appwrite.enums import MessagingProviderType +from appwrite.enums import MessagingProviderType client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_target('[USER_ID]', '[TARGET_ID]', MessagingProviderType.EMAIL, '[IDENTIFIER]') +result = users.create_target( + user_id = '[USER_ID]', + target_id = '[TARGET_ID]', + provider_type = MessagingProviderType.EMAIL, + identifier = '[IDENTIFIER]', + provider_id = '[PROVIDER_ID]', # optional + name = '[NAME]' # optional +) diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 78bec21..c652ae0 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,13 +1,14 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create_token('[USER_ID]') +result = users.create_token( + user_id = '[USER_ID]', + length = 4, # optional + expire = 60 # optional +) diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index ff4c92a..3921e97 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.create('[USER_ID]') +result = users.create( + user_id = '[USER_ID]', + email = 'email@example.com', # optional + phone = '+12065550100', # optional + password = '', # optional + name = '[NAME]' # optional +) diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md index 7e09393..0ee3743 100644 --- a/docs/examples/users/delete-authenticator.md +++ b/docs/examples/users/delete-authenticator.md @@ -1,14 +1,15 @@ from appwrite.client import Client -from Appwrite.enums import AuthenticatorType +from appwrite.enums import AuthenticatorType client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.delete_authenticator('[USER_ID]', AuthenticatorType.TOTP, '[OTP]') +result = users.delete_authenticator( + user_id = '[USER_ID]', + type = AuthenticatorType.TOTP, + otp = '[OTP]' +) diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 5420468..70b5623 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.delete_identity('[IDENTITY_ID]') +result = users.delete_identity( + identity_id = '[IDENTITY_ID]' +) diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 45f0c8d..9c5ec8f 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.delete_session('[USER_ID]', '[SESSION_ID]') +result = users.delete_session( + user_id = '[USER_ID]', + session_id = '[SESSION_ID]' +) diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 8e6e285..65773fc 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.delete_sessions('[USER_ID]') +result = users.delete_sessions( + user_id = '[USER_ID]' +) diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 7d010e9..2805a92 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.delete_target('[USER_ID]', '[TARGET_ID]') +result = users.delete_target( + user_id = '[USER_ID]', + target_id = '[TARGET_ID]' +) diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index d09204f..e13c508 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.delete('[USER_ID]') +result = users.delete( + user_id = '[USER_ID]' +) diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 79a7100..912825b 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.get_prefs('[USER_ID]') +result = users.get_prefs( + user_id = '[USER_ID]' +) diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 1a77982..fa51de8 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.get_target('[USER_ID]', '[TARGET_ID]') +result = users.get_target( + user_id = '[USER_ID]', + target_id = '[TARGET_ID]' +) diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index b74dcf5..11191cf 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.get('[USER_ID]') +result = users.get( + user_id = '[USER_ID]' +) diff --git a/docs/examples/users/list-factors.md b/docs/examples/users/list-factors.md index f22e879..b229b1c 100644 --- a/docs/examples/users/list-factors.md +++ b/docs/examples/users/list-factors.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.list_factors('[USER_ID]') +result = users.list_factors( + user_id = '[USER_ID]' +) diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 279e9ce..350ebb2 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.list_identities() +result = users.list_identities( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 0db92fc..1c677ea 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.list_logs('[USER_ID]') +result = users.list_logs( + user_id = '[USER_ID]', + queries = [] # optional +) diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 52abcb5..4b3501f 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.list_memberships('[USER_ID]') +result = users.list_memberships( + user_id = '[USER_ID]' +) diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 24a7103..63c888b 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,13 +1,12 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.list_sessions('[USER_ID]') +result = users.list_sessions( + user_id = '[USER_ID]' +) diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 08f6fd2..377442c 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.list_targets('[USER_ID]') +result = users.list_targets( + user_id = '[USER_ID]', + queries = [] # optional +) diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index a5536b4..139f06f 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.list() +result = users.list( + queries = [], # optional + search = '[SEARCH]' # optional +) diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 8582aa7..45cb2ef 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_email_verification('[USER_ID]', False) +result = users.update_email_verification( + user_id = '[USER_ID]', + email_verification = False +) diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 6d962e3..4894275 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_email('[USER_ID]', 'email@example.com') +result = users.update_email( + user_id = '[USER_ID]', + email = 'email@example.com' +) diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 12e4b94..fbfec17 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_labels('[USER_ID]', []) +result = users.update_labels( + user_id = '[USER_ID]', + labels = [] +) diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 0882458..cf44e79 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_mfa('[USER_ID]', False) +result = users.update_mfa( + user_id = '[USER_ID]', + mfa = False +) diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index bff47a9..be04d14 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_name('[USER_ID]', '[NAME]') +result = users.update_name( + user_id = '[USER_ID]', + name = '[NAME]' +) diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 71b6c86..b820fa5 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_password('[USER_ID]', '') +result = users.update_password( + user_id = '[USER_ID]', + password = '' +) diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 5565ee3..75e38f4 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_phone_verification('[USER_ID]', False) +result = users.update_phone_verification( + user_id = '[USER_ID]', + phone_verification = False +) diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index aabc4da..f30dba7 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_phone('[USER_ID]', '+12065550100') +result = users.update_phone( + user_id = '[USER_ID]', + number = '+12065550100' +) diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 00309a9..14ee48a 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_prefs('[USER_ID]', {}) +result = users.update_prefs( + user_id = '[USER_ID]', + prefs = {} +) diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index fcd9b94..78ffb5a 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,13 +1,13 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_status('[USER_ID]', False) +result = users.update_status( + user_id = '[USER_ID]', + status = False +) diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index be8f764..7144597 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,13 +1,16 @@ from appwrite.client import Client client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.update_target('[USER_ID]', '[TARGET_ID]') +result = users.update_target( + user_id = '[USER_ID]', + target_id = '[TARGET_ID]', + identifier = '[IDENTIFIER]', # optional + provider_id = '[PROVIDER_ID]', # optional + name = '[NAME]' # optional +) diff --git a/setup.py b/setup.py index c166efb..21b187d 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '5.0.0-rc.3', + version = '5.0.0-rc.4', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.3.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.4.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From ba88a2445869bb82528e365f0131b14d875a91d0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 25 Feb 2024 00:31:14 +1300 Subject: [PATCH 09/60] Release candidate for 1.5.x --- README.md | 6 ++--- appwrite/client.py | 17 ++++++------ appwrite/encoders/value_class_encoder.py | 4 +-- .../{encryption.py => smtp_encryption.py} | 2 +- appwrite/services/account.py | 26 ++++++++++++++++--- appwrite/services/messaging.py | 9 ++++--- ...e2f-a-challenge.md => create-challenge.md} | 2 +- docs/examples/account/create-email-token.md | 2 +- .../account/create-magic-u-r-l-token.md | 2 +- .../examples/account/create-o-auth2session.md | 1 - docs/examples/account/create-o-auth2token.md | 15 +++++++++++ docs/examples/account/create-phone-token.md | 2 +- docs/examples/account/create-session.md | 4 +-- docs/examples/account/create.md | 4 +-- docs/examples/account/delete-authenticator.md | 2 +- docs/examples/account/delete-identity.md | 2 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/update-challenge.md | 4 +-- .../account/update-magic-u-r-l-session.md | 4 +-- docs/examples/account/update-name.md | 2 +- .../account/update-phone-verification.md | 4 +-- docs/examples/account/update-recovery.md | 4 +-- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-verification.md | 4 +-- docs/examples/account/verify-authenticator.md | 2 +- docs/examples/avatars/get-initials.md | 2 +- docs/examples/avatars/get-q-r.md | 2 +- .../databases/create-boolean-attribute.md | 4 +-- docs/examples/databases/create-collection.md | 6 ++--- .../databases/create-datetime-attribute.md | 4 +-- docs/examples/databases/create-document.md | 6 ++--- .../databases/create-email-attribute.md | 4 +-- .../databases/create-enum-attribute.md | 6 ++--- .../databases/create-float-attribute.md | 4 +-- docs/examples/databases/create-index.md | 4 +-- .../databases/create-integer-attribute.md | 4 +-- .../examples/databases/create-ip-attribute.md | 4 +-- .../create-relationship-attribute.md | 6 ++--- .../databases/create-string-attribute.md | 6 ++--- .../databases/create-url-attribute.md | 4 +-- docs/examples/databases/create.md | 4 +-- docs/examples/databases/delete-attribute.md | 4 +-- docs/examples/databases/delete-collection.md | 4 +-- docs/examples/databases/delete-document.md | 6 ++--- docs/examples/databases/delete-index.md | 4 +-- docs/examples/databases/delete.md | 2 +- docs/examples/databases/get-attribute.md | 4 +-- docs/examples/databases/get-collection.md | 4 +-- docs/examples/databases/get-document.md | 6 ++--- docs/examples/databases/get-index.md | 4 +-- docs/examples/databases/get.md | 2 +- docs/examples/databases/list-attributes.md | 4 +-- docs/examples/databases/list-collections.md | 4 +-- docs/examples/databases/list-documents.md | 4 +-- docs/examples/databases/list-indexes.md | 4 +-- docs/examples/databases/list.md | 2 +- .../databases/update-boolean-attribute.md | 4 +-- docs/examples/databases/update-collection.md | 6 ++--- .../databases/update-datetime-attribute.md | 4 +-- docs/examples/databases/update-document.md | 6 ++--- .../databases/update-email-attribute.md | 4 +-- .../databases/update-enum-attribute.md | 6 ++--- .../databases/update-float-attribute.md | 4 +-- .../databases/update-integer-attribute.md | 4 +-- .../examples/databases/update-ip-attribute.md | 4 +-- .../update-relationship-attribute.md | 4 +-- .../databases/update-string-attribute.md | 6 ++--- .../databases/update-url-attribute.md | 4 +-- docs/examples/databases/update.md | 4 +-- docs/examples/functions/create-build.md | 6 ++--- docs/examples/functions/create-deployment.md | 6 ++--- docs/examples/functions/create-execution.md | 6 ++--- docs/examples/functions/create-variable.md | 6 ++--- docs/examples/functions/create.md | 24 ++++++++--------- docs/examples/functions/delete-deployment.md | 4 +-- docs/examples/functions/delete-variable.md | 4 +-- docs/examples/functions/delete.md | 2 +- .../examples/functions/download-deployment.md | 4 +-- docs/examples/functions/get-deployment.md | 4 +-- docs/examples/functions/get-execution.md | 4 +-- docs/examples/functions/get-variable.md | 4 +-- docs/examples/functions/get.md | 2 +- docs/examples/functions/list-deployments.md | 4 +-- docs/examples/functions/list-executions.md | 4 +-- docs/examples/functions/list-variables.md | 2 +- docs/examples/functions/list.md | 2 +- docs/examples/functions/update-deployment.md | 4 +-- docs/examples/functions/update-variable.md | 8 +++--- docs/examples/functions/update.md | 16 ++++++------ docs/examples/health/get-queue-databases.md | 2 +- .../messaging/create-apns-provider.md | 13 +++++----- docs/examples/messaging/create-email.md | 6 ++--- .../examples/messaging/create-fcm-provider.md | 4 +-- .../messaging/create-mailgun-provider.md | 12 ++++----- .../messaging/create-msg91provider.md | 8 +++--- docs/examples/messaging/create-push.md | 18 ++++++------- .../messaging/create-sendgrid-provider.md | 10 +++---- docs/examples/messaging/create-sms.md | 4 +-- .../messaging/create-smtp-provider.md | 18 ++++++------- docs/examples/messaging/create-subscriber.md | 6 ++--- .../messaging/create-telesign-provider.md | 8 +++--- .../messaging/create-textmagic-provider.md | 8 +++--- docs/examples/messaging/create-topic.md | 4 +-- .../messaging/create-twilio-provider.md | 8 +++--- .../messaging/create-vonage-provider.md | 8 +++--- docs/examples/messaging/delete-provider.md | 2 +- docs/examples/messaging/delete-subscriber.md | 4 +-- docs/examples/messaging/delete-topic.md | 2 +- docs/examples/messaging/delete.md | 2 +- docs/examples/messaging/get-message.md | 2 +- docs/examples/messaging/get-provider.md | 2 +- docs/examples/messaging/get-subscriber.md | 4 +-- docs/examples/messaging/get-topic.md | 2 +- docs/examples/messaging/list-message-logs.md | 2 +- docs/examples/messaging/list-messages.md | 2 +- docs/examples/messaging/list-provider-logs.md | 2 +- docs/examples/messaging/list-providers.md | 2 +- .../messaging/list-subscriber-logs.md | 2 +- docs/examples/messaging/list-subscribers.md | 4 +-- docs/examples/messaging/list-targets.md | 2 +- docs/examples/messaging/list-topic-logs.md | 2 +- docs/examples/messaging/list-topics.md | 2 +- ...-s-provider.md => update-apns-provider.md} | 13 +++++----- docs/examples/messaging/update-email.md | 6 ++--- ...c-m-provider.md => update-fcm-provider.md} | 4 +-- .../messaging/update-mailgun-provider.md | 14 +++++----- .../messaging/update-msg91provider.md | 10 +++---- docs/examples/messaging/update-push.md | 16 ++++++------ .../messaging/update-sendgrid-provider.md | 12 ++++----- docs/examples/messaging/update-sms.md | 4 +-- .../messaging/update-smtp-provider.md | 20 +++++++------- .../messaging/update-telesign-provider.md | 10 +++---- .../messaging/update-textmagic-provider.md | 10 +++---- docs/examples/messaging/update-topic.md | 5 ++-- .../messaging/update-twilio-provider.md | 10 +++---- .../messaging/update-vonage-provider.md | 10 +++---- docs/examples/storage/create-bucket.md | 4 +-- docs/examples/storage/create-file.md | 4 +-- docs/examples/storage/delete-bucket.md | 2 +- docs/examples/storage/delete-file.md | 4 +-- docs/examples/storage/get-bucket.md | 2 +- docs/examples/storage/get-file-download.md | 4 +-- docs/examples/storage/get-file-preview.md | 4 +-- docs/examples/storage/get-file-view.md | 4 +-- docs/examples/storage/get-file.md | 4 +-- docs/examples/storage/list-buckets.md | 2 +- docs/examples/storage/list-files.md | 4 +-- docs/examples/storage/update-bucket.md | 4 +-- docs/examples/storage/update-file.md | 6 ++--- docs/examples/teams/create-membership.md | 6 ++--- docs/examples/teams/create.md | 4 +-- docs/examples/teams/delete-membership.md | 4 +-- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 4 +-- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-memberships.md | 4 +-- docs/examples/teams/list.md | 2 +- .../teams/update-membership-status.md | 8 +++--- docs/examples/teams/update-membership.md | 4 +-- docs/examples/teams/update-name.md | 4 +-- docs/examples/teams/update-prefs.md | 2 +- docs/examples/users/create-argon2user.md | 4 +-- docs/examples/users/create-bcrypt-user.md | 4 +-- docs/examples/users/create-m-d5user.md | 4 +-- docs/examples/users/create-p-h-pass-user.md | 4 +-- docs/examples/users/create-s-h-a-user.md | 4 +-- .../users/create-scrypt-modified-user.md | 10 +++---- docs/examples/users/create-scrypt-user.md | 6 ++--- docs/examples/users/create-session.md | 2 +- docs/examples/users/create-target.md | 10 +++---- docs/examples/users/create-token.md | 2 +- docs/examples/users/create.md | 4 +-- docs/examples/users/delete-authenticator.md | 4 +-- docs/examples/users/delete-identity.md | 2 +- docs/examples/users/delete-session.md | 4 +-- docs/examples/users/delete-sessions.md | 2 +- docs/examples/users/delete-target.md | 4 +-- docs/examples/users/delete.md | 2 +- docs/examples/users/get-prefs.md | 2 +- docs/examples/users/get-target.md | 4 +-- docs/examples/users/get.md | 2 +- docs/examples/users/list-factors.md | 2 +- docs/examples/users/list-identities.md | 2 +- docs/examples/users/list-logs.md | 2 +- docs/examples/users/list-memberships.md | 2 +- docs/examples/users/list-sessions.md | 2 +- docs/examples/users/list-targets.md | 2 +- docs/examples/users/list.md | 2 +- .../users/update-email-verification.md | 2 +- docs/examples/users/update-email.md | 2 +- docs/examples/users/update-labels.md | 2 +- docs/examples/users/update-mfa.md | 2 +- docs/examples/users/update-name.md | 4 +-- docs/examples/users/update-password.md | 2 +- .../users/update-phone-verification.md | 2 +- docs/examples/users/update-phone.md | 2 +- docs/examples/users/update-prefs.md | 2 +- docs/examples/users/update-status.md | 2 +- docs/examples/users/update-target.md | 10 +++---- setup.py | 4 +-- 202 files changed, 509 insertions(+), 472 deletions(-) rename appwrite/enums/{encryption.py => smtp_encryption.py} (72%) rename docs/examples/account/{create2f-a-challenge.md => create-challenge.md} (88%) create mode 100644 docs/examples/account/create-o-auth2token.md rename docs/examples/messaging/{update-a-p-n-s-provider.md => update-apns-provider.md} (57%) rename docs/examples/messaging/{update-f-c-m-provider.md => update-fcm-provider.md} (85%) diff --git a/README.md b/README.md index fdaf33e..7f258e3 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Once your SDK object is set, create any of the Appwrite service objects and choo ```python users = Users(client) -result = users.create('[USER_ID]', 'email@example.com', 'password') +result = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien") ``` ### Full Example @@ -66,7 +66,7 @@ client = Client() users = Users(client) -result = users.create(ID.unique(), 'email@example.com', 'password') +result = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien") ``` ### Error Handling @@ -75,7 +75,7 @@ The Appwrite Python SDK raises `AppwriteException` object with `message`, `code` ```python users = Users(client) try: - result = users.create(ID.unique(), 'email@example.com', 'password') + result = users.create(ID.unique(), email = "email@example.com", phone = "+123456789", password = "password", name = "Walter O'Brien") except AppwriteException as e: print(e.message) ``` diff --git a/appwrite/client.py b/appwrite/client.py index e4a5aae..9db2cfe 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.4 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.5 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.0-rc.4', + 'x-sdk-version': '5.0.0-rc.5', 'X-Appwrite-Response-Format' : '1.5.0', } @@ -61,19 +61,13 @@ def set_session(self, value): self._global_headers['x-appwrite-session'] = value return self - def set_forwarded_for(self, value): - """The IP address of the client that made the request""" - - self._global_headers['x-forwarded-for'] = value - return self - def set_forwarded_user_agent(self, value): """The user agent string of the client that made the request""" self._global_headers['x-forwarded-user-agent'] = value return self - def call(self, method, path='', headers=None, params=None): + def call(self, method, path='', headers=None, params=None, response_type='json'): if headers is None: headers = {} @@ -103,6 +97,7 @@ def call(self, method, path='', headers=None, params=None): files[key] = (data[key].filename, data[key].data) del data[key] data = self.flatten(data, stringify=stringify) + response = None try: response = requests.request( # call method dynamically https://stackoverflow.com/a/4246075/2299554 @@ -113,12 +108,16 @@ def call(self, method, path='', headers=None, params=None): files=files, headers=headers, verify=(not self._self_signed), + allow_redirects=False if response_type == 'location' else True ) response.raise_for_status() content_type = response.headers['Content-Type'] + if response_type == 'location': + return response.headers.get('Location') + if content_type.startswith('application/json'): return response.json() diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py index 88c7451..b299023 100644 --- a/appwrite/encoders/value_class_encoder.py +++ b/appwrite/encoders/value_class_encoder.py @@ -12,7 +12,7 @@ from ..enums.execution_method import ExecutionMethod from ..enums.name import Name from ..enums.message_status import MessageStatus -from ..enums.encryption import Encryption +from ..enums.smtp_encryption import SmtpEncryption from ..enums.compression import Compression from ..enums.image_gravity import ImageGravity from ..enums.image_format import ImageFormat @@ -60,7 +60,7 @@ def default(self, o): if isinstance(o, MessageStatus): return o.value - if isinstance(o, Encryption): + if isinstance(o, SmtpEncryption): return o.value if isinstance(o, Compression): diff --git a/appwrite/enums/encryption.py b/appwrite/enums/smtp_encryption.py similarity index 72% rename from appwrite/enums/encryption.py rename to appwrite/enums/smtp_encryption.py index 4850cc1..213330e 100644 --- a/appwrite/enums/encryption.py +++ b/appwrite/enums/smtp_encryption.py @@ -1,6 +1,6 @@ from enum import Enum -class Encryption(Enum): +class SmtpEncryption(Enum): NONE = "none" SSL = "ssl" TLS = "tls" diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 153cf15..3b1b088 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -131,7 +131,7 @@ def update_mfa(self, mfa): 'content-type': 'application/json', }, api_params) - def create2_fa_challenge(self, factor): + def create_challenge(self, factor): """Create 2FA Challenge""" @@ -431,7 +431,7 @@ def update_magic_url_session(self, user_id, secret): 'content-type': 'application/json', }, api_params) - def create_o_auth2_session(self, provider, success = None, failure = None, token = None, scopes = None): + def create_o_auth2_session(self, provider, success = None, failure = None, scopes = None): """Create OAuth2 session""" @@ -444,12 +444,11 @@ def create_o_auth2_session(self, provider, success = None, failure = None, token api_params['success'] = success api_params['failure'] = failure - api_params['token'] = token api_params['scopes'] = scopes return self.client.call('get', api_path, { 'content-type': 'application/json', - }, api_params) + }, api_params, response_type='location') def create_session(self, user_id, secret): """Create session""" @@ -573,6 +572,25 @@ def create_magic_url_token(self, user_id, email, url = None, phrase = None): 'content-type': 'application/json', }, api_params) + def create_o_auth2_token(self, provider, success = None, failure = None, scopes = None): + """Create OAuth2 token""" + + + api_path = '/account/tokens/oauth2/{provider}' + api_params = {} + if provider is None: + raise AppwriteException('Missing required parameter: "provider"') + + api_path = api_path.replace('{provider}', provider) + + api_params['success'] = success + api_params['failure'] = failure + api_params['scopes'] = scopes + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params, response_type='location') + def create_phone_token(self, user_id, phone): """Create phone token""" diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 58379b4..e8b701a 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -274,7 +274,7 @@ def list_providers(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, enabled = None): + def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, sandbox = None, enabled = None): """Create APNS provider""" @@ -293,13 +293,14 @@ def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = api_params['authKeyId'] = auth_key_id api_params['teamId'] = team_id api_params['bundleId'] = bundle_id + api_params['sandbox'] = sandbox api_params['enabled'] = enabled return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def update_apns_provider(self, provider_id, name = None, enabled = None, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None): + def update_apns_provider(self, provider_id, name = None, enabled = None, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, sandbox = None): """Update APNS provider""" @@ -316,6 +317,7 @@ def update_apns_provider(self, provider_id, name = None, enabled = None, auth_ke api_params['authKeyId'] = auth_key_id api_params['teamId'] = team_id api_params['bundleId'] = bundle_id + api_params['sandbox'] = sandbox return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -870,7 +872,7 @@ def get_topic(self, topic_id): 'content-type': 'application/json', }, api_params) - def update_topic(self, topic_id, name = None): + def update_topic(self, topic_id, name = None, subscribe = None): """Update a topic""" @@ -882,6 +884,7 @@ def update_topic(self, topic_id, name = None): api_path = api_path.replace('{topicId}', topic_id) api_params['name'] = name + api_params['subscribe'] = subscribe return self.client.call('patch', api_path, { 'content-type': 'application/json', diff --git a/docs/examples/account/create2f-a-challenge.md b/docs/examples/account/create-challenge.md similarity index 88% rename from docs/examples/account/create2f-a-challenge.md rename to docs/examples/account/create-challenge.md index 60141a5..6952fae 100644 --- a/docs/examples/account/create2f-a-challenge.md +++ b/docs/examples/account/create-challenge.md @@ -7,6 +7,6 @@ client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create2_fa_challenge( +result = account.create_challenge( factor = AuthenticationFactor.TOTP ) diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 090bfd5..a283f42 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -7,7 +7,7 @@ client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) result = account.create_email_token( - user_id = '[USER_ID]', + user_id = '', email = 'email@example.com', phrase = False # optional ) diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index c43cfaf..1f6593b 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -7,7 +7,7 @@ client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) result = account.create_magic_url_token( - user_id = '[USER_ID]', + user_id = '', email = 'email@example.com', url = 'https://example.com', # optional phrase = False # optional diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md index 948a35b..341087f 100644 --- a/docs/examples/account/create-o-auth2session.md +++ b/docs/examples/account/create-o-auth2session.md @@ -11,6 +11,5 @@ result = account.create_o_auth2_session( provider = OAuthProvider.AMAZON, success = 'https://example.com', # optional failure = 'https://example.com', # optional - token = False, # optional scopes = [] # optional ) diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md new file mode 100644 index 0000000..96c0f88 --- /dev/null +++ b/docs/examples/account/create-o-auth2token.md @@ -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('5df5acd0d48c2') # 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 +) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 00cd40c..b7597df 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -7,6 +7,6 @@ client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) result = account.create_phone_token( - user_id = '[USER_ID]', + user_id = '', phone = '+12065550100' ) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index e363222..118a1ab 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -7,6 +7,6 @@ client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) result = account.create_session( - user_id = '[USER_ID]', - secret = '[SECRET]' + user_id = '', + secret = '' ) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index efc1b55..d165697 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -7,8 +7,8 @@ client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) result = account.create( - user_id = '[USER_ID]', + user_id = '', email = 'email@example.com', password = '', - name = '[NAME]' # optional + name = '' # optional ) diff --git a/docs/examples/account/delete-authenticator.md b/docs/examples/account/delete-authenticator.md index f7a74e8..6539a4f 100644 --- a/docs/examples/account/delete-authenticator.md +++ b/docs/examples/account/delete-authenticator.md @@ -10,5 +10,5 @@ account = Account(client) result = account.delete_authenticator( type = AuthenticatorType.TOTP, - otp = '[OTP]' + otp = '' ) diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index e6520c3..1462fbc 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -8,5 +8,5 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.delete_identity( - identity_id = '[IDENTITY_ID]' + identity_id = '' ) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 3452eb8..030d698 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -8,5 +8,5 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.delete_session( - session_id = '[SESSION_ID]' + session_id = '' ) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 4d191ea..b9483ac 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -8,5 +8,5 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.get_session( - session_id = '[SESSION_ID]' + session_id = '' ) diff --git a/docs/examples/account/update-challenge.md b/docs/examples/account/update-challenge.md index 8a28538..b9aa186 100644 --- a/docs/examples/account/update-challenge.md +++ b/docs/examples/account/update-challenge.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.update_challenge( - challenge_id = '[CHALLENGE_ID]', - otp = '[OTP]' + challenge_id = '', + otp = '' ) diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index 7676d4f..631fac0 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -7,6 +7,6 @@ client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) result = account.update_magic_url_session( - user_id = '[USER_ID]', - secret = '[SECRET]' + user_id = '', + secret = '' ) diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index f837534..8e16f49 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -8,5 +8,5 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.update_name( - name = '[NAME]' + name = '' ) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 46d8808..adb5b35 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.update_phone_verification( - user_id = '[USER_ID]', - secret = '[SECRET]' + user_id = '', + secret = '' ) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 286fb38..4dca711 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.update_recovery( - user_id = '[USER_ID]', - secret = '[SECRET]', + user_id = '', + secret = '', password = '' ) diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 2e0bfaa..006c508 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -8,5 +8,5 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.update_session( - session_id = '[SESSION_ID]' + session_id = '' ) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index a1bcd4c..84c8c4b 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.update_verification( - user_id = '[USER_ID]', - secret = '[SECRET]' + user_id = '', + secret = '' ) diff --git a/docs/examples/account/verify-authenticator.md b/docs/examples/account/verify-authenticator.md index 769e0d7..e0a26a3 100644 --- a/docs/examples/account/verify-authenticator.md +++ b/docs/examples/account/verify-authenticator.md @@ -10,5 +10,5 @@ account = Account(client) result = account.verify_authenticator( type = AuthenticatorType.TOTP, - otp = '[OTP]' + otp = '' ) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 915d430..0a20c14 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) result = avatars.get_initials( - name = '[NAME]', # optional + name = '', # optional width = 0, # optional height = 0, # optional background = '' # optional diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index c719750..bee29f7 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) result = avatars.get_qr( - text = '[TEXT]', + text = '', size = 1, # optional margin = 0, # optional download = False # optional diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 1b97943..bf09562 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_boolean_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = False, # optional diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index e82f774..dfe3611 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -8,9 +8,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_collection( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', - name = '[NAME]', + database_id = '', + collection_id = '', + name = '', permissions = ["read("any")"], # optional document_security = False, # optional enabled = False # optional diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index cd108f9..0b8a555 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_datetime_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = '', # optional diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index a67091f..a457811 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -8,9 +8,9 @@ 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]', + database_id = '', + collection_id = '', + document_id = '', data = {}, permissions = ["read("any")"] # optional ) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index edcf4ab..840e6b5 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_email_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = 'email@example.com', # optional diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index b12b2ee..0e891d5 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -8,11 +8,11 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_enum_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', elements = [], required = False, - default = '[DEFAULT]', # optional + default = '', # optional array = False # optional ) diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 639ed4b..34fda4f 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_float_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, min = None, # optional diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index e68d32e..72fe622 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -9,8 +9,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_index( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', type = IndexType.KEY, attributes = [], diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 730f334..057cfb7 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_integer_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, min = None, # optional diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 00ab05b..54e887c 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_ip_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = '', # optional diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index c48da10..791877f 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -9,9 +9,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # 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]', + database_id = '', + collection_id = '', + related_collection_id = '', type = RelationshipType.ONE_TO_ONE, two_way = False, # optional key = '', # optional diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index c94736c..c15512a 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -8,12 +8,12 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_string_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', size = 1, required = False, - default = '[DEFAULT]', # optional + default = '', # optional array = False, # optional encrypt = False # optional ) diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index ea061da..f77a630 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create_url_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = 'https://example.com', # optional diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index a71a0c5..329e653 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.create( - database_id = '[DATABASE_ID]', - name = '[NAME]', + database_id = '', + name = '', enabled = False # optional ) diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index b7d3438..87fcf57 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.delete_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '' ) diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index d353922..296c69d 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.delete_collection( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]' + database_id = '', + collection_id = '' ) diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 8d457aa..3191f10 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -8,7 +8,7 @@ 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]' + database_id = '', + collection_id = '', + document_id = '' ) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 3131a7b..bd4fcf5 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.delete_index( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '' ) diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index fe3e973..302a652 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.delete( - database_id = '[DATABASE_ID]' + database_id = '' ) diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index f4990d7..8316fe7 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.get_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '' ) diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index b8935c4..7b0c7e4 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.get_collection( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]' + database_id = '', + collection_id = '' ) diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 15cb6e4..978c5a5 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -8,8 +8,8 @@ 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]', + database_id = '', + collection_id = '', + document_id = '', queries = [] # optional ) diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 2d354f5..e53878c 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.get_index( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '' ) diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index bf125a1..b12f7d8 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.get( - database_id = '[DATABASE_ID]' + database_id = '' ) diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index d174bf0..4628394 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.list_attributes( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', queries = [] # optional ) diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 7e66bab..0ceed95 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.list_collections( - database_id = '[DATABASE_ID]', + database_id = '', queries = [], # optional - search = '[SEARCH]' # optional + search = '' # optional ) diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 5379a81..08f3c89 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with databases = Databases(client) result = databases.list_documents( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', queries = [] # optional ) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 0c35f6c..05a9e15 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.list_indexes( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', queries = [] # optional ) diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 2f87238..8ba8b28 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -9,5 +9,5 @@ databases = Databases(client) result = databases.list( queries = [], # optional - search = '[SEARCH]' # optional + search = '' # optional ) diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index fc5f101..8cf9bc8 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_boolean_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = False diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 3cc2321..9f0615f 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -8,9 +8,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_collection( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', - name = '[NAME]', + database_id = '', + collection_id = '', + name = '', permissions = ["read("any")"], # optional document_security = False, # optional enabled = False # optional diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 9c4cafa..5541dd4 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_datetime_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = '' diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 6671149..37c1b43 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -8,9 +8,9 @@ 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]', + database_id = '', + collection_id = '', + document_id = '', data = {}, # optional permissions = ["read("any")"] # optional ) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 97be2de..cedde9d 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_email_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = 'email@example.com' diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 5587158..76ede75 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_enum_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', elements = [], required = False, - default = '[DEFAULT]' + default = '' ) diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index b101782..1556e03 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_float_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, min = None, diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 53b792b..37a87ed 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_integer_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, min = None, diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index c858a93..d6df600 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_ip_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = '' diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 98b0d71..8c9fb45 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_relationship_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', on_delete = RelationMutate.CASCADE # optional ) diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index d4f3ee6..d765acf 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -8,9 +8,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_string_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, - default = '[DEFAULT]' + default = '' ) diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index fd56cfc..3a6347c 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update_url_attribute( - database_id = '[DATABASE_ID]', - collection_id = '[COLLECTION_ID]', + database_id = '', + collection_id = '', key = '', required = False, default = 'https://example.com' diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index ccc0e9c..ab6227f 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key databases = Databases(client) result = databases.update( - database_id = '[DATABASE_ID]', - name = '[NAME]', + database_id = '', + name = '', enabled = False # optional ) diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index d816f8b..f3422f3 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.create_build( - function_id = '[FUNCTION_ID]', - deployment_id = '[DEPLOYMENT_ID]', - build_id = '[BUILD_ID]' + function_id = '', + deployment_id = '', + build_id = '' ) diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 139acb5..68ae7a9 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -9,9 +9,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.create_deployment( - function_id = '[FUNCTION_ID]', + function_id = '', code = InputFile.from_path('file.png'), activate = False, - entrypoint = '[ENTRYPOINT]', # optional - commands = '[COMMANDS]' # optional + entrypoint = '', # optional + commands = '' # optional ) diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 964c16a..46c64b2 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -8,10 +8,10 @@ client.set_session('') # The user session to authenticate with functions = Functions(client) result = functions.create_execution( - function_id = '[FUNCTION_ID]', - body = '[BODY]', # optional + function_id = '', + body = '', # optional async = False, # optional - path = '[PATH]', # optional + path = '', # optional method = ExecutionMethod.GET, # optional headers = {} # optional ) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 6b6bd2f..6b4e955 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.create_variable( - function_id = '[FUNCTION_ID]', - key = '[KEY]', - value = '[VALUE]' + function_id = '', + key = '', + value = '' ) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index ed4ab10..8069a2b 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -9,8 +9,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.create( - function_id = '[FUNCTION_ID]', - name = '[NAME]', + function_id = '', + name = '', runtime = .NODE-14.5, execute = ["any"], # optional events = [], # optional @@ -18,15 +18,15 @@ result = functions.create( timeout = 1, # optional enabled = False, # optional logging = False, # optional - entrypoint = '[ENTRYPOINT]', # optional - commands = '[COMMANDS]', # optional - installation_id = '[INSTALLATION_ID]', # optional - provider_repository_id = '[PROVIDER_REPOSITORY_ID]', # optional - provider_branch = '[PROVIDER_BRANCH]', # optional + entrypoint = '', # optional + commands = '', # optional + installation_id = '', # optional + provider_repository_id = '', # optional + 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 + provider_root_directory = '', # optional + template_repository = '', # optional + template_owner = '', # optional + template_root_directory = '', # optional + template_branch = '' # optional ) diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 49d4645..def007b 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.delete_deployment( - function_id = '[FUNCTION_ID]', - deployment_id = '[DEPLOYMENT_ID]' + function_id = '', + deployment_id = '' ) diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 8e1144b..96f1304 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.delete_variable( - function_id = '[FUNCTION_ID]', - variable_id = '[VARIABLE_ID]' + function_id = '', + variable_id = '' ) diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 551fade..7e20857 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.delete( - function_id = '[FUNCTION_ID]' + function_id = '' ) diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/download-deployment.md index 915cd11..91c1fac 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/download-deployment.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.download_deployment( - function_id = '[FUNCTION_ID]', - deployment_id = '[DEPLOYMENT_ID]' + function_id = '', + deployment_id = '' ) diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 957d5d3..e2b8e3f 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.get_deployment( - function_id = '[FUNCTION_ID]', - deployment_id = '[DEPLOYMENT_ID]' + function_id = '', + deployment_id = '' ) diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 67f2b5d..04be41b 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with functions = Functions(client) result = functions.get_execution( - function_id = '[FUNCTION_ID]', - execution_id = '[EXECUTION_ID]' + function_id = '', + execution_id = '' ) diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 3f22537..2115700 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.get_variable( - function_id = '[FUNCTION_ID]', - variable_id = '[VARIABLE_ID]' + function_id = '', + variable_id = '' ) diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 9bb505c..f630486 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.get( - function_id = '[FUNCTION_ID]' + function_id = '' ) diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index aeed916..c681463 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.list_deployments( - function_id = '[FUNCTION_ID]', + function_id = '', queries = [], # optional - search = '[SEARCH]' # optional + search = '' # optional ) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 8c6cbc9..50dc7cb 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with functions = Functions(client) result = functions.list_executions( - function_id = '[FUNCTION_ID]', + function_id = '', queries = [], # optional - search = '[SEARCH]' # optional + search = '' # optional ) diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 83e93c5..cfd0b64 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.list_variables( - function_id = '[FUNCTION_ID]' + function_id = '' ) diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 7a2bd24..bc4fc21 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -9,5 +9,5 @@ functions = Functions(client) result = functions.list( queries = [], # optional - search = '[SEARCH]' # optional + search = '' # optional ) diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index d1e1079..59e183e 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.update_deployment( - function_id = '[FUNCTION_ID]', - deployment_id = '[DEPLOYMENT_ID]' + function_id = '', + deployment_id = '' ) diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index e8ce4c0..3fb73e0 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.update_variable( - function_id = '[FUNCTION_ID]', - variable_id = '[VARIABLE_ID]', - key = '[KEY]', - value = '[VALUE]' # optional + function_id = '', + variable_id = '', + key = '', + value = '' # optional ) diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index f005f01..4131c23 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Functions(client) result = functions.update( - function_id = '[FUNCTION_ID]', - name = '[NAME]', + function_id = '', + name = '', runtime = .NODE-14.5, # optional execute = ["any"], # optional events = [], # optional @@ -17,11 +17,11 @@ result = functions.update( timeout = 1, # optional enabled = False, # optional logging = False, # optional - entrypoint = '[ENTRYPOINT]', # optional - commands = '[COMMANDS]', # optional - installation_id = '[INSTALLATION_ID]', # optional - provider_repository_id = '[PROVIDER_REPOSITORY_ID]', # optional - provider_branch = '[PROVIDER_BRANCH]', # optional + entrypoint = '', # optional + commands = '', # optional + installation_id = '', # optional + provider_repository_id = '', # optional + provider_branch = '', # optional provider_silent_mode = False, # optional - provider_root_directory = '[PROVIDER_ROOT_DIRECTORY]' # optional + provider_root_directory = '' # optional ) diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 06d0ba9..936266c 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) result = health.get_queue_databases( - name = '[NAME]', # optional + name = '', # optional threshold = None # optional ) diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index d33cc52..287472f 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -8,11 +8,12 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_apns_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', - auth_key = '[AUTH_KEY]', # optional - auth_key_id = '[AUTH_KEY_ID]', # optional - team_id = '[TEAM_ID]', # optional - bundle_id = '[BUNDLE_ID]', # optional + provider_id = '', + name = '', + auth_key = '', # optional + auth_key_id = '', # optional + team_id = '', # optional + bundle_id = '', # optional + sandbox = False, # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index dc2fa36..9747077 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -8,9 +8,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_email( - message_id = '[MESSAGE_ID]', - subject = '[SUBJECT]', - content = '[CONTENT]', + message_id = '', + subject = '', + content = '', topics = [], # optional users = [], # optional targets = [], # optional diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 7bcbc4e..43c882b 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_fcm_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', + provider_id = '', + name = '', service_account_json = {}, # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index e5cdc72..38eb415 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -8,14 +8,14 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_mailgun_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', - api_key = '[API_KEY]', # optional - domain = '[DOMAIN]', # optional + provider_id = '', + name = '', + api_key = '', # optional + domain = '', # optional is_eu_region = False, # optional - from_name = '[FROM_NAME]', # optional + from_name = '', # optional from_email = 'email@example.com', # optional - reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_name = '', # optional reply_to_email = 'email@example.com', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 5ebf23a..3ce1446 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_msg91_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', + provider_id = '', + name = '', from = '+12065550100', # optional - sender_id = '[SENDER_ID]', # optional - auth_key = '[AUTH_KEY]', # optional + sender_id = '', # optional + auth_key = '', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index e941921..1dc49d6 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -8,20 +8,20 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_push( - message_id = '[MESSAGE_ID]', - title = '[TITLE]', - body = '[BODY]', + message_id = '', + title = '', + body = '<BODY>', topics = [], # optional users = [], # optional targets = [], # optional data = {}, # optional - action = '[ACTION]', # optional + action = '<ACTION>', # optional image = '[ID1:ID2]', # optional - icon = '[ICON]', # optional - sound = '[SOUND]', # optional - color = '[COLOR]', # optional - tag = '[TAG]', # optional - badge = '[BADGE]', # optional + icon = '<ICON>', # optional + sound = '<SOUND>', # optional + color = '<COLOR>', # optional + tag = '<TAG>', # optional + badge = '<BADGE>', # optional status = MessageStatus.DRAFT, # optional scheduled_at = '' # optional ) diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 622e00e..e22dad8 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -8,12 +8,12 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_sendgrid_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', - api_key = '[API_KEY]', # optional - from_name = '[FROM_NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + api_key = '<API_KEY>', # optional + from_name = '<FROM_NAME>', # optional from_email = 'email@example.com', # optional - reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional reply_to_email = 'email@example.com', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index a1fcb07..324ed5f 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_sms( - message_id = '[MESSAGE_ID]', - content = '[CONTENT]', + message_id = '<MESSAGE_ID>', + content = '<CONTENT>', topics = [], # optional users = [], # optional targets = [], # optional diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index a7a5612..b3b299b 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -8,18 +8,18 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_smtp_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', - host = '[HOST]', + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + host = '<HOST>', port = 1, # optional - username = '[USERNAME]', # optional - password = '[PASSWORD]', # optional - encryption = .NONE, # optional + username = '<USERNAME>', # optional + password = '<PASSWORD>', # optional + encryption = SmtpEncryption.NONE, # optional auto_tls = False, # optional - mailer = '[MAILER]', # optional - from_name = '[FROM_NAME]', # optional + mailer = '<MAILER>', # optional + from_name = '<FROM_NAME>', # optional from_email = 'email@example.com', # optional - reply_to_name = '[REPLY_TO_NAME]', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional reply_to_email = 'email@example.com', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index a08f397..d6ffd09 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -8,7 +8,7 @@ client.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON messaging = Messaging(client) result = messaging.create_subscriber( - topic_id = '[TOPIC_ID]', - subscriber_id = '[SUBSCRIBER_ID]', - target_id = '[TARGET_ID]' + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>', + target_id = '<TARGET_ID>' ) diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 8006f2a..b1fbab3 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_telesign_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', + provider_id = '<PROVIDER_ID>', + name = '<NAME>', from = '+12065550100', # optional - customer_id = '[CUSTOMER_ID]', # optional - api_key = '[API_KEY]', # optional + customer_id = '<CUSTOMER_ID>', # optional + api_key = '<API_KEY>', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index e358b75..bd251d9 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_textmagic_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', + provider_id = '<PROVIDER_ID>', + name = '<NAME>', from = '+12065550100', # optional - username = '[USERNAME]', # optional - api_key = '[API_KEY]', # optional + username = '<USERNAME>', # optional + api_key = '<API_KEY>', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index ad612d6..e8532b2 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_topic( - topic_id = '[TOPIC_ID]', - name = '[NAME]', + topic_id = '<TOPIC_ID>', + name = '<NAME>', subscribe = ["any"] # optional ) diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index eb6ff37..3535fd0 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_twilio_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', + provider_id = '<PROVIDER_ID>', + name = '<NAME>', from = '+12065550100', # optional - account_sid = '[ACCOUNT_SID]', # optional - auth_token = '[AUTH_TOKEN]', # optional + account_sid = '<ACCOUNT_SID>', # optional + auth_token = '<AUTH_TOKEN>', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 041d7f8..6078096 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_vonage_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', + provider_id = '<PROVIDER_ID>', + name = '<NAME>', from = '+12065550100', # optional - api_key = '[API_KEY]', # optional - api_secret = '[API_SECRET]', # optional + api_key = '<API_KEY>', # optional + api_secret = '<API_SECRET>', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index cb65226..58e1684 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.delete_provider( - provider_id = '[PROVIDER_ID]' + provider_id = '<PROVIDER_ID>' ) diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 84dca4d..4988d06 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -8,6 +8,6 @@ client.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON messaging = Messaging(client) result = messaging.delete_subscriber( - topic_id = '[TOPIC_ID]', - subscriber_id = '[SUBSCRIBER_ID]' + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>' ) diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index b035a89..769df6e 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.delete_topic( - topic_id = '[TOPIC_ID]' + topic_id = '<TOPIC_ID>' ) diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 6c19557..a25e80b 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.delete( - message_id = '[MESSAGE_ID]' + message_id = '<MESSAGE_ID>' ) diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 12b14fe..db6506e 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.get_message( - message_id = '[MESSAGE_ID]' + message_id = '<MESSAGE_ID>' ) diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index ca00786..3e71e95 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.get_provider( - provider_id = '[PROVIDER_ID]' + provider_id = '<PROVIDER_ID>' ) diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index e2f105f..e8bb030 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.get_subscriber( - topic_id = '[TOPIC_ID]', - subscriber_id = '[SUBSCRIBER_ID]' + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>' ) diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index a4eb54e..a5e9e7b 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.get_topic( - topic_id = '[TOPIC_ID]' + topic_id = '<TOPIC_ID>' ) diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 36beb11..1cfbb2e 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.list_message_logs( - message_id = '[MESSAGE_ID]', + message_id = '<MESSAGE_ID>', queries = [] # optional ) diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index c070081..4292733 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -9,5 +9,5 @@ messaging = Messaging(client) result = messaging.list_messages( queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index b1ce05b..be2f735 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.list_provider_logs( - provider_id = '[PROVIDER_ID]', + provider_id = '<PROVIDER_ID>', queries = [] # optional ) diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index dfb9cda..477c3b2 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -9,5 +9,5 @@ messaging = Messaging(client) result = messaging.list_providers( queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 4acf7d8..744b53f 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.list_subscriber_logs( - subscriber_id = '[SUBSCRIBER_ID]', + subscriber_id = '<SUBSCRIBER_ID>', queries = [] # optional ) diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 7fddddc..ec8ef1d 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.list_subscribers( - topic_id = '[TOPIC_ID]', + topic_id = '<TOPIC_ID>', queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index a05bda9..7ccc6f9 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.list_targets( - message_id = '[MESSAGE_ID]', + message_id = '<MESSAGE_ID>', queries = [] # optional ) diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 7448c19..4813049 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.list_topic_logs( - topic_id = '[TOPIC_ID]', + topic_id = '<TOPIC_ID>', queries = [] # optional ) diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 491e317..6bae445 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -9,5 +9,5 @@ messaging = Messaging(client) result = messaging.list_topics( queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-apns-provider.md similarity index 57% rename from docs/examples/messaging/update-a-p-n-s-provider.md rename to docs/examples/messaging/update-apns-provider.md index 02b9dd8..4e3f998 100644 --- a/docs/examples/messaging/update-a-p-n-s-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -8,11 +8,12 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_apns_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional enabled = False, # optional - auth_key = '[AUTH_KEY]', # optional - auth_key_id = '[AUTH_KEY_ID]', # optional - team_id = '[TEAM_ID]', # optional - bundle_id = '[BUNDLE_ID]' # optional + auth_key = '<AUTH_KEY>', # optional + auth_key_id = '<AUTH_KEY_ID>', # optional + team_id = '<TEAM_ID>', # optional + bundle_id = '<BUNDLE_ID>', # optional + sandbox = False # optional ) diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 3a9c08a..5f762d0 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -8,12 +8,12 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_email( - message_id = '[MESSAGE_ID]', + message_id = '<MESSAGE_ID>', topics = [], # optional users = [], # optional targets = [], # optional - subject = '[SUBJECT]', # optional - content = '[CONTENT]', # optional + subject = '<SUBJECT>', # optional + content = '<CONTENT>', # optional status = MessageStatus.DRAFT, # optional html = False, # optional cc = [], # optional diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-fcm-provider.md similarity index 85% rename from docs/examples/messaging/update-f-c-m-provider.md rename to docs/examples/messaging/update-fcm-provider.md index e767772..d2179b6 100644 --- a/docs/examples/messaging/update-f-c-m-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_fcm_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional enabled = False, # optional service_account_json = {} # optional ) diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 0279932..d04c617 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -8,14 +8,14 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_mailgun_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional - api_key = '[API_KEY]', # optional - domain = '[DOMAIN]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + api_key = '<API_KEY>', # optional + domain = '<DOMAIN>', # optional is_eu_region = False, # optional enabled = False, # optional - from_name = '[FROM_NAME]', # optional + from_name = '<FROM_NAME>', # optional from_email = 'email@example.com', # optional - reply_to_name = '[REPLY_TO_NAME]', # optional - reply_to_email = '[REPLY_TO_EMAIL]' # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>' # optional ) diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 34494dc..2f88686 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_msg91_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional enabled = False, # optional - sender_id = '[SENDER_ID]', # optional - auth_key = '[AUTH_KEY]', # optional - from = '[FROM]' # optional + sender_id = '<SENDER_ID>', # optional + auth_key = '<AUTH_KEY>', # optional + from = '<FROM>' # optional ) diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index f71bc44..23f449e 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -8,19 +8,19 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_push( - message_id = '[MESSAGE_ID]', + message_id = '<MESSAGE_ID>', topics = [], # optional users = [], # optional targets = [], # optional - title = '[TITLE]', # optional - body = '[BODY]', # optional + title = '<TITLE>', # optional + body = '<BODY>', # optional data = {}, # optional - action = '[ACTION]', # optional + action = '<ACTION>', # optional image = '[ID1:ID2]', # optional - icon = '[ICON]', # optional - sound = '[SOUND]', # optional - color = '[COLOR]', # optional - tag = '[TAG]', # optional + icon = '<ICON>', # optional + sound = '<SOUND>', # optional + color = '<COLOR>', # optional + tag = '<TAG>', # optional badge = None, # optional status = MessageStatus.DRAFT, # optional scheduled_at = '' # optional diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index b6975f8..4d10aad 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -8,12 +8,12 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_sendgrid_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional enabled = False, # optional - api_key = '[API_KEY]', # optional - from_name = '[FROM_NAME]', # optional + api_key = '<API_KEY>', # optional + from_name = '<FROM_NAME>', # optional from_email = 'email@example.com', # optional - reply_to_name = '[REPLY_TO_NAME]', # optional - reply_to_email = '[REPLY_TO_EMAIL]' # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>' # optional ) diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index ca1cdfd..e7c76c3 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -8,11 +8,11 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_sms( - message_id = '[MESSAGE_ID]', + message_id = '<MESSAGE_ID>', topics = [], # optional users = [], # optional targets = [], # optional - content = '[CONTENT]', # optional + content = '<CONTENT>', # optional status = MessageStatus.DRAFT, # optional scheduled_at = '' # optional ) diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index dd23a3e..f3a9b96 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -8,18 +8,18 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_smtp_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional - host = '[HOST]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + host = '<HOST>', # optional port = 1, # optional - username = '[USERNAME]', # optional - password = '[PASSWORD]', # optional - encryption = .NONE, # optional + username = '<USERNAME>', # optional + password = '<PASSWORD>', # optional + encryption = SmtpEncryption.NONE, # optional auto_tls = False, # optional - mailer = '[MAILER]', # optional - from_name = '[FROM_NAME]', # optional + mailer = '<MAILER>', # optional + from_name = '<FROM_NAME>', # optional from_email = 'email@example.com', # optional - reply_to_name = '[REPLY_TO_NAME]', # optional - reply_to_email = '[REPLY_TO_EMAIL]', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>', # optional enabled = False # optional ) diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index e816020..9c3c5bb 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_telesign_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional enabled = False, # optional - customer_id = '[CUSTOMER_ID]', # optional - api_key = '[API_KEY]', # optional - from = '[FROM]' # optional + customer_id = '<CUSTOMER_ID>', # optional + api_key = '<API_KEY>', # optional + from = '<FROM>' # optional ) diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index f2164ff..4da5e71 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_textmagic_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional enabled = False, # optional - username = '[USERNAME]', # optional - api_key = '[API_KEY]', # optional - from = '[FROM]' # optional + username = '<USERNAME>', # optional + api_key = '<API_KEY>', # optional + from = '<FROM>' # optional ) diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 80ca389..73c2c88 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -8,6 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_topic( - topic_id = '[TOPIC_ID]', - name = '[NAME]' # optional + topic_id = '<TOPIC_ID>', + name = '<NAME>', # optional + subscribe = ["any"] # optional ) diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 8ba7a83..8461df0 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_twilio_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional enabled = False, # optional - account_sid = '[ACCOUNT_SID]', # optional - auth_token = '[AUTH_TOKEN]', # optional - from = '[FROM]' # optional + account_sid = '<ACCOUNT_SID>', # optional + auth_token = '<AUTH_TOKEN>', # optional + from = '<FROM>' # optional ) diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 21b3f72..32708b0 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -8,10 +8,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.update_vonage_provider( - provider_id = '[PROVIDER_ID]', - name = '[NAME]', # optional + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional enabled = False, # optional - api_key = '[API_KEY]', # optional - api_secret = '[API_SECRET]', # optional - from = '[FROM]' # optional + api_key = '<API_KEY>', # optional + api_secret = '<API_SECRET>', # optional + from = '<FROM>' # optional ) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 19f878b..bbeebf1 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) result = storage.create_bucket( - bucket_id = '[BUCKET_ID]', - name = '[NAME]', + bucket_id = '<BUCKET_ID>', + name = '<NAME>', permissions = ["read("any")"], # optional file_security = False, # optional enabled = False, # optional diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 21e98f2..b8cae35 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -9,8 +9,8 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) result = storage.create_file( - bucket_id = '[BUCKET_ID]', - file_id = '[FILE_ID]', + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', file = InputFile.from_path('file.png'), permissions = ["read("any")"] # optional ) diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index bcc83f3..cd008a7 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) result = storage.delete_bucket( - bucket_id = '[BUCKET_ID]' + bucket_id = '<BUCKET_ID>' ) diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 1330c97..69fe398 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) result = storage.delete_file( - bucket_id = '[BUCKET_ID]', - file_id = '[FILE_ID]' + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>' ) diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 1337ccd..8740eb5 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) result = storage.get_bucket( - bucket_id = '[BUCKET_ID]' + bucket_id = '<BUCKET_ID>' ) diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index b9a0708..30fff99 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) result = storage.get_file_download( - bucket_id = '[BUCKET_ID]', - file_id = '[FILE_ID]' + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>' ) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index f25272a..08dcb47 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -8,8 +8,8 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) result = storage.get_file_preview( - bucket_id = '[BUCKET_ID]', - file_id = '[FILE_ID]', + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', width = 0, # optional height = 0, # optional gravity = ImageGravity.CENTER, # optional diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index bf46a58..6cf8565 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) result = storage.get_file_view( - bucket_id = '[BUCKET_ID]', - file_id = '[FILE_ID]' + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>' ) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index a961728..f54c7a5 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) result = storage.get_file( - bucket_id = '[BUCKET_ID]', - file_id = '[FILE_ID]' + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>' ) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 48e92a9..909d6f7 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -9,5 +9,5 @@ storage = Storage(client) result = storage.list_buckets( queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 8f02147..73f4a28 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) result = storage.list_files( - bucket_id = '[BUCKET_ID]', + bucket_id = '<BUCKET_ID>', queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index a22d6a3..4722284 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key storage = Storage(client) result = storage.update_bucket( - bucket_id = '[BUCKET_ID]', - name = '[NAME]', + bucket_id = '<BUCKET_ID>', + name = '<NAME>', permissions = ["read("any")"], # optional file_security = False, # optional enabled = False, # optional diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 1f25493..0a0b78c 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -8,8 +8,8 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) result = storage.update_file( - bucket_id = '[BUCKET_ID]', - file_id = '[FILE_ID]', - name = '[NAME]', # optional + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + name = '<NAME>', # optional permissions = ["read("any")"] # optional ) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 8d0d5a2..5be1405 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -8,11 +8,11 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.create_membership( - team_id = '[TEAM_ID]', + team_id = '<TEAM_ID>', roles = [], email = 'email@example.com', # optional - user_id = '[USER_ID]', # optional + user_id = '<USER_ID>', # optional phone = '+12065550100', # optional url = 'https://example.com', # optional - name = '[NAME]' # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index cb0f1dc..c305b46 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.create( - team_id = '[TEAM_ID]', - name = '[NAME]', + team_id = '<TEAM_ID>', + name = '<NAME>', roles = [] # optional ) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 0233561..b9f34aa 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.delete_membership( - team_id = '[TEAM_ID]', - membership_id = '[MEMBERSHIP_ID]' + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>' ) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 3a5ed25..18623d1 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -8,5 +8,5 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.delete( - team_id = '[TEAM_ID]' + team_id = '<TEAM_ID>' ) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 396b62d..06d270a 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.get_membership( - team_id = '[TEAM_ID]', - membership_id = '[MEMBERSHIP_ID]' + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>' ) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 65eca1c..046d638 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -8,5 +8,5 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.get_prefs( - team_id = '[TEAM_ID]' + team_id = '<TEAM_ID>' ) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 5433d7b..ee5fdf6 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -8,5 +8,5 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.get( - team_id = '[TEAM_ID]' + team_id = '<TEAM_ID>' ) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 2712fce..997a106 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.list_memberships( - team_id = '[TEAM_ID]', + team_id = '<TEAM_ID>', queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index cf189c9..f066e01 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -9,5 +9,5 @@ teams = Teams(client) result = teams.list( queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 22cdebc..5ab354e 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -8,8 +8,8 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.update_membership_status( - team_id = '[TEAM_ID]', - membership_id = '[MEMBERSHIP_ID]', - user_id = '[USER_ID]', - secret = '[SECRET]' + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>', + user_id = '<USER_ID>', + secret = '<SECRET>' ) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 4a0acc8..a681533 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.update_membership( - team_id = '[TEAM_ID]', - membership_id = '[MEMBERSHIP_ID]', + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>', roles = [] ) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index cc07333..2430570 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.update_name( - team_id = '[TEAM_ID]', - name = '[NAME]' + team_id = '<TEAM_ID>', + name = '<NAME>' ) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 6e501b2..27de647 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with teams = Teams(client) result = teams.update_prefs( - team_id = '[TEAM_ID]', + team_id = '<TEAM_ID>', prefs = {} ) diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 2d41dd4..2317c81 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_argon2_user( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com', password = 'password', - name = '[NAME]' # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 0c12e74..7ea2345 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_bcrypt_user( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com', password = 'password', - name = '[NAME]' # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index cd0f1f2..10b33e5 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_md5_user( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com', password = 'password', - name = '[NAME]' # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 1ff4ea8..5f92330 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -8,8 +8,8 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_ph_pass_user( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com', password = 'password', - name = '[NAME]' # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index a261f8a..c4c9a92 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -8,9 +8,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_sha_user( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com', password = 'password', password_version = PasswordHash.SHA1, # optional - name = '[NAME]' # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 2f52a08..321642f 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -8,11 +8,11 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_scrypt_modified_user( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com', password = 'password', - password_salt = '[PASSWORD_SALT]', - password_salt_separator = '[PASSWORD_SALT_SEPARATOR]', - password_signer_key = '[PASSWORD_SIGNER_KEY]', - name = '[NAME]' # optional + password_salt = '<PASSWORD_SALT>', + password_salt_separator = '<PASSWORD_SALT_SEPARATOR>', + password_signer_key = '<PASSWORD_SIGNER_KEY>', + name = '<NAME>' # optional ) diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 956c511..e7da3a5 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -8,13 +8,13 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_scrypt_user( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com', password = 'password', - password_salt = '[PASSWORD_SALT]', + password_salt = '<PASSWORD_SALT>', password_cpu = None, password_memory = None, password_parallel = None, password_length = None, - name = '[NAME]' # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index f5239c5..2440e50 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_session( - user_id = '[USER_ID]' + user_id = '<USER_ID>' ) diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 987e193..123a092 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -9,10 +9,10 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_target( - user_id = '[USER_ID]', - target_id = '[TARGET_ID]', + user_id = '<USER_ID>', + target_id = '<TARGET_ID>', provider_type = MessagingProviderType.EMAIL, - identifier = '[IDENTIFIER]', - provider_id = '[PROVIDER_ID]', # optional - name = '[NAME]' # optional + identifier = '<IDENTIFIER>', + provider_id = '<PROVIDER_ID>', # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index c652ae0..27e4f51 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create_token( - user_id = '[USER_ID]', + user_id = '<USER_ID>', length = 4, # optional expire = 60 # optional ) diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 3921e97..716c4ac 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -8,9 +8,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.create( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com', # optional phone = '+12065550100', # optional password = '', # optional - name = '[NAME]' # optional + name = '<NAME>' # optional ) diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md index 0ee3743..8867b66 100644 --- a/docs/examples/users/delete-authenticator.md +++ b/docs/examples/users/delete-authenticator.md @@ -9,7 +9,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.delete_authenticator( - user_id = '[USER_ID]', + user_id = '<USER_ID>', type = AuthenticatorType.TOTP, - otp = '[OTP]' + otp = '<OTP>' ) diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 70b5623..8e9918f 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.delete_identity( - identity_id = '[IDENTITY_ID]' + identity_id = '<IDENTITY_ID>' ) diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 9c5ec8f..b3bdcb2 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.delete_session( - user_id = '[USER_ID]', - session_id = '[SESSION_ID]' + user_id = '<USER_ID>', + session_id = '<SESSION_ID>' ) diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 65773fc..08640f5 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.delete_sessions( - user_id = '[USER_ID]' + user_id = '<USER_ID>' ) diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 2805a92..5309b17 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.delete_target( - user_id = '[USER_ID]', - target_id = '[TARGET_ID]' + user_id = '<USER_ID>', + target_id = '<TARGET_ID>' ) diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index e13c508..bb73199 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.delete( - user_id = '[USER_ID]' + user_id = '<USER_ID>' ) diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 912825b..34614de 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.get_prefs( - user_id = '[USER_ID]' + user_id = '<USER_ID>' ) diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index fa51de8..d07591f 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.get_target( - user_id = '[USER_ID]', - target_id = '[TARGET_ID]' + user_id = '<USER_ID>', + target_id = '<TARGET_ID>' ) diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 11191cf..efa5941 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.get( - user_id = '[USER_ID]' + user_id = '<USER_ID>' ) diff --git a/docs/examples/users/list-factors.md b/docs/examples/users/list-factors.md index b229b1c..f30144f 100644 --- a/docs/examples/users/list-factors.md +++ b/docs/examples/users/list-factors.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.list_factors( - user_id = '[USER_ID]' + user_id = '<USER_ID>' ) diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 350ebb2..e19a3dd 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -9,5 +9,5 @@ users = Users(client) result = users.list_identities( queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 1c677ea..54e6886 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.list_logs( - user_id = '[USER_ID]', + user_id = '<USER_ID>', queries = [] # optional ) diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 4b3501f..d0de2fb 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.list_memberships( - user_id = '[USER_ID]' + user_id = '<USER_ID>' ) diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 63c888b..f4a5946 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -8,5 +8,5 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.list_sessions( - user_id = '[USER_ID]' + user_id = '<USER_ID>' ) diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 377442c..3b1e28b 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.list_targets( - user_id = '[USER_ID]', + user_id = '<USER_ID>', queries = [] # optional ) diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 139f06f..9dbe774 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -9,5 +9,5 @@ users = Users(client) result = users.list( queries = [], # optional - search = '[SEARCH]' # optional + search = '<SEARCH>' # optional ) diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 45cb2ef..7c541c9 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_email_verification( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email_verification = False ) diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 4894275..e1c95ee 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_email( - user_id = '[USER_ID]', + user_id = '<USER_ID>', email = 'email@example.com' ) diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index fbfec17..2a54e76 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_labels( - user_id = '[USER_ID]', + user_id = '<USER_ID>', labels = [] ) diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index cf44e79..305566a 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_mfa( - user_id = '[USER_ID]', + user_id = '<USER_ID>', mfa = False ) diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index be04d14..17ebfb6 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_name( - user_id = '[USER_ID]', - name = '[NAME]' + user_id = '<USER_ID>', + name = '<NAME>' ) diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index b820fa5..1ee3edb 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_password( - user_id = '[USER_ID]', + user_id = '<USER_ID>', password = '' ) diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 75e38f4..70ce29f 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_phone_verification( - user_id = '[USER_ID]', + user_id = '<USER_ID>', phone_verification = False ) diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index f30dba7..10c5e61 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_phone( - user_id = '[USER_ID]', + user_id = '<USER_ID>', number = '+12065550100' ) diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 14ee48a..df77346 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_prefs( - user_id = '[USER_ID]', + user_id = '<USER_ID>', prefs = {} ) diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 78ffb5a..6b8e8b8 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -8,6 +8,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_status( - user_id = '[USER_ID]', + user_id = '<USER_ID>', status = False ) diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 7144597..c7ec1a6 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -8,9 +8,9 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) result = users.update_target( - user_id = '[USER_ID]', - target_id = '[TARGET_ID]', - identifier = '[IDENTIFIER]', # optional - provider_id = '[PROVIDER_ID]', # optional - name = '[NAME]' # optional + user_id = '<USER_ID>', + target_id = '<TARGET_ID>', + identifier = '<IDENTIFIER>', # optional + provider_id = '<PROVIDER_ID>', # optional + name = '<NAME>' # optional ) diff --git a/setup.py b/setup.py index 21b187d..6bb9f54 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '5.0.0-rc.4', + version = '5.0.0-rc.5', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.4.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.5.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From e09bcc71a990aad5ef39028aba2509622ffef41e Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Tue, 27 Feb 2024 20:35:00 +1300 Subject: [PATCH 10/60] Release candidate for 1.5.x --- appwrite/client.py | 4 +- appwrite/encoders/value_class_encoder.py | 4 -- appwrite/enums/index_type.py | 1 - appwrite/enums/message_status.py | 6 --- appwrite/services/account.py | 27 +++++----- appwrite/services/messaging.py | 54 +++++++++---------- appwrite/services/users.py | 6 +-- .../examples/account/create-o-auth2session.md | 15 ------ docs/examples/account/update-phone-session.md | 12 +++++ docs/examples/messaging/create-email.md | 2 +- docs/examples/messaging/create-push.md | 2 +- docs/examples/messaging/create-sms.md | 2 +- docs/examples/messaging/update-email.md | 2 +- docs/examples/messaging/update-push.md | 2 +- docs/examples/messaging/update-sms.md | 2 +- docs/examples/users/delete-authenticator.md | 3 +- setup.py | 4 +- 17 files changed, 65 insertions(+), 83 deletions(-) delete mode 100644 appwrite/enums/message_status.py delete mode 100644 docs/examples/account/create-o-auth2session.md create mode 100644 docs/examples/account/update-phone-session.md diff --git a/appwrite/client.py b/appwrite/client.py index 9db2cfe..45d903a 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.5 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.6 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.0-rc.5', + 'x-sdk-version': '5.0.0-rc.6', 'X-Appwrite-Response-Format' : '1.5.0', } diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py index b299023..32c0797 100644 --- a/appwrite/encoders/value_class_encoder.py +++ b/appwrite/encoders/value_class_encoder.py @@ -11,7 +11,6 @@ from ..enums.runtime import Runtime from ..enums.execution_method import ExecutionMethod from ..enums.name import Name -from ..enums.message_status import MessageStatus from ..enums.smtp_encryption import SmtpEncryption from ..enums.compression import Compression from ..enums.image_gravity import ImageGravity @@ -57,9 +56,6 @@ def default(self, o): if isinstance(o, Name): return o.value - if isinstance(o, MessageStatus): - return o.value - if isinstance(o, SmtpEncryption): return o.value diff --git a/appwrite/enums/index_type.py b/appwrite/enums/index_type.py index 842240f..f4c9e4c 100644 --- a/appwrite/enums/index_type.py +++ b/appwrite/enums/index_type.py @@ -4,4 +4,3 @@ class IndexType(Enum): KEY = "key" FULLTEXT = "fulltext" UNIQUE = "unique" - SPATIAL = "spatial" diff --git a/appwrite/enums/message_status.py b/appwrite/enums/message_status.py deleted file mode 100644 index 572b98a..0000000 --- a/appwrite/enums/message_status.py +++ /dev/null @@ -1,6 +0,0 @@ -from enum import Enum - -class MessageStatus(Enum): - DRAFT = "draft" - SCHEDULED = "scheduled" - PROCESSING = "processing" diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 3b1b088..ffb892a 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -412,7 +412,7 @@ def create_email_password_session(self, email, password): }, api_params) def update_magic_url_session(self, user_id, secret): - """Create session (deprecated)""" + """Update magic URL session""" api_path = '/account/sessions/magic-url' @@ -431,24 +431,25 @@ def update_magic_url_session(self, user_id, secret): 'content-type': 'application/json', }, api_params) - def create_o_auth2_session(self, provider, success = None, failure = None, scopes = None): - """Create OAuth2 session""" + def update_phone_session(self, user_id, secret): + """Update phone session""" - api_path = '/account/sessions/oauth2/{provider}' + api_path = '/account/sessions/phone' api_params = {} - if provider is None: - raise AppwriteException('Missing required parameter: "provider"') + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') - api_path = api_path.replace('{provider}', provider) + if secret is None: + raise AppwriteException('Missing required parameter: "secret"') - api_params['success'] = success - api_params['failure'] = failure - api_params['scopes'] = scopes - return self.client.call('get', api_path, { + api_params['userId'] = user_id + api_params['secret'] = secret + + return self.client.call('put', api_path, { 'content-type': 'application/json', - }, api_params, response_type='location') + }, api_params) def create_session(self, user_id, secret): """Create session""" @@ -487,7 +488,7 @@ def get_session(self, session_id): }, api_params) def update_session(self, session_id): - """Update (or renew) a session""" + """Update (or renew) session""" api_path = '/account/sessions/{sessionId}' diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index e8b701a..e284a5c 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -20,8 +20,8 @@ def list_messages(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, attachments = None, status = None, html = None, scheduled_at = None): - """Create an email""" + def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, attachments = None, draft = None, html = None, scheduled_at = None): + """Create email""" api_path = '/messaging/messages/email' @@ -45,7 +45,7 @@ def create_email(self, message_id, subject, content, topics = None, users = None api_params['cc'] = cc api_params['bcc'] = bcc api_params['attachments'] = attachments - api_params['status'] = status + api_params['draft'] = draft api_params['html'] = html api_params['scheduledAt'] = scheduled_at @@ -53,8 +53,8 @@ def create_email(self, message_id, subject, content, topics = None, users = None 'content-type': 'application/json', }, api_params) - def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, status = None, html = None, cc = None, bcc = None, scheduled_at = None): - """Update an email""" + def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, draft = None, html = None, cc = None, bcc = None, scheduled_at = None): + """Update email""" api_path = '/messaging/messages/email/{messageId}' @@ -69,7 +69,7 @@ def update_email(self, message_id, topics = None, users = None, targets = None, api_params['targets'] = targets api_params['subject'] = subject api_params['content'] = content - api_params['status'] = status + api_params['draft'] = draft api_params['html'] = html api_params['cc'] = cc api_params['bcc'] = bcc @@ -79,8 +79,8 @@ def update_email(self, message_id, topics = None, users = None, targets = None, 'content-type': 'application/json', }, api_params) - def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): - """Create a push notification""" + def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): + """Create push notification""" api_path = '/messaging/messages/push' @@ -109,15 +109,15 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ api_params['color'] = color api_params['tag'] = tag api_params['badge'] = badge - api_params['status'] = status + api_params['draft'] = draft api_params['scheduledAt'] = scheduled_at return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None): - """Update a push notification""" + def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): + """Update push notification""" api_path = '/messaging/messages/push/{messageId}' @@ -140,15 +140,15 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t api_params['color'] = color api_params['tag'] = tag api_params['badge'] = badge - api_params['status'] = status + api_params['draft'] = draft api_params['scheduledAt'] = scheduled_at return self.client.call('patch', api_path, { 'content-type': 'application/json', }, api_params) - def create_sms(self, message_id, content, topics = None, users = None, targets = None, status = None, scheduled_at = None): - """Create an SMS""" + def create_sms(self, message_id, content, topics = None, users = None, targets = None, draft = None, scheduled_at = None): + """Create SMS""" api_path = '/messaging/messages/sms' @@ -165,15 +165,15 @@ def create_sms(self, message_id, content, topics = None, users = None, targets = api_params['topics'] = topics api_params['users'] = users api_params['targets'] = targets - api_params['status'] = status + api_params['draft'] = draft api_params['scheduledAt'] = scheduled_at return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, status = None, scheduled_at = None): - """Update an SMS""" + def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, draft = None, scheduled_at = None): + """Update SMS""" api_path = '/messaging/messages/sms/{messageId}' @@ -187,7 +187,7 @@ def update_sms(self, message_id, topics = None, users = None, targets = None, co api_params['users'] = users api_params['targets'] = targets api_params['content'] = content - api_params['status'] = status + api_params['draft'] = draft api_params['scheduledAt'] = scheduled_at return self.client.call('patch', api_path, { @@ -195,7 +195,7 @@ def update_sms(self, message_id, topics = None, users = None, targets = None, co }, api_params) def get_message(self, message_id): - """Get a message""" + """Get message""" api_path = '/messaging/messages/{messageId}' @@ -211,7 +211,7 @@ def get_message(self, message_id): }, api_params) def delete(self, message_id): - """Delete a message""" + """Delete message""" api_path = '/messaging/messages/{messageId}' @@ -836,7 +836,7 @@ def list_topics(self, queries = None, search = None): }, api_params) def create_topic(self, topic_id, name, subscribe = None): - """Create a topic""" + """Create topic""" api_path = '/messaging/topics' @@ -857,7 +857,7 @@ def create_topic(self, topic_id, name, subscribe = None): }, api_params) def get_topic(self, topic_id): - """Get a topic""" + """Get topic""" api_path = '/messaging/topics/{topicId}' @@ -873,7 +873,7 @@ def get_topic(self, topic_id): }, api_params) def update_topic(self, topic_id, name = None, subscribe = None): - """Update a topic""" + """Update topic""" api_path = '/messaging/topics/{topicId}' @@ -891,7 +891,7 @@ def update_topic(self, topic_id, name = None, subscribe = None): }, api_params) def delete_topic(self, topic_id): - """Delete a topic""" + """Delete topic""" api_path = '/messaging/topics/{topicId}' @@ -942,7 +942,7 @@ def list_subscribers(self, topic_id, queries = None, search = None): }, api_params) def create_subscriber(self, topic_id, subscriber_id, target_id): - """Create a subscriber""" + """Create subscriber""" api_path = '/messaging/topics/{topicId}/subscribers' @@ -966,7 +966,7 @@ def create_subscriber(self, topic_id, subscriber_id, target_id): }, api_params) def get_subscriber(self, topic_id, subscriber_id): - """Get a subscriber""" + """Get subscriber""" api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' @@ -986,7 +986,7 @@ def get_subscriber(self, topic_id, subscriber_id): }, api_params) def delete_subscriber(self, topic_id, subscriber_id): - """Delete a subscriber""" + """Delete subscriber""" api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 72ca1f9..e4d724a 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -419,7 +419,7 @@ def list_factors(self, user_id): 'content-type': 'application/json', }, api_params) - def delete_authenticator(self, user_id, type, otp): + def delete_authenticator(self, user_id, type): """Delete Authenticator""" @@ -431,13 +431,9 @@ def delete_authenticator(self, user_id, type, otp): if type is None: raise AppwriteException('Missing required parameter: "type"') - if otp is None: - raise AppwriteException('Missing required parameter: "otp"') - api_path = api_path.replace('{userId}', user_id) api_path = api_path.replace('{type}', type) - api_params['otp'] = otp return self.client.call('delete', api_path, { 'content-type': 'application/json', diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md deleted file mode 100644 index 341087f..0000000 --- a/docs/examples/account/create-o-auth2session.md +++ /dev/null @@ -1,15 +0,0 @@ -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('5df5acd0d48c2') # Your project ID - -account = Account(client) - -result = account.create_o_auth2_session( - provider = OAuthProvider.AMAZON, - success = 'https://example.com', # optional - failure = 'https://example.com', # optional - scopes = [] # optional -) diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md new file mode 100644 index 0000000..ff0c10d --- /dev/null +++ b/docs/examples/account/update-phone-session.md @@ -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('5df5acd0d48c2') # Your project ID + +account = Account(client) + +result = account.update_phone_session( + user_id = '<USER_ID>', + secret = '<SECRET>' +) diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 9747077..acca4d5 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -17,7 +17,7 @@ result = messaging.create_email( cc = [], # optional bcc = [], # optional attachments = [], # optional - status = MessageStatus.DRAFT, # optional + draft = False, # optional html = False, # optional scheduled_at = '' # optional ) diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 1dc49d6..7da7ac7 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -22,6 +22,6 @@ result = messaging.create_push( color = '<COLOR>', # optional tag = '<TAG>', # optional badge = '<BADGE>', # optional - status = MessageStatus.DRAFT, # optional + draft = False, # optional scheduled_at = '' # optional ) diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 324ed5f..38c3665 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -13,6 +13,6 @@ result = messaging.create_sms( topics = [], # optional users = [], # optional targets = [], # optional - status = MessageStatus.DRAFT, # optional + draft = False, # optional scheduled_at = '' # optional ) diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 5f762d0..4d6a17e 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -14,7 +14,7 @@ result = messaging.update_email( targets = [], # optional subject = '<SUBJECT>', # optional content = '<CONTENT>', # optional - status = MessageStatus.DRAFT, # optional + draft = False, # optional html = False, # optional cc = [], # optional bcc = [], # optional diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 23f449e..ff136b9 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -22,6 +22,6 @@ result = messaging.update_push( color = '<COLOR>', # optional tag = '<TAG>', # optional badge = None, # optional - status = MessageStatus.DRAFT, # optional + draft = False, # optional scheduled_at = '' # optional ) diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index e7c76c3..4b9319b 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -13,6 +13,6 @@ result = messaging.update_sms( users = [], # optional targets = [], # optional content = '<CONTENT>', # optional - status = MessageStatus.DRAFT, # optional + draft = False, # optional scheduled_at = '' # optional ) diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md index 8867b66..b5c5203 100644 --- a/docs/examples/users/delete-authenticator.md +++ b/docs/examples/users/delete-authenticator.md @@ -10,6 +10,5 @@ users = Users(client) result = users.delete_authenticator( user_id = '<USER_ID>', - type = AuthenticatorType.TOTP, - otp = '<OTP>' + type = AuthenticatorType.TOTP ) diff --git a/setup.py b/setup.py index 6bb9f54..5d3b21e 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '5.0.0-rc.5', + version = '5.0.0-rc.6', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.5.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.6.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From 21f17cf9599557badd1808f7612fcca7dca07a3b Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Fri, 8 Mar 2024 10:46:31 +0100 Subject: [PATCH 11/60] Appwite 1.5 support --- README.md | 2 +- appwrite/client.py | 4 +- appwrite/encoders/value_class_encoder.py | 6 +- appwrite/enums/authentication_factor.py | 5 +- appwrite/enums/flag.py | 8 +- appwrite/enums/image_gravity.py | 8 +- appwrite/enums/name.py | 21 ++-- appwrite/enums/password_hash.py | 12 +- appwrite/enums/runtime.py | 80 +++++++------ appwrite/services/account.py | 111 ++++++++++++------ appwrite/services/health.py | 37 ++++++ appwrite/services/users.py | 64 ++++++++-- ...ticator.md => create-mfa-authenticator.md} | 2 +- ...e-challenge.md => create-mfa-challenge.md} | 4 +- .../account/create-mfa-recovery-codes.md | 10 ++ ...ticator.md => delete-mfa-authenticator.md} | 2 +- .../account/get-mfa-recovery-codes.md | 10 ++ .../{list-factors.md => list-mfa-factors.md} | 2 +- ...ticator.md => update-mfa-authenticator.md} | 2 +- ...e-challenge.md => update-mfa-challenge.md} | 2 +- .../account/update-mfa-recovery-codes.md | 10 ++ .../create-relationship-attribute.md | 2 +- docs/examples/functions/create.md | 2 +- docs/examples/functions/update.md | 2 +- docs/examples/health/get-failed-jobs.md | 2 +- docs/examples/health/get-queue-usage.md | 12 ++ docs/examples/health/get-storage.md | 10 ++ .../users/create-mfa-recovery-codes.md | 12 ++ ...ticator.md => delete-mfa-authenticator.md} | 2 +- docs/examples/users/get-mfa-recovery-codes.md | 12 ++ .../{list-factors.md => list-mfa-factors.md} | 2 +- .../users/update-mfa-recovery-codes.md | 12 ++ setup.py | 4 +- 33 files changed, 346 insertions(+), 130 deletions(-) rename docs/examples/account/{add-authenticator.md => create-mfa-authenticator.md} (89%) rename docs/examples/account/{create-challenge.md => create-mfa-challenge.md} (76%) create mode 100644 docs/examples/account/create-mfa-recovery-codes.md rename docs/examples/account/{delete-authenticator.md => delete-mfa-authenticator.md} (89%) create mode 100644 docs/examples/account/get-mfa-recovery-codes.md rename docs/examples/account/{list-factors.md => list-mfa-factors.md} (88%) rename docs/examples/account/{verify-authenticator.md => update-mfa-authenticator.md} (89%) rename docs/examples/account/{update-challenge.md => update-mfa-challenge.md} (89%) create mode 100644 docs/examples/account/update-mfa-recovery-codes.md create mode 100644 docs/examples/health/get-queue-usage.md create mode 100644 docs/examples/health/get-storage.md create mode 100644 docs/examples/users/create-mfa-recovery-codes.md rename docs/examples/users/{delete-authenticator.md => delete-mfa-authenticator.md} (90%) create mode 100644 docs/examples/users/get-mfa-recovery-codes.md rename docs/examples/users/{list-factors.md => list-mfa-factors.md} (90%) create mode 100644 docs/examples/users/update-mfa-recovery-codes.md diff --git a/README.md b/README.md index 7f258e3..27b8662 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) -![Appwrite](https://appwrite.io/images/github.png) +![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png) ## Installation diff --git a/appwrite/client.py b/appwrite/client.py index 45d903a..68e6c7b 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.0-rc.6 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.0-rc.6', + 'x-sdk-version': '5.0.0', 'X-Appwrite-Response-Format' : '1.5.0', } diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py index 32c0797..f343add 100644 --- a/appwrite/encoders/value_class_encoder.py +++ b/appwrite/encoders/value_class_encoder.py @@ -1,6 +1,6 @@ import json -from ..enums.authentication_factor import AuthenticationFactor from ..enums.authenticator_type import AuthenticatorType +from ..enums.authentication_factor import AuthenticationFactor from ..enums.o_auth_provider import OAuthProvider from ..enums.browser import Browser from ..enums.credit_card import CreditCard @@ -20,10 +20,10 @@ class ValueClassEncoder(json.JSONEncoder): def default(self, o): - if isinstance(o, AuthenticationFactor): + if isinstance(o, AuthenticatorType): return o.value - if isinstance(o, AuthenticatorType): + if isinstance(o, AuthenticationFactor): return o.value if isinstance(o, OAuthProvider): diff --git a/appwrite/enums/authentication_factor.py b/appwrite/enums/authentication_factor.py index 8da9da9..a5b8cf2 100644 --- a/appwrite/enums/authentication_factor.py +++ b/appwrite/enums/authentication_factor.py @@ -1,6 +1,7 @@ from enum import Enum class AuthenticationFactor(Enum): - TOTP = "totp" - PHONE = "phone" EMAIL = "email" + PHONE = "phone" + TOTP = "totp" + RECOVERYCODE = "recoverycode" diff --git a/appwrite/enums/flag.py b/appwrite/enums/flag.py index 5988e11..6b550d7 100644 --- a/appwrite/enums/flag.py +++ b/appwrite/enums/flag.py @@ -34,7 +34,7 @@ class Flag(Enum): SWITZERLAND = "ch" CHILE = "cl" CHINA = "cn" - CôTE_D'IVOIRE = "ci" + COTE_DIVOIRE = "ci" CAMEROON = "cm" DEMOCRATIC_REPUBLIC_OF_THE_CONGO = "cd" REPUBLIC_OF_THE_CONGO = "cg" @@ -67,7 +67,7 @@ class Flag(Enum): GHANA = "gh" GUINEA = "gn" GAMBIA = "gm" - GUINEABISSAU = "gw" + GUINEA_BISSAU = "gw" EQUATORIAL_GUINEA = "gq" GREECE = "gr" GRENADA = "gd" @@ -96,7 +96,7 @@ class Flag(Enum): SAINT_KITTS_AND_NEVIS = "kn" SOUTH_KOREA = "kr" KUWAIT = "kw" - LAO_PEOPLE'S_DEMOCRATIC_REPUBLIC = "la" + LAO_PEOPLES_DEMOCRATIC_REPUBLIC = "la" LEBANON = "lb" LIBERIA = "lr" LIBYA = "ly" @@ -173,7 +173,7 @@ class Flag(Enum): THAILAND = "th" TAJIKISTAN = "tj" TURKMENISTAN = "tm" - TIMORLESTE = "tl" + TIMOR_LESTE = "tl" TONGA = "to" TRINIDAD_AND_TOBAGO = "tt" TUNISIA = "tn" diff --git a/appwrite/enums/image_gravity.py b/appwrite/enums/image_gravity.py index 1d365a9..c73678d 100644 --- a/appwrite/enums/image_gravity.py +++ b/appwrite/enums/image_gravity.py @@ -2,11 +2,11 @@ class ImageGravity(Enum): CENTER = "center" - TOPLEFT = "top-left" + TOP_LEFT = "top-left" TOP = "top" - TOPRIGHT = "top-right" + TOP_RIGHT = "top-right" LEFT = "left" RIGHT = "right" - BOTTOMLEFT = "bottom-left" + BOTTOM_LEFT = "bottom-left" BOTTOM = "bottom" - BOTTOMRIGHT = "bottom-right" + BOTTOM_RIGHT = "bottom-right" diff --git a/appwrite/enums/name.py b/appwrite/enums/name.py index aeeab59..1e8bdb5 100644 --- a/appwrite/enums/name.py +++ b/appwrite/enums/name.py @@ -1,15 +1,16 @@ from enum import Enum class Name(Enum): - V1DATABASE = "v1-database" - V1DELETES = "v1-deletes" - V1AUDITS = "v1-audits" - V1MAILS = "v1-mails" - V1FUNCTIONS = "v1-functions" - V1USAGE = "v1-usage" + V1_DATABASE = "v1-database" + V1_DELETES = "v1-deletes" + V1_AUDITS = "v1-audits" + V1_MAILS = "v1-mails" + V1_FUNCTIONS = "v1-functions" + V1_USAGE = "v1-usage" + V1_USAGE_DUMP = "v1-usage-dump" WEBHOOKSV1 = "webhooksv1" - V1CERTIFICATES = "v1-certificates" - V1BUILDS = "v1-builds" - V1MESSAGING = "v1-messaging" - V1MIGRATIONS = "v1-migrations" + V1_CERTIFICATES = "v1-certificates" + V1_BUILDS = "v1-builds" + V1_MESSAGING = "v1-messaging" + V1_MIGRATIONS = "v1-migrations" HAMSTERV1 = "hamsterv1" diff --git a/appwrite/enums/password_hash.py b/appwrite/enums/password_hash.py index af9fed2..8dcf212 100644 --- a/appwrite/enums/password_hash.py +++ b/appwrite/enums/password_hash.py @@ -5,10 +5,10 @@ class PasswordHash(Enum): SHA224 = "sha224" SHA256 = "sha256" SHA384 = "sha384" - SHA512/224 = "sha512/224" - SHA512/256 = "sha512/256" + SHA512_224 = "sha512/224" + SHA512_256 = "sha512/256" SHA512 = "sha512" - SHA3224 = "sha3-224" - SHA3256 = "sha3-256" - SHA3384 = "sha3-384" - SHA3512 = "sha3-512" + SHA3_224 = "sha3-224" + SHA3_256 = "sha3-256" + SHA3_384 = "sha3-384" + SHA3_512 = "sha3-512" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index 2ab9ffc..fb83e93 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -1,39 +1,47 @@ from enum import Enum class Runtime(Enum): - NODE145 = "node-14.5" - NODE160 = "node-16.0" - NODE180 = "node-18.0" - NODE190 = "node-19.0" - NODE200 = "node-20.0" - PHP80 = "php-8.0" - PHP81 = "php-8.1" - PHP82 = "php-8.2" - RUBY30 = "ruby-3.0" - RUBY31 = "ruby-3.1" - RUBY32 = "ruby-3.2" - PYTHON38 = "python-3.8" - PYTHON39 = "python-3.9" - PYTHON310 = "python-3.10" - PYTHON311 = "python-3.11" - PYTHON312 = "python-3.12" - DART215 = "dart-2.15" - DART216 = "dart-2.16" - DART217 = "dart-2.17" - DART218 = "dart-2.18" - DART30 = "dart-3.0" - DART31 = "dart-3.1" - DOTNET31 = "dotnet-3.1" - DOTNET60 = "dotnet-6.0" - DOTNET70 = "dotnet-7.0" - JAVA80 = "java-8.0" - JAVA110 = "java-11.0" - JAVA170 = "java-17.0" - JAVA180 = "java-18.0" - SWIFT55 = "swift-5.5" - SWIFT58 = "swift-5.8" - KOTLIN16 = "kotlin-1.6" - KOTLIN18 = "kotlin-1.8" - CPP17 = "cpp-17" - CPP20 = "cpp-20" - BUN10 = "bun-1.0" + NODE_14_5 = "node-14.5" + NODE_16_0 = "node-16.0" + NODE_18_0 = "node-18.0" + NODE_19_0 = "node-19.0" + NODE_20_0 = "node-20.0" + NODE_21_0 = "node-21.0" + PHP_8_0 = "php-8.0" + PHP_8_1 = "php-8.1" + PHP_8_2 = "php-8.2" + PHP_8_3 = "php-8.3" + RUBY_3_0 = "ruby-3.0" + RUBY_3_1 = "ruby-3.1" + RUBY_3_2 = "ruby-3.2" + RUBY_3_3 = "ruby-3.3" + PYTHON_3_8 = "python-3.8" + PYTHON_3_9 = "python-3.9" + PYTHON_3_10 = "python-3.10" + PYTHON_3_11 = "python-3.11" + PYTHON_3_12 = "python-3.12" + DENO_1_40 = "deno-1.40" + DART_2_15 = "dart-2.15" + DART_2_16 = "dart-2.16" + DART_2_17 = "dart-2.17" + DART_2_18 = "dart-2.18" + DART_3_0 = "dart-3.0" + DART_3_1 = "dart-3.1" + DART_3_3 = "dart-3.3" + DOTNET_3_1 = "dotnet-3.1" + DOTNET_6_0 = "dotnet-6.0" + DOTNET_7_0 = "dotnet-7.0" + JAVA_8_0 = "java-8.0" + JAVA_11_0 = "java-11.0" + JAVA_17_0 = "java-17.0" + JAVA_18_0 = "java-18.0" + JAVA_21_0 = "java-21.0" + SWIFT_5_5 = "swift-5.5" + SWIFT_5_8 = "swift-5.8" + SWIFT_5_9 = "swift-5.9" + KOTLIN_1_6 = "kotlin-1.6" + KOTLIN_1_8 = "kotlin-1.8" + KOTLIN_1_9 = "kotlin-1.9" + CPP_17 = "cpp-17" + CPP_20 = "cpp-20" + BUN_1_0 = "bun-1.0" diff --git a/appwrite/services/account.py b/appwrite/services/account.py index ffb892a..5f30898 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -131,106 +131,139 @@ def update_mfa(self, mfa): 'content-type': 'application/json', }, api_params) - def create_challenge(self, factor): - """Create 2FA Challenge""" + def create_mfa_authenticator(self, type): + """Add Authenticator""" - api_path = '/account/mfa/challenge' + api_path = '/account/mfa/authenticators/{type}' api_params = {} - if factor is None: - raise AppwriteException('Missing required parameter: "factor"') + if type is None: + raise AppwriteException('Missing required parameter: "type"') + api_path = api_path.replace('{type}', type) - api_params['factor'] = factor return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def update_challenge(self, challenge_id, otp): - """Create MFA Challenge (confirmation)""" + def update_mfa_authenticator(self, type, otp): + """Verify Authenticator""" - api_path = '/account/mfa/challenge' + api_path = '/account/mfa/authenticators/{type}' api_params = {} - if challenge_id is None: - raise AppwriteException('Missing required parameter: "challenge_id"') + if type is None: + raise AppwriteException('Missing required parameter: "type"') if otp is None: raise AppwriteException('Missing required parameter: "otp"') + api_path = api_path.replace('{type}', type) - api_params['challengeId'] = challenge_id api_params['otp'] = otp return self.client.call('put', api_path, { 'content-type': 'application/json', }, api_params) - def list_factors(self): - """List Factors""" + def delete_mfa_authenticator(self, type, otp): + """Delete Authenticator""" - api_path = '/account/mfa/factors' + api_path = '/account/mfa/authenticators/{type}' api_params = {} + if type is None: + raise AppwriteException('Missing required parameter: "type"') - return self.client.call('get', api_path, { + if otp is None: + raise AppwriteException('Missing required parameter: "otp"') + + api_path = api_path.replace('{type}', type) + + api_params['otp'] = otp + + return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) - def add_authenticator(self, type): - """Add Authenticator""" + def create_mfa_challenge(self, factor): + """Create 2FA Challenge""" - api_path = '/account/mfa/{type}' + api_path = '/account/mfa/challenge' api_params = {} - if type is None: - raise AppwriteException('Missing required parameter: "type"') + if factor is None: + raise AppwriteException('Missing required parameter: "factor"') - api_path = api_path.replace('{type}', type) + api_params['factor'] = factor return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def verify_authenticator(self, type, otp): - """Verify Authenticator""" + def update_mfa_challenge(self, challenge_id, otp): + """Create MFA Challenge (confirmation)""" - api_path = '/account/mfa/{type}' + api_path = '/account/mfa/challenge' api_params = {} - if type is None: - raise AppwriteException('Missing required parameter: "type"') + if challenge_id is None: + raise AppwriteException('Missing required parameter: "challenge_id"') if otp is None: raise AppwriteException('Missing required parameter: "otp"') - api_path = api_path.replace('{type}', type) + api_params['challengeId'] = challenge_id api_params['otp'] = otp return self.client.call('put', api_path, { 'content-type': 'application/json', }, api_params) - def delete_authenticator(self, type, otp): - """Delete Authenticator""" + def list_mfa_factors(self): + """List Factors""" - api_path = '/account/mfa/{type}' + api_path = '/account/mfa/factors' api_params = {} - if type is None: - raise AppwriteException('Missing required parameter: "type"') - if otp is None: - raise AppwriteException('Missing required parameter: "otp"') + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) - api_path = api_path.replace('{type}', type) + def get_mfa_recovery_codes(self): + """Get MFA Recovery Codes""" - api_params['otp'] = otp + + api_path = '/account/mfa/recovery-codes' + api_params = {} - return self.client.call('delete', api_path, { + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_mfa_recovery_codes(self): + """Create MFA Recovery Codes""" + + + api_path = '/account/mfa/recovery-codes' + api_params = {} + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_mfa_recovery_codes(self): + """Regenerate MFA Recovery Codes""" + + + api_path = '/account/mfa/recovery-codes' + api_params = {} + + return self.client.call('patch', api_path, { 'content-type': 'application/json', }, api_params) @@ -488,7 +521,7 @@ def get_session(self, session_id): }, api_params) def update_session(self, session_id): - """Update (or renew) session""" + """Update session""" api_path = '/account/sessions/{sessionId}' diff --git a/appwrite/services/health.py b/appwrite/services/health.py index d2b5cac..54952e6 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -220,6 +220,32 @@ def get_queue_migrations(self, threshold = None): 'content-type': 'application/json', }, api_params) + def get_queue_usage(self, threshold = None): + """Get usage queue""" + + + api_path = '/health/queue/usage' + api_params = {} + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_queue_usage(self, threshold = None): + """Get usage dump queue""" + + + api_path = '/health/queue/usage-dump' + api_params = {} + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + def get_queue_webhooks(self, threshold = None): """Get webhooks queue""" @@ -233,6 +259,17 @@ def get_queue_webhooks(self, threshold = None): 'content-type': 'application/json', }, api_params) + def get_storage(self): + """Get storage""" + + + api_path = '/health/storage' + api_params = {} + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + def get_storage_local(self): """Get local storage""" diff --git a/appwrite/services/users.py b/appwrite/services/users.py index e4d724a..137d2ba 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -403,7 +403,27 @@ def update_mfa(self, user_id, mfa): 'content-type': 'application/json', }, api_params) - def list_factors(self, user_id): + def delete_mfa_authenticator(self, user_id, type): + """Delete Authenticator""" + + + api_path = '/users/{userId}/mfa/authenticators/{type}' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + api_path = api_path.replace('{userId}', user_id) + api_path = api_path.replace('{type}', type) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_mfa_factors(self, user_id): """List Factors""" @@ -419,23 +439,51 @@ def list_factors(self, user_id): 'content-type': 'application/json', }, api_params) - def delete_authenticator(self, user_id, type): - """Delete Authenticator""" + def get_mfa_recovery_codes(self, user_id): + """Get MFA Recovery Codes""" - api_path = '/users/{userId}/mfa/{type}' + api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: raise AppwriteException('Missing required parameter: "user_id"') - if type is None: - raise AppwriteException('Missing required parameter: "type"') + api_path = api_path.replace('{userId}', user_id) + + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_mfa_recovery_codes(self, user_id): + """Regenerate MFA Recovery Codes""" + + + api_path = '/users/{userId}/mfa/recovery-codes' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') api_path = api_path.replace('{userId}', user_id) - api_path = api_path.replace('{type}', type) - return self.client.call('delete', api_path, { + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_mfa_recovery_codes(self, user_id): + """Create MFA Recovery Codes""" + + + api_path = '/users/{userId}/mfa/recovery-codes' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + + return self.client.call('patch', api_path, { 'content-type': 'application/json', }, api_params) diff --git a/docs/examples/account/add-authenticator.md b/docs/examples/account/create-mfa-authenticator.md similarity index 89% rename from docs/examples/account/add-authenticator.md rename to docs/examples/account/create-mfa-authenticator.md index 3c52b89..1c59624 100644 --- a/docs/examples/account/add-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -8,6 +8,6 @@ client.set_session('') # The user session to authenticate with account = Account(client) -result = account.add_authenticator( +result = account.create_mfa_authenticator( type = AuthenticatorType.TOTP ) diff --git a/docs/examples/account/create-challenge.md b/docs/examples/account/create-mfa-challenge.md similarity index 76% rename from docs/examples/account/create-challenge.md rename to docs/examples/account/create-mfa-challenge.md index 6952fae..5448d96 100644 --- a/docs/examples/account/create-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -7,6 +7,6 @@ client.set_project('5df5acd0d48c2') # Your project ID account = Account(client) -result = account.create_challenge( - factor = AuthenticationFactor.TOTP +result = account.create_mfa_challenge( + factor = AuthenticationFactor.EMAIL ) diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000..c675936 --- /dev/null +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.create_mfa_recovery_codes() diff --git a/docs/examples/account/delete-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md similarity index 89% rename from docs/examples/account/delete-authenticator.md rename to docs/examples/account/delete-mfa-authenticator.md index 6539a4f..5deb210 100644 --- a/docs/examples/account/delete-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with account = Account(client) -result = account.delete_authenticator( +result = account.delete_mfa_authenticator( type = AuthenticatorType.TOTP, otp = '<OTP>' ) diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000..123fe4b --- /dev/null +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.get_mfa_recovery_codes() diff --git a/docs/examples/account/list-factors.md b/docs/examples/account/list-mfa-factors.md similarity index 88% rename from docs/examples/account/list-factors.md rename to docs/examples/account/list-mfa-factors.md index 5b0c259..007c237 100644 --- a/docs/examples/account/list-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -7,4 +7,4 @@ client.set_session('') # The user session to authenticate with account = Account(client) -result = account.list_factors() +result = account.list_mfa_factors() diff --git a/docs/examples/account/verify-authenticator.md b/docs/examples/account/update-mfa-authenticator.md similarity index 89% rename from docs/examples/account/verify-authenticator.md rename to docs/examples/account/update-mfa-authenticator.md index e0a26a3..dc9a21f 100644 --- a/docs/examples/account/verify-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -8,7 +8,7 @@ client.set_session('') # The user session to authenticate with account = Account(client) -result = account.verify_authenticator( +result = account.update_mfa_authenticator( type = AuthenticatorType.TOTP, otp = '<OTP>' ) diff --git a/docs/examples/account/update-challenge.md b/docs/examples/account/update-mfa-challenge.md similarity index 89% rename from docs/examples/account/update-challenge.md rename to docs/examples/account/update-mfa-challenge.md index b9aa186..7074e6d 100644 --- a/docs/examples/account/update-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -7,7 +7,7 @@ client.set_session('') # The user session to authenticate with account = Account(client) -result = account.update_challenge( +result = account.update_mfa_challenge( challenge_id = '<CHALLENGE_ID>', otp = '<OTP>' ) diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000..281d892 --- /dev/null +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_mfa_recovery_codes() diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 791877f..0d1dbe0 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -12,7 +12,7 @@ result = databases.create_relationship_attribute( database_id = '<DATABASE_ID>', collection_id = '<COLLECTION_ID>', related_collection_id = '<RELATED_COLLECTION_ID>', - type = RelationshipType.ONE_TO_ONE, + type = RelationshipType.ONETOONE, two_way = False, # optional key = '', # optional two_way_key = '', # optional diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 8069a2b..76320c2 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -11,7 +11,7 @@ functions = Functions(client) result = functions.create( function_id = '<FUNCTION_ID>', name = '<NAME>', - runtime = .NODE-14.5, + runtime = .NODE_14_5, execute = ["any"], # optional events = [], # optional schedule = '', # optional diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 4131c23..edc1b0c 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -10,7 +10,7 @@ functions = Functions(client) result = functions.update( function_id = '<FUNCTION_ID>', name = '<NAME>', - runtime = .NODE-14.5, # optional + runtime = .NODE_14_5, # optional execute = ["any"], # optional events = [], # optional schedule = '', # optional diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 0991b92..ad9f88c 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -9,6 +9,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key health = Health(client) result = health.get_failed_jobs( - name = .V1-DATABASE, + name = .V1_DATABASE, threshold = None # optional ) diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md new file mode 100644 index 0000000..42d7281 --- /dev/null +++ b/docs/examples/health/get-queue-usage.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +health = Health(client) + +result = health.get_queue_usage( + threshold = None # optional +) diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md new file mode 100644 index 0000000..ebe83ed --- /dev/null +++ b/docs/examples/health/get-storage.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +health = Health(client) + +result = health.get_storage() diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000..35706cc --- /dev/null +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +users = Users(client) + +result = users.create_mfa_recovery_codes( + user_id = '<USER_ID>' +) diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md similarity index 90% rename from docs/examples/users/delete-authenticator.md rename to docs/examples/users/delete-mfa-authenticator.md index b5c5203..d418107 100644 --- a/docs/examples/users/delete-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -8,7 +8,7 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.delete_authenticator( +result = users.delete_mfa_authenticator( user_id = '<USER_ID>', type = AuthenticatorType.TOTP ) diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000..529346a --- /dev/null +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +users = Users(client) + +result = users.get_mfa_recovery_codes( + user_id = '<USER_ID>' +) diff --git a/docs/examples/users/list-factors.md b/docs/examples/users/list-mfa-factors.md similarity index 90% rename from docs/examples/users/list-factors.md rename to docs/examples/users/list-mfa-factors.md index f30144f..8092b0f 100644 --- a/docs/examples/users/list-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -7,6 +7,6 @@ client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key users = Users(client) -result = users.list_factors( +result = users.list_mfa_factors( user_id = '<USER_ID>' ) diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000..5ff7bfe --- /dev/null +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +users = Users(client) + +result = users.update_mfa_recovery_codes( + user_id = '<USER_ID>' +) diff --git a/setup.py b/setup.py index 5d3b21e..d330bb7 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '5.0.0-rc.6', + version = '5.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0-rc.6.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', From 99aa333afa90e710eb83055c55892dc282b8cc28 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Fri, 8 Mar 2024 15:10:26 +0100 Subject: [PATCH 12/60] Appwrite 1.5 support --- appwrite/services/health.py | 2 +- docs/examples/health/get-queue-usage-dump.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 docs/examples/health/get-queue-usage-dump.md diff --git a/appwrite/services/health.py b/appwrite/services/health.py index 54952e6..ef4b3cd 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -233,7 +233,7 @@ def get_queue_usage(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_usage(self, threshold = None): + def get_queue_usage_dump(self, threshold = None): """Get usage dump queue""" diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-usage-dump.md new file mode 100644 index 0000000..2b8e302 --- /dev/null +++ b/docs/examples/health/get-queue-usage-dump.md @@ -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('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +health = Health(client) + +result = health.get_queue_usage_dump( + threshold = None # optional +) From 4f4dc55d4ee205d1b8947578511d02a137948e71 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Fri, 8 Mar 2024 18:37:30 +0100 Subject: [PATCH 13/60] Fix modules --- appwrite/client.py | 4 ++-- setup.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index 68e6c7b..5840f6a 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.0', + 'x-sdk-version': '5.0.1', 'X-Appwrite-Response-Format' : '1.5.0', } diff --git a/setup.py b/setup.py index d330bb7..a23c109 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '5.0.0', + version = '5.0.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,11 +18,10 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.0.tar.gz', - # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.1.tar.gz', install_requires=[ - 'requests', - ], + 'requests', + ], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', From 1ac7a699ace64005e3da20b0096dd2895db2ad3b Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Sat, 9 Mar 2024 16:40:26 +0100 Subject: [PATCH 14/60] Fix package definition --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a23c109..f1c475b 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,12 @@ setuptools.setup( name = 'appwrite', - packages = ['appwrite', 'appwrite/services'], + packages = [ + 'appwrite', + 'appwrite/services', + 'appwrite/encoders', + 'appwrite/enums', + ], version = '5.0.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', From 56d1dbc7e82b98f83d3edf43ab762ad462e7ebdb Mon Sep 17 00:00:00 2001 From: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com> Date: Sat, 23 Mar 2024 00:13:47 +0000 Subject: [PATCH 15/60] fix(messaging): fix msg91 params --- README.md | 2 +- appwrite/client.py | 4 ++-- appwrite/id.py | 22 +++++++++++++++++-- appwrite/services/messaging.py | 8 +++---- .../messaging/create-msg91provider.md | 2 +- .../messaging/update-msg91provider.md | 4 ++-- setup.py | 4 ++-- 7 files changed, 32 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 27b8662..5dd19a6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.5.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.5.4-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index 5840f6a..53f820f 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.2 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.1', + 'x-sdk-version': '5.0.2', 'X-Appwrite-Response-Format' : '1.5.0', } diff --git a/appwrite/id.py b/appwrite/id.py index a9ed5f3..0be3040 100644 --- a/appwrite/id.py +++ b/appwrite/id.py @@ -1,8 +1,26 @@ +from datetime import datetime +import math +import os + class ID: + # Generate an hex ID based on timestamp + # Recreated from https://www.php.net/manual/en/function.uniqid.php + @staticmethod + def __hex_timestamp(): + now = datetime.now() + sec = int(now.timestamp()) + usec = (now.microsecond % 1000) + hex_timestamp = f'{sec:08x}{usec:05x}' + return hex_timestamp + @staticmethod def custom(id): return id + # Generate a unique ID with padding to have a longer ID @staticmethod - def unique(): - return 'unique()' \ No newline at end of file + def unique(padding = 7): + base_id = ID.__hex_timestamp() + random_bytes = os.urandom(math.ceil(padding / 2)) + random_padding = random_bytes.hex()[:padding] + return base_id + random_padding diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index e284a5c..0b42308 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -417,7 +417,7 @@ def update_mailgun_provider(self, provider_id, name = None, api_key = None, doma 'content-type': 'application/json', }, api_params) - def create_msg91_provider(self, provider_id, name, xfrom = None, sender_id = None, auth_key = None, enabled = None): + def create_msg91_provider(self, provider_id, name, template_id = None, sender_id = None, auth_key = None, enabled = None): """Create Msg91 provider""" @@ -432,7 +432,7 @@ def create_msg91_provider(self, provider_id, name, xfrom = None, sender_id = Non api_params['providerId'] = provider_id api_params['name'] = name - api_params['from'] = xfrom + api_params['templateId'] = template_id api_params['senderId'] = sender_id api_params['authKey'] = auth_key api_params['enabled'] = enabled @@ -441,7 +441,7 @@ def create_msg91_provider(self, provider_id, name, xfrom = None, sender_id = Non 'content-type': 'application/json', }, api_params) - def update_msg91_provider(self, provider_id, name = None, enabled = None, sender_id = None, auth_key = None, xfrom = None): + def update_msg91_provider(self, provider_id, name = None, enabled = None, template_id = None, sender_id = None, auth_key = None): """Update Msg91 provider""" @@ -454,9 +454,9 @@ def update_msg91_provider(self, provider_id, name = None, enabled = None, sender api_params['name'] = name api_params['enabled'] = enabled + api_params['templateId'] = template_id api_params['senderId'] = sender_id api_params['authKey'] = auth_key - api_params['from'] = xfrom return self.client.call('patch', api_path, { 'content-type': 'application/json', diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 3ce1446..d11812c 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -10,7 +10,7 @@ messaging = Messaging(client) result = messaging.create_msg91_provider( provider_id = '<PROVIDER_ID>', name = '<NAME>', - from = '+12065550100', # optional + template_id = '<TEMPLATE_ID>', # optional sender_id = '<SENDER_ID>', # optional auth_key = '<AUTH_KEY>', # optional enabled = False # optional diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 2f88686..d13a387 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -11,7 +11,7 @@ result = messaging.update_msg91_provider( provider_id = '<PROVIDER_ID>', name = '<NAME>', # optional enabled = False, # optional + template_id = '<TEMPLATE_ID>', # optional sender_id = '<SENDER_ID>', # optional - auth_key = '<AUTH_KEY>', # optional - from = '<FROM>' # optional + auth_key = '<AUTH_KEY>' # optional ) diff --git a/setup.py b/setup.py index f1c475b..e505d21 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '5.0.1', + version = '5.0.2', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.2.tar.gz', install_requires=[ 'requests', ], From 127418f795016aa61667a7ab43476b0ceef474af Mon Sep 17 00:00:00 2001 From: Steven Nguyen <stnguyen90@users.noreply.github.com> Date: Fri, 17 May 2024 04:21:29 +0000 Subject: [PATCH 16/60] fix: minor bugs --- README.md | 2 +- appwrite/client.py | 4 ++-- appwrite/enums/credit_card.py | 2 +- appwrite/enums/flag.py | 1 + appwrite/enums/runtime.py | 1 + appwrite/services/messaging.py | 3 ++- docs/examples/messaging/update-email.md | 3 ++- setup.py | 4 ++-- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5dd19a6..99af0d3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.5.4-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.5.6-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index 53f820f..256732e 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.2 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/5.0.3 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.2', + 'x-sdk-version': '5.0.3', 'X-Appwrite-Response-Format' : '1.5.0', } diff --git a/appwrite/enums/credit_card.py b/appwrite/enums/credit_card.py index 127e077..097ea64 100644 --- a/appwrite/enums/credit_card.py +++ b/appwrite/enums/credit_card.py @@ -4,7 +4,7 @@ class CreditCard(Enum): AMERICAN_EXPRESS = "amex" ARGENCARD = "argencard" CABAL = "cabal" - CONSOSUD = "censosud" + CENCOSUD = "cencosud" DINERS_CLUB = "diners" DISCOVER = "discover" ELO = "elo" diff --git a/appwrite/enums/flag.py b/appwrite/enums/flag.py index 6b550d7..7dd0a30 100644 --- a/appwrite/enums/flag.py +++ b/appwrite/enums/flag.py @@ -142,6 +142,7 @@ class Flag(Enum): PALAU = "pw" PAPUA_NEW_GUINEA = "pg" POLAND = "pl" + FRENCH_POLYNESIA = "pf" NORTH_KOREA = "kp" PORTUGAL = "pt" PARAGUAY = "py" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index fb83e93..c4273e6 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -20,6 +20,7 @@ class Runtime(Enum): PYTHON_3_10 = "python-3.10" PYTHON_3_11 = "python-3.11" PYTHON_3_12 = "python-3.12" + PYTHON_ML_3_11 = "python-ml-3.11" DENO_1_40 = "deno-1.40" DART_2_15 = "dart-2.15" DART_2_16 = "dart-2.16" diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 0b42308..11e73be 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -53,7 +53,7 @@ def create_email(self, message_id, subject, content, topics = None, users = None 'content-type': 'application/json', }, api_params) - def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, draft = None, html = None, cc = None, bcc = None, scheduled_at = None): + def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, draft = None, html = None, cc = None, bcc = None, scheduled_at = None, attachments = None): """Update email""" @@ -74,6 +74,7 @@ def update_email(self, message_id, topics = None, users = None, targets = None, api_params['cc'] = cc api_params['bcc'] = bcc api_params['scheduledAt'] = scheduled_at + api_params['attachments'] = attachments return self.client.call('patch', api_path, { 'content-type': 'application/json', diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 4d6a17e..a2d2589 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -18,5 +18,6 @@ result = messaging.update_email( html = False, # optional cc = [], # optional bcc = [], # optional - scheduled_at = '' # optional + scheduled_at = '', # optional + attachments = [] # optional ) diff --git a/setup.py b/setup.py index e505d21..df39af5 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '5.0.2', + version = '5.0.3', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.2.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.3.tar.gz', install_requires=[ 'requests', ], From 4c91056282db77548fe3d6d5d61e85b8d1227141 Mon Sep 17 00:00:00 2001 From: root <stnguyen90@users.noreply.github.com> Date: Thu, 23 May 2024 18:45:25 +0000 Subject: [PATCH 17/60] chore: add GitHub action for publishing --- .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++++ appwrite/enums/name.py | 1 - 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e8eca7b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish to PyPI +on: + release: + types: [published] + +jobs: + publish: + name: Release build and publish + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - name: Build package + run: | + python -m pip install setuptools wheel build + python setup.py sdist bdist_wheel + + - name: Publish package + run: | + python -m pip install twine + python -m twine upload -r pypi dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + TWINE_NON_INTERACTIVE: true diff --git a/appwrite/enums/name.py b/appwrite/enums/name.py index 1e8bdb5..b61606a 100644 --- a/appwrite/enums/name.py +++ b/appwrite/enums/name.py @@ -13,4 +13,3 @@ class Name(Enum): V1_BUILDS = "v1-builds" V1_MESSAGING = "v1-messaging" V1_MIGRATIONS = "v1-migrations" - HAMSTERV1 = "hamsterv1" From ba088b98efc6e06f4ec2a0e1997688e53b921c9e Mon Sep 17 00:00:00 2001 From: Steven Nguyen <stnguyen90@users.noreply.github.com> Date: Thu, 23 May 2024 11:47:09 -0700 Subject: [PATCH 18/60] chore: remove travis file since we're going to use GitHub Actions --- .travis.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bf9a9df..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: python - -dist: bionic - -python: - - "3.8" - -jobs: - include: - - stage: pypi release - python: "3.8" - script: echo "Deploying to pypi ..." - deploy: - provider: pypi - username: "__token__" - password: $PYPI_TOKEN - on: - tags: true \ No newline at end of file From 03799594d5eb888cff02c7d7baf356e8e6ead502 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann <torsten.dittmann@googlemail.com> Date: Wed, 3 Jul 2024 18:00:14 +0200 Subject: [PATCH 19/60] feat: 1.6.x --- README.md | 4 +- appwrite/client.py | 5 ++ appwrite/enums/name.py | 2 +- appwrite/enums/runtime.py | 1 + appwrite/services/account.py | 2 +- appwrite/services/functions.py | 60 +++++++++++++++---- appwrite/services/users.py | 18 ++++++ .../account/create-anonymous-session.md | 2 +- .../account/create-email-password-session.md | 2 +- docs/examples/account/create-email-token.md | 2 +- docs/examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-token.md | 2 +- .../account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- .../account/create-mfa-recovery-codes.md | 2 +- docs/examples/account/create-o-auth2token.md | 2 +- docs/examples/account/create-phone-token.md | 2 +- .../account/create-phone-verification.md | 2 +- docs/examples/account/create-recovery.md | 2 +- docs/examples/account/create-session.md | 2 +- docs/examples/account/create-verification.md | 2 +- docs/examples/account/create.md | 2 +- docs/examples/account/delete-identity.md | 2 +- .../account/delete-mfa-authenticator.md | 2 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/delete-sessions.md | 2 +- .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/get-prefs.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/get.md | 2 +- docs/examples/account/list-identities.md | 2 +- docs/examples/account/list-logs.md | 2 +- docs/examples/account/list-mfa-factors.md | 2 +- docs/examples/account/list-sessions.md | 2 +- docs/examples/account/update-email.md | 2 +- docs/examples/account/update-m-f-a.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- .../account/update-mfa-recovery-codes.md | 2 +- docs/examples/account/update-name.md | 2 +- docs/examples/account/update-password.md | 2 +- docs/examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- docs/examples/account/update-phone.md | 2 +- docs/examples/account/update-prefs.md | 2 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-status.md | 2 +- docs/examples/account/update-verification.md | 2 +- docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-favicon.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/avatars/get-image.md | 2 +- docs/examples/avatars/get-initials.md | 2 +- docs/examples/avatars/get-q-r.md | 2 +- .../databases/create-boolean-attribute.md | 4 +- docs/examples/databases/create-collection.md | 4 +- .../databases/create-datetime-attribute.md | 4 +- docs/examples/databases/create-document.md | 2 +- .../databases/create-email-attribute.md | 4 +- .../databases/create-enum-attribute.md | 4 +- .../databases/create-float-attribute.md | 4 +- docs/examples/databases/create-index.md | 4 +- .../databases/create-integer-attribute.md | 4 +- .../examples/databases/create-ip-attribute.md | 4 +- .../create-relationship-attribute.md | 4 +- .../databases/create-string-attribute.md | 4 +- .../databases/create-url-attribute.md | 4 +- docs/examples/databases/create.md | 4 +- docs/examples/databases/delete-attribute.md | 4 +- docs/examples/databases/delete-collection.md | 4 +- docs/examples/databases/delete-document.md | 2 +- docs/examples/databases/delete-index.md | 4 +- docs/examples/databases/delete.md | 4 +- docs/examples/databases/get-attribute.md | 4 +- docs/examples/databases/get-collection.md | 4 +- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/get-index.md | 4 +- docs/examples/databases/get.md | 4 +- docs/examples/databases/list-attributes.md | 4 +- docs/examples/databases/list-collections.md | 4 +- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.md | 4 +- docs/examples/databases/list.md | 4 +- .../databases/update-boolean-attribute.md | 4 +- docs/examples/databases/update-collection.md | 4 +- .../databases/update-datetime-attribute.md | 4 +- docs/examples/databases/update-document.md | 2 +- .../databases/update-email-attribute.md | 4 +- .../databases/update-enum-attribute.md | 4 +- .../databases/update-float-attribute.md | 4 +- .../databases/update-integer-attribute.md | 4 +- .../examples/databases/update-ip-attribute.md | 4 +- .../update-relationship-attribute.md | 4 +- .../databases/update-string-attribute.md | 4 +- .../databases/update-url-attribute.md | 4 +- docs/examples/databases/update.md | 4 +- docs/examples/functions/create-build.md | 6 +- docs/examples/functions/create-deployment.md | 4 +- docs/examples/functions/create-execution.md | 5 +- docs/examples/functions/create-variable.md | 4 +- docs/examples/functions/create.md | 5 +- docs/examples/functions/delete-deployment.md | 4 +- docs/examples/functions/delete-execution.md | 13 ++++ docs/examples/functions/delete-variable.md | 4 +- docs/examples/functions/delete.md | 4 +- .../examples/functions/download-deployment.md | 4 +- docs/examples/functions/get-deployment.md | 4 +- docs/examples/functions/get-execution.md | 2 +- docs/examples/functions/get-variable.md | 4 +- docs/examples/functions/get.md | 4 +- docs/examples/functions/list-deployments.md | 4 +- docs/examples/functions/list-executions.md | 2 +- docs/examples/functions/list-runtimes.md | 4 +- docs/examples/functions/list-variables.md | 4 +- docs/examples/functions/list.md | 4 +- .../functions/update-deployment-build.md | 13 ++++ docs/examples/functions/update-deployment.md | 4 +- docs/examples/functions/update-variable.md | 4 +- docs/examples/functions/update.md | 5 +- docs/examples/graphql/mutation.md | 4 +- docs/examples/graphql/query.md | 4 +- docs/examples/health/get-antivirus.md | 4 +- docs/examples/health/get-cache.md | 4 +- docs/examples/health/get-certificate.md | 4 +- docs/examples/health/get-d-b.md | 4 +- docs/examples/health/get-failed-jobs.md | 4 +- docs/examples/health/get-pub-sub.md | 4 +- docs/examples/health/get-queue-builds.md | 4 +- .../examples/health/get-queue-certificates.md | 4 +- docs/examples/health/get-queue-databases.md | 4 +- docs/examples/health/get-queue-deletes.md | 4 +- docs/examples/health/get-queue-functions.md | 4 +- docs/examples/health/get-queue-logs.md | 4 +- docs/examples/health/get-queue-mails.md | 4 +- docs/examples/health/get-queue-messaging.md | 4 +- docs/examples/health/get-queue-migrations.md | 4 +- docs/examples/health/get-queue-usage-dump.md | 4 +- docs/examples/health/get-queue-usage.md | 4 +- docs/examples/health/get-queue-webhooks.md | 4 +- docs/examples/health/get-queue.md | 4 +- docs/examples/health/get-storage-local.md | 4 +- docs/examples/health/get-storage.md | 4 +- docs/examples/health/get-time.md | 4 +- docs/examples/health/get.md | 4 +- docs/examples/locale/get.md | 2 +- docs/examples/locale/list-codes.md | 2 +- docs/examples/locale/list-continents.md | 2 +- docs/examples/locale/list-countries-e-u.md | 2 +- docs/examples/locale/list-countries-phones.md | 2 +- docs/examples/locale/list-countries.md | 2 +- docs/examples/locale/list-currencies.md | 2 +- docs/examples/locale/list-languages.md | 2 +- .../messaging/create-apns-provider.md | 4 +- docs/examples/messaging/create-email.md | 4 +- .../examples/messaging/create-fcm-provider.md | 4 +- .../messaging/create-mailgun-provider.md | 4 +- .../messaging/create-msg91provider.md | 4 +- docs/examples/messaging/create-push.md | 4 +- .../messaging/create-sendgrid-provider.md | 4 +- docs/examples/messaging/create-sms.md | 4 +- .../messaging/create-smtp-provider.md | 4 +- docs/examples/messaging/create-subscriber.md | 4 +- .../messaging/create-telesign-provider.md | 4 +- .../messaging/create-textmagic-provider.md | 4 +- docs/examples/messaging/create-topic.md | 4 +- .../messaging/create-twilio-provider.md | 4 +- .../messaging/create-vonage-provider.md | 4 +- docs/examples/messaging/delete-provider.md | 4 +- docs/examples/messaging/delete-subscriber.md | 4 +- docs/examples/messaging/delete-topic.md | 4 +- docs/examples/messaging/delete.md | 4 +- docs/examples/messaging/get-message.md | 4 +- docs/examples/messaging/get-provider.md | 4 +- docs/examples/messaging/get-subscriber.md | 4 +- docs/examples/messaging/get-topic.md | 4 +- docs/examples/messaging/list-message-logs.md | 4 +- docs/examples/messaging/list-messages.md | 4 +- docs/examples/messaging/list-provider-logs.md | 4 +- docs/examples/messaging/list-providers.md | 4 +- .../messaging/list-subscriber-logs.md | 4 +- docs/examples/messaging/list-subscribers.md | 4 +- docs/examples/messaging/list-targets.md | 4 +- docs/examples/messaging/list-topic-logs.md | 4 +- docs/examples/messaging/list-topics.md | 4 +- .../messaging/update-apns-provider.md | 4 +- docs/examples/messaging/update-email.md | 4 +- .../examples/messaging/update-fcm-provider.md | 4 +- .../messaging/update-mailgun-provider.md | 4 +- .../messaging/update-msg91provider.md | 4 +- docs/examples/messaging/update-push.md | 4 +- .../messaging/update-sendgrid-provider.md | 4 +- docs/examples/messaging/update-sms.md | 4 +- .../messaging/update-smtp-provider.md | 4 +- .../messaging/update-telesign-provider.md | 4 +- .../messaging/update-textmagic-provider.md | 4 +- docs/examples/messaging/update-topic.md | 4 +- .../messaging/update-twilio-provider.md | 4 +- .../messaging/update-vonage-provider.md | 4 +- docs/examples/storage/create-bucket.md | 4 +- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/delete-bucket.md | 4 +- docs/examples/storage/delete-file.md | 2 +- docs/examples/storage/get-bucket.md | 4 +- docs/examples/storage/get-file-download.md | 2 +- docs/examples/storage/get-file-preview.md | 2 +- docs/examples/storage/get-file-view.md | 2 +- docs/examples/storage/get-file.md | 2 +- docs/examples/storage/list-buckets.md | 4 +- docs/examples/storage/list-files.md | 2 +- docs/examples/storage/update-bucket.md | 4 +- docs/examples/storage/update-file.md | 2 +- docs/examples/teams/create-membership.md | 2 +- docs/examples/teams/create.md | 2 +- docs/examples/teams/delete-membership.md | 2 +- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 2 +- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-memberships.md | 2 +- docs/examples/teams/list.md | 2 +- .../teams/update-membership-status.md | 2 +- docs/examples/teams/update-membership.md | 2 +- docs/examples/teams/update-name.md | 2 +- docs/examples/teams/update-prefs.md | 2 +- docs/examples/users/create-argon2user.md | 4 +- docs/examples/users/create-bcrypt-user.md | 4 +- docs/examples/users/create-j-w-t.md | 14 +++++ docs/examples/users/create-m-d5user.md | 4 +- .../users/create-mfa-recovery-codes.md | 4 +- docs/examples/users/create-p-h-pass-user.md | 4 +- docs/examples/users/create-s-h-a-user.md | 4 +- .../users/create-scrypt-modified-user.md | 4 +- docs/examples/users/create-scrypt-user.md | 4 +- docs/examples/users/create-session.md | 4 +- docs/examples/users/create-target.md | 4 +- docs/examples/users/create-token.md | 4 +- docs/examples/users/create.md | 4 +- docs/examples/users/delete-identity.md | 4 +- .../users/delete-mfa-authenticator.md | 4 +- docs/examples/users/delete-session.md | 4 +- docs/examples/users/delete-sessions.md | 4 +- docs/examples/users/delete-target.md | 4 +- docs/examples/users/delete.md | 4 +- docs/examples/users/get-mfa-recovery-codes.md | 4 +- docs/examples/users/get-prefs.md | 4 +- docs/examples/users/get-target.md | 4 +- docs/examples/users/get.md | 4 +- docs/examples/users/list-identities.md | 4 +- docs/examples/users/list-logs.md | 4 +- docs/examples/users/list-memberships.md | 4 +- docs/examples/users/list-mfa-factors.md | 4 +- docs/examples/users/list-sessions.md | 4 +- docs/examples/users/list-targets.md | 4 +- docs/examples/users/list.md | 4 +- .../users/update-email-verification.md | 4 +- docs/examples/users/update-email.md | 4 +- docs/examples/users/update-labels.md | 4 +- .../users/update-mfa-recovery-codes.md | 4 +- docs/examples/users/update-mfa.md | 4 +- docs/examples/users/update-name.md | 4 +- docs/examples/users/update-password.md | 4 +- .../users/update-phone-verification.md | 4 +- docs/examples/users/update-phone.md | 4 +- docs/examples/users/update-prefs.md | 4 +- docs/examples/users/update-status.md | 4 +- docs/examples/users/update-target.md | 4 +- 269 files changed, 554 insertions(+), 447 deletions(-) create mode 100644 docs/examples/functions/delete-execution.md create mode 100644 docs/examples/functions/update-deployment-build.md create mode 100644 docs/examples/users/create-j-w-t.md diff --git a/README.md b/README.md index 99af0d3..efa806d 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.5.6-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.5.7-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** +**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite/client.py b/appwrite/client.py index 256732e..723e00e 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -113,6 +113,11 @@ def call(self, method, path='', headers=None, params=None, response_type='json') response.raise_for_status() + warnings = response.headers.get('x-appwrite-warning') + if warnings: + for warning in warnings.split(';'): + print(f'Warning: {warning}') + content_type = response.headers['Content-Type'] if response_type == 'location': diff --git a/appwrite/enums/name.py b/appwrite/enums/name.py index b61606a..c5ad74e 100644 --- a/appwrite/enums/name.py +++ b/appwrite/enums/name.py @@ -8,7 +8,7 @@ class Name(Enum): V1_FUNCTIONS = "v1-functions" V1_USAGE = "v1-usage" V1_USAGE_DUMP = "v1-usage-dump" - WEBHOOKSV1 = "webhooksv1" + V1_WEBHOOKS = "v1-webhooks" V1_CERTIFICATES = "v1-certificates" V1_BUILDS = "v1-builds" V1_MESSAGING = "v1-messaging" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index c4273e6..ebc970f 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -46,3 +46,4 @@ class Runtime(Enum): CPP_17 = "cpp-17" CPP_20 = "cpp-20" BUN_1_0 = "bun-1.0" + GO_1_22 = "go-1.22" diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 5f30898..1d08938 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -95,7 +95,7 @@ def create_jwt(self): """Create JWT""" - api_path = '/account/jwt' + api_path = '/account/jwts' api_params = {} return self.client.call('post', api_path, { diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index f5e3d42..2bbaa98 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -20,7 +20,7 @@ def list(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_branch = None): + def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_branch = None): """Create function""" @@ -47,6 +47,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche api_params['logging'] = logging api_params['entrypoint'] = entrypoint api_params['commands'] = commands + api_params['scopes'] = scopes api_params['installationId'] = installation_id api_params['providerRepositoryId'] = provider_repository_id api_params['providerBranch'] = provider_branch @@ -88,7 +89,7 @@ def get(self, function_id): 'content-type': 'application/json', }, api_params) - def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None): + def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None): """Update function""" @@ -112,6 +113,7 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non api_params['logging'] = logging api_params['entrypoint'] = entrypoint api_params['commands'] = commands + api_params['scopes'] = scopes api_params['installationId'] = installation_id api_params['providerRepositoryId'] = provider_repository_id api_params['providerBranch'] = provider_branch @@ -247,11 +249,11 @@ def delete_deployment(self, function_id, deployment_id): 'content-type': 'application/json', }, api_params) - def create_build(self, function_id, deployment_id, build_id): - """Create build""" + def create_build(self, function_id, deployment_id, build_id = None): + """Rebuild deployment""" - api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}' + api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} if function_id is None: raise AppwriteException('Missing required parameter: "function_id"') @@ -259,18 +261,35 @@ def create_build(self, function_id, deployment_id, build_id): if deployment_id is None: raise AppwriteException('Missing required parameter: "deployment_id"') - if build_id is None: - raise AppwriteException('Missing required parameter: "build_id"') - api_path = api_path.replace('{functionId}', function_id) api_path = api_path.replace('{deploymentId}', deployment_id) - api_path = api_path.replace('{buildId}', build_id) + api_params['buildId'] = build_id return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) + def update_deployment_build(self, function_id, deployment_id): + """Cancel deployment""" + + + api_path = '/functions/{functionId}/deployments/{deploymentId}/build' + api_params = {} + if function_id is None: + raise AppwriteException('Missing required parameter: "function_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{functionId}', function_id) + api_path = api_path.replace('{deploymentId}', deployment_id) + + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + def download_deployment(self, function_id, deployment_id): """Download Deployment""" @@ -309,7 +328,7 @@ def list_executions(self, function_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None): + def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None): """Create execution""" @@ -325,6 +344,7 @@ def create_execution(self, function_id, body = None, xasync = None, path = None, api_params['path'] = path api_params['method'] = method api_params['headers'] = headers + api_params['scheduledAt'] = scheduled_at return self.client.call('post', api_path, { 'content-type': 'application/json', @@ -350,6 +370,26 @@ def get_execution(self, function_id, execution_id): 'content-type': 'application/json', }, api_params) + def delete_execution(self, function_id, execution_id): + """Delete execution""" + + + api_path = '/functions/{functionId}/executions/{executionId}' + api_params = {} + if function_id is None: + raise AppwriteException('Missing required parameter: "function_id"') + + if execution_id is None: + raise AppwriteException('Missing required parameter: "execution_id"') + + api_path = api_path.replace('{functionId}', function_id) + api_path = api_path.replace('{executionId}', execution_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + def list_variables(self, function_id): """List variables""" diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 137d2ba..698fbf1 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -330,6 +330,24 @@ def update_email(self, user_id, email): 'content-type': 'application/json', }, api_params) + def create_jwt(self, user_id, session_id = None, duration = None): + """Create user JWT""" + + + api_path = '/users/{userId}/jwts' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['sessionId'] = session_id + api_params['duration'] = duration + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_labels(self, user_id, labels): """Update user labels""" diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index afaa76b..a8d0cd5 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 667d85a..1e9233c 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index a283f42..6700b12 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index bc9b684..182c49d 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 1f6593b..8380de3 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 1c59624..14b16de 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 5448d96..1edb1ed 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticationFactor client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index c675936..f6bf7ed 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 96c0f88..84438a3 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -3,7 +3,7 @@ from appwrite.enums import OAuthProvider client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index b7597df..8542457 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index ca46b01..dd28e34 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index c16be97..e2822a4 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 118a1ab..d4e31c1 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 6138686..a671d9d 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index d165697..226c5c7 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 1462fbc..7029c35 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 5deb210..86955a3 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 030d698..091eca8 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 182c375..7c64d66 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 123fe4b..39137c7 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 102f4dc..67db03a 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index b9483ac..9262799 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index cc66fe6..1b4c8fe 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 3e0d4e0..ed163b3 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 0c0b28a..ca2fcfa 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 007c237..1d09d97 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 23398dc..936b11b 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 353edb0..5cec58c 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index b59ede8..821a549 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index 631fac0..0cd8fc6 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index dc9a21f..e980538 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 7074e6d..3bce7f3 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 281d892..fd98633 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 8e16f49..2ff8454 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 7d651c2..e6c9554 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index ff0c10d..d4a35d8 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index adb5b35..0f9db88 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index c05bb16..540b09a 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 2c58cca..04e4a8f 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 4dca711..4ff91d4 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 006c508..289cb65 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 5c17fa1..8bf6914 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 84c8c4b..ed2d77a 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 1de5eab..3301776 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -3,7 +3,7 @@ from appwrite.enums import Browser client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 9437ff8..da81afc 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -3,7 +3,7 @@ from appwrite.enums import CreditCard client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 2867696..edffdef 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 37ac482..a1c07e2 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -3,7 +3,7 @@ from appwrite.enums import Flag client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 00afe0c..1a4a4c9 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 0a20c14..b443aa4 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index bee29f7..3cb9dcc 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index bf09562..2611488 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index dfe3611..4950d88 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 0b8a555..020d7b6 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index a457811..3b54bab 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 840e6b5..d6cd87d 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 0e891d5..ee2c96e 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 34fda4f..cce0e70 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 72fe622..9e6d16f 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -3,8 +3,8 @@ from appwrite.enums import IndexType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 057cfb7..984800f 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 54e887c..a27c7d7 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 0d1dbe0..c62d5cb 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -3,8 +3,8 @@ from appwrite.enums import RelationshipType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index c15512a..06f86f6 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index f77a630..3b882c5 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 329e653..33e8770 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 87fcf57..ce454ba 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 296c69d..c63bedf 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 3191f10..94afc57 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index bd4fcf5..6890a55 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 302a652..f7506ff 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 8316fe7..3e1d786 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 7b0c7e4..2e2d408 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 978c5a5..9c3dfd4 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index e53878c..4a9da1d 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index b12f7d8..214e59b 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 4628394..dfb1463 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 0ceed95..b6ea0ae 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 08f3c89..d167d89 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 05a9e15..4699aae 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 8ba8b28..6e8f8ac 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 8cf9bc8..d28a93a 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 9f0615f..1710df8 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 5541dd4..0c3ae96 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 37c1b43..6675a6c 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index cedde9d..fddd79e 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 76ede75..6b53a08 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 1556e03..325a3ca 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 37a87ed..e5105db 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index d6df600..4473eb1 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 8c9fb45..5db57e7 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index d765acf..c8a5de8 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 3a6347c..857d6be 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index ab6227f..ca8d5ea 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index f3422f3..152d330 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -2,13 +2,13 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +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_build( function_id = '<FUNCTION_ID>', deployment_id = '<DEPLOYMENT_ID>', - build_id = '<BUILD_ID>' + build_id = '<BUILD_ID>' # optional ) diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 68ae7a9..665651a 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -3,8 +3,8 @@ from appwrite.input_file import InputFile client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 46c64b2..a4ff68b 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) @@ -13,5 +13,6 @@ result = functions.create_execution( async = False, # optional path = '<PATH>', # optional method = ExecutionMethod.GET, # optional - headers = {} # optional + headers = {}, # optional + scheduled_at = '' # optional ) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 6b4e955..621a04a 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 76320c2..6bc91c1 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -3,8 +3,8 @@ from appwrite.enums import client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) @@ -20,6 +20,7 @@ result = functions.create( 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 diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index def007b..59fa729 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md new file mode 100644 index 0000000..61919ca --- /dev/null +++ b/docs/examples/functions/delete-execution.md @@ -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 +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete_execution( + function_id = '<FUNCTION_ID>', + execution_id = '<EXECUTION_ID>' +) diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 96f1304..15c82dc 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 7e20857..660d70b 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/download-deployment.md index 91c1fac..2d0289b 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/download-deployment.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index e2b8e3f..9475ae0 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 04be41b..ccca086 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 2115700..1164f28 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index f630486..82d834c 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index c681463..1d5dc72 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 50dc7cb..9862222 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index ae64245..4efe60a 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index cfd0b64..29d6bf0 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index bc4fc21..0ef5eba 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md new file mode 100644 index 0000000..d5e9c54 --- /dev/null +++ b/docs/examples/functions/update-deployment-build.md @@ -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 +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.update_deployment_build( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 59e183e..3bc5ac0 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 3fb73e0..2fdd4a0 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index edc1b0c..7c64a87 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) @@ -19,6 +19,7 @@ result = functions.update( 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 diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 3d9ad02..d9e0ba6 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key graphql = Graphql(client) diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index deb07a8..55b526c 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key graphql = Graphql(client) diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 5ba2199..2cbf4dc 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 02b85b3..12d7060 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 83018cf..fdf5583 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 5446df5..2f47125 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index ad9f88c..402fde9 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -3,8 +3,8 @@ from appwrite.enums import client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 84ffd97..27d1f22 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index b513c2c..a811b10 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index bbeece1..6e3e18b 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 936266c..502294c 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index b39b445..bbae3eb 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index a989a6a..deffbb9 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 47a56f7..081bdfc 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 39fc879..f1dafb6 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 3862c9e..6b5c2fe 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 85a5e56..58ba3eb 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-usage-dump.md index 2b8e302..33f6607 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-usage-dump.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 42d7281..e01272c 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 435ba95..b194541 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 81ea4ba..6bc0fd2 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index c262455..d5a8c36 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index ebe83ed..d1d225b 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 02405db..2205c13 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index 22034e7..5a5b80c 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 8915eb1..b47f365 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 9d2c939..700455a 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index fadd5f3..0db5650 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 2f3bd50..1b74f1b 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 134ddaa..d3432f1 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index f344cc1..76db17e 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 19d831f..45993bb 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 6de06d3..9b255ae 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 287472f..c74886c 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index acca4d5..2c9f7a5 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 43c882b..1f19316 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 38eb415..5e90d42 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index d11812c..16e1075 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 7da7ac7..825104a 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index e22dad8..9ec7d8d 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 38c3665..50bd9c8 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index b3b299b..d18b883 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index d6ffd09..8c6eab3 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token messaging = Messaging(client) diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index b1fbab3..cf26b82 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index bd251d9..896fbf5 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index e8532b2..0d58b9d 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 3535fd0..9be321f 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 6078096..a39246d 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 58e1684..cb06a2b 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 4988d06..ca25bdb 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 769df6e..e91403a 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index a25e80b..b6d7081 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index db6506e..90b2035 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 3e71e95..b493760 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index e8bb030..68427cf 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index a5e9e7b..158c18f 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 1cfbb2e..d920a93 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 4292733..0cb376e 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index be2f735..8590f9b 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 477c3b2..cc6aec1 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 744b53f..e39c81f 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index ec8ef1d..1c49bc0 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 7ccc6f9..5d38f70 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 4813049..6b31245 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 6bae445..6bdd594 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 4e3f998..5fb6c06 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index a2d2589..2b7576a 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index d2179b6..4a4b3dc 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index d04c617..f64307e 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index d13a387..2d88e70 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index ff136b9..6069a92 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 4d10aad..d54c5cc 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 4b9319b..9f1902b 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index f3a9b96..0bbe18d 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 9c3c5bb..b285490 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 4da5e71..4384e4c 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 73c2c88..3d084b1 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 8461df0..e8bb4c0 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 32708b0..1158515 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index bbeebf1..2ca86a5 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index b8cae35..391b642 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -3,7 +3,7 @@ from appwrite.input_file import InputFile client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index cd008a7..980e1ec 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 69fe398..8bce51d 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 8740eb5..a1712b3 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 30fff99..d865835 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 08dcb47..f69f922 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 6cf8565..043772a 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index f54c7a5..af451af 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 909d6f7..e6202bd 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 73f4a28..d140858 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 4722284..bcb59ea 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 0a0b78c..22e32cb 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 5be1405..3664e35 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index c305b46..94a0467 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index b9f34aa..9dccc49 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 18623d1..f920488 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 06d270a..fa961e3 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 046d638..6b097f1 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index ee5fdf6..20a807e 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 997a106..02bb575 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index f066e01..7a3018f 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 5ab354e..6e06b8d 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index a681533..ecdfe2b 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 2430570..b5f44aa 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 27de647..c31f64f 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 2317c81..ab35ec6 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 7ea2345..eadd5e4 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md new file mode 100644 index 0000000..56d27f4 --- /dev/null +++ b/docs/examples/users/create-j-w-t.md @@ -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('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_jwt( + user_id = '<USER_ID>', + session_id = '<SESSION_ID>', # optional + duration = 0 # optional +) diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 10b33e5..81c1b46 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 35706cc..0d2f63e 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 5f92330..e499792 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index c4c9a92..c7cacbc 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 321642f..a3fd282 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index e7da3a5..483755a 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 2440e50..d28faf9 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 123a092..2f3ccb6 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -3,8 +3,8 @@ from appwrite.enums import MessagingProviderType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 27e4f51..ee58dbb 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 716c4ac..e310b81 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 8e9918f..493f618 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index d418107..e7c3525 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -3,8 +3,8 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index b3bdcb2..658a498 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 08640f5..6fdd149 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 5309b17..67d94d3 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index bb73199..056647f 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 529346a..21e9b27 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 34614de..62c0488 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index d07591f..994fbfa 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index efa5941..3fbfdc7 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index e19a3dd..20de979 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 54e6886..6c73764 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index d0de2fb..38f1b05 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 8092b0f..425f498 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index f4a5946..7271449 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 3b1e28b..e0c2889 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 9dbe774..5401629 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 7c541c9..af0387e 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index e1c95ee..fb9f0b5 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 2a54e76..58e7145 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 5ff7bfe..7aede58 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 305566a..9ed34b5 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 17ebfb6..d232424 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 1ee3edb..1d3c301 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 70ce29f..5f61f94 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 10c5e61..246e0a7 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index df77346..0fafb6d 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 6b8e8b8..d970440 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index c7ec1a6..97370cb 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) From 7d21752f8074d6211206020c0ff2337bd494a04c Mon Sep 17 00:00:00 2001 From: Evan <evan@appwrite.io> Date: Mon, 29 Jul 2024 09:20:22 -0700 Subject: [PATCH 20/60] Create autoclose.yml --- .github/workflows/autoclose.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/autoclose.yml diff --git a/.github/workflows/autoclose.yml b/.github/workflows/autoclose.yml new file mode 100644 index 0000000..3e2b3cb --- /dev/null +++ b/.github/workflows/autoclose.yml @@ -0,0 +1,11 @@ +name: Auto-close External Pull Requests + +on: + pull_request_target: + types: [opened, reopened] + +jobs: + auto_close: + uses: appwrite/.github/.github/workflows/autoclose.yml@main + secrets: + GH_AUTO_CLOSE_PR_TOKEN: ${{ secrets.GH_AUTO_CLOSE_PR_TOKEN }} From d312ab771c545cdf2c4ff265465e64eb86de2268 Mon Sep 17 00:00:00 2001 From: root <christyjacob4@gmail.com> Date: Sat, 17 Aug 2024 08:49:55 +0000 Subject: [PATCH 21/60] chore: release rc --- README.md | 2 +- appwrite/client.py | 6 +- appwrite/services/account.py | 12 ++-- appwrite/services/functions.py | 57 +++++++++++++++---- .../account/delete-mfa-authenticator.md | 3 +- docs/examples/functions/create.md | 2 +- ...ployment.md => get-deployment-download.md} | 4 +- docs/examples/functions/get-template.md | 11 ++++ docs/examples/functions/list-templates.md | 14 +++++ setup.py | 8 +-- 10 files changed, 87 insertions(+), 32 deletions(-) rename docs/examples/functions/{download-deployment.md => get-deployment-download.md} (73%) create mode 100644 docs/examples/functions/get-template.md create mode 100644 docs/examples/functions/list-templates.md diff --git a/README.md b/README.md index efa806d..eb42d99 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.5.7-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index 723e00e..85c47bd 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,12 +13,12 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.3 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/6.0.0-rc.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.3', - 'X-Appwrite-Response-Format' : '1.5.0', + 'x-sdk-version': '6.0.0-rc.1', + 'X-Appwrite-Response-Format' : '1.6.0', } def set_self_signed(self, status=True): diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 1d08938..7e38e08 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -132,7 +132,7 @@ def update_mfa(self, mfa): }, api_params) def create_mfa_authenticator(self, type): - """Add Authenticator""" + """Create Authenticator""" api_path = '/account/mfa/authenticators/{type}' @@ -167,7 +167,7 @@ def update_mfa_authenticator(self, type, otp): 'content-type': 'application/json', }, api_params) - def delete_mfa_authenticator(self, type, otp): + def delete_mfa_authenticator(self, type): """Delete Authenticator""" @@ -176,19 +176,15 @@ def delete_mfa_authenticator(self, type, otp): if type is None: raise AppwriteException('Missing required parameter: "type"') - if otp is None: - raise AppwriteException('Missing required parameter: "otp"') - api_path = api_path.replace('{type}', type) - api_params['otp'] = otp return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) def create_mfa_challenge(self, factor): - """Create 2FA Challenge""" + """Create MFA Challenge""" api_path = '/account/mfa/challenge' @@ -693,7 +689,7 @@ def create_phone_verification(self): }, api_params) def update_phone_verification(self, user_id, secret): - """Create phone verification (confirmation)""" + """Update phone verification (confirmation)""" api_path = '/account/verification/phone' diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 2bbaa98..704aa8f 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -20,7 +20,7 @@ def list(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_branch = None): + def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None): """Create function""" @@ -56,7 +56,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche api_params['templateRepository'] = template_repository api_params['templateOwner'] = template_owner api_params['templateRootDirectory'] = template_root_directory - api_params['templateBranch'] = template_branch + api_params['templateVersion'] = template_version return self.client.call('post', api_path, { 'content-type': 'application/json', @@ -69,6 +69,38 @@ def list_runtimes(self): api_path = '/functions/runtimes' api_params = {} + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_templates(self, runtimes = None, use_cases = None, limit = None, offset = None): + """List function templates""" + + + api_path = '/functions/templates' + api_params = {} + + api_params['runtimes'] = runtimes + api_params['useCases'] = use_cases + api_params['limit'] = limit + api_params['offset'] = offset + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_template(self, template_id): + """Get function template""" + + + api_path = '/functions/templates/{templateId}' + api_params = {} + if template_id is None: + raise AppwriteException('Missing required parameter: "template_id"') + + api_path = api_path.replace('{templateId}', template_id) + + return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) @@ -210,7 +242,7 @@ def get_deployment(self, function_id, deployment_id): }, api_params) def update_deployment(self, function_id, deployment_id): - """Update function deployment""" + """Update deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' @@ -290,8 +322,8 @@ def update_deployment_build(self, function_id, deployment_id): 'content-type': 'application/json', }, api_params) - def download_deployment(self, function_id, deployment_id): - """Download Deployment""" + def get_deployment_download(self, function_id, deployment_id): + """Download deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}/download' @@ -328,7 +360,7 @@ def list_executions(self, function_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None): + def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None, on_progress = None): """Create execution""" @@ -340,15 +372,18 @@ def create_execution(self, function_id, body = None, xasync = None, path = None, api_path = api_path.replace('{functionId}', function_id) api_params['body'] = body - api_params['async'] = xasync + api_params['async'] = str(xasync).lower() if type(xasync) is bool else xasync api_params['path'] = path api_params['method'] = method - api_params['headers'] = headers + api_params['headers'] = str(headers).lower() if type(headers) is bool else headers api_params['scheduledAt'] = scheduled_at - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) + + upload_id = '' + + return self.client.chunked_upload(api_path, { + 'content-type': 'multipart/form-data', + }, api_params, param_name, on_progress, upload_id) def get_execution(self, function_id, execution_id): """Get execution""" diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 86955a3..138e36d 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -9,6 +9,5 @@ client.set_session('') # The user session to authenticate with account = Account(client) result = account.delete_mfa_authenticator( - type = AuthenticatorType.TOTP, - otp = '<OTP>' + type = AuthenticatorType.TOTP ) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 6bc91c1..9ea00ea 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -29,5 +29,5 @@ result = functions.create( template_repository = '<TEMPLATE_REPOSITORY>', # optional template_owner = '<TEMPLATE_OWNER>', # optional template_root_directory = '<TEMPLATE_ROOT_DIRECTORY>', # optional - template_branch = '<TEMPLATE_BRANCH>' # optional + template_version = '<TEMPLATE_VERSION>' # optional ) diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/get-deployment-download.md similarity index 73% rename from docs/examples/functions/download-deployment.md rename to docs/examples/functions/get-deployment-download.md index 2d0289b..f6725a2 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/get-deployment-download.md @@ -3,11 +3,11 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_session('') # The user session to authenticate with functions = Functions(client) -result = functions.download_deployment( +result = functions.get_deployment_download( function_id = '<FUNCTION_ID>', deployment_id = '<DEPLOYMENT_ID>' ) diff --git a/docs/examples/functions/get-template.md b/docs/examples/functions/get-template.md new file mode 100644 index 0000000..dfb7735 --- /dev/null +++ b/docs/examples/functions/get-template.md @@ -0,0 +1,11 @@ +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 + +functions = Functions(client) + +result = functions.get_template( + template_id = '<TEMPLATE_ID>' +) diff --git a/docs/examples/functions/list-templates.md b/docs/examples/functions/list-templates.md new file mode 100644 index 0000000..2de2b90 --- /dev/null +++ b/docs/examples/functions/list-templates.md @@ -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('<YOUR_PROJECT_ID>') # Your project ID + +functions = Functions(client) + +result = functions.list_templates( + runtimes = [], # optional + use_cases = [], # optional + limit = 1, # optional + offset = 0 # optional +) diff --git a/setup.py b/setup.py index df39af5..bd374b9 100644 --- a/setup.py +++ b/setup.py @@ -13,17 +13,17 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '5.0.3', + version = '6.0.0-rc.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, long_description_content_type = 'text/markdown', author = 'Appwrite Team', - author_email = 'team@appwrite.io', + author_email = 'team@localhost.test', maintainer = 'Appwrite Team', - maintainer_email = 'team@appwrite.io', + maintainer_email = 'team@localhost.test', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.3.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0-rc.1.tar.gz', install_requires=[ 'requests', ], From 86f4a3cb53445df969f50674e66e1af6793145f3 Mon Sep 17 00:00:00 2001 From: root <christyjacob4@gmail.com> Date: Tue, 20 Aug 2024 11:03:22 +0000 Subject: [PATCH 22/60] chore: update SDKs to new RC version --- appwrite/client.py | 4 +-- appwrite/services/functions.py | 32 ++++++++++++------- docs/examples/functions/create.md | 3 +- .../examples/functions/list-specifications.md | 10 ++++++ docs/examples/functions/update.md | 3 +- setup.py | 4 +-- 6 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 docs/examples/functions/list-specifications.md diff --git a/appwrite/client.py b/appwrite/client.py index 85c47bd..0ea4b87 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/6.0.0-rc.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/6.0.0-rc.2 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '6.0.0-rc.1', + 'x-sdk-version': '6.0.0-rc.2', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 704aa8f..92cd4fb 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -20,7 +20,7 @@ def list(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None): + def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None, specification = None): """Create function""" @@ -57,6 +57,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche api_params['templateOwner'] = template_owner api_params['templateRootDirectory'] = template_root_directory api_params['templateVersion'] = template_version + api_params['specification'] = specification return self.client.call('post', api_path, { 'content-type': 'application/json', @@ -73,6 +74,17 @@ def list_runtimes(self): 'content-type': 'application/json', }, api_params) + def list_specifications(self): + """List available function runtime specifications""" + + + api_path = '/functions/specifications' + api_params = {} + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + def list_templates(self, runtimes = None, use_cases = None, limit = None, offset = None): """List function templates""" @@ -121,7 +133,7 @@ def get(self, function_id): 'content-type': 'application/json', }, api_params) - def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None): + def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, specification = None): """Update function""" @@ -151,6 +163,7 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non api_params['providerBranch'] = provider_branch api_params['providerSilentMode'] = provider_silent_mode api_params['providerRootDirectory'] = provider_root_directory + api_params['specification'] = specification return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -360,7 +373,7 @@ def list_executions(self, function_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None, on_progress = None): + def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None): """Create execution""" @@ -372,18 +385,15 @@ def create_execution(self, function_id, body = None, xasync = None, path = None, api_path = api_path.replace('{functionId}', function_id) api_params['body'] = body - api_params['async'] = str(xasync).lower() if type(xasync) is bool else xasync + api_params['async'] = xasync api_params['path'] = path api_params['method'] = method - api_params['headers'] = str(headers).lower() if type(headers) is bool else headers + api_params['headers'] = headers api_params['scheduledAt'] = scheduled_at - - upload_id = '' - - return self.client.chunked_upload(api_path, { - 'content-type': 'multipart/form-data', - }, api_params, param_name, on_progress, upload_id) + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) def get_execution(self, function_id, execution_id): """Get execution""" diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 9ea00ea..db03ffc 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -29,5 +29,6 @@ result = functions.create( template_repository = '<TEMPLATE_REPOSITORY>', # optional template_owner = '<TEMPLATE_OWNER>', # optional template_root_directory = '<TEMPLATE_ROOT_DIRECTORY>', # optional - template_version = '<TEMPLATE_VERSION>' # optional + template_version = '<TEMPLATE_VERSION>', # optional + specification = '' # optional ) diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md new file mode 100644 index 0000000..8c63a87 --- /dev/null +++ b/docs/examples/functions/list-specifications.md @@ -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('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.list_specifications() diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 7c64a87..52d63cb 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -24,5 +24,6 @@ result = functions.update( provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional provider_branch = '<PROVIDER_BRANCH>', # optional provider_silent_mode = False, # optional - provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>' # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + specification = '' # optional ) diff --git a/setup.py b/setup.py index bd374b9..96be85f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '6.0.0-rc.1', + version = '6.0.0-rc.2', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@localhost.test', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0-rc.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0-rc.2.tar.gz', install_requires=[ 'requests', ], From 678f57574ab4c7fdf187129df34a56a7371b9efa Mon Sep 17 00:00:00 2001 From: root <christyjacob4@gmail.com> Date: Fri, 23 Aug 2024 10:50:20 +0000 Subject: [PATCH 23/60] chore: updates for next rc release --- appwrite/enums/runtime.py | 2 +- docs/examples/account/create-anonymous-session.md | 2 +- docs/examples/account/create-email-password-session.md | 2 +- docs/examples/account/create-email-token.md | 2 +- docs/examples/account/create-j-w-t.md | 2 +- docs/examples/account/create-magic-u-r-l-token.md | 2 +- docs/examples/account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- docs/examples/account/create-mfa-recovery-codes.md | 2 +- docs/examples/account/create-o-auth2token.md | 2 +- docs/examples/account/create-phone-token.md | 2 +- docs/examples/account/create-phone-verification.md | 2 +- docs/examples/account/create-recovery.md | 2 +- docs/examples/account/create-session.md | 2 +- docs/examples/account/create-verification.md | 2 +- docs/examples/account/create.md | 2 +- docs/examples/account/delete-identity.md | 2 +- docs/examples/account/delete-mfa-authenticator.md | 2 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/delete-sessions.md | 2 +- docs/examples/account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/get-prefs.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/get.md | 2 +- docs/examples/account/list-identities.md | 2 +- docs/examples/account/list-logs.md | 2 +- docs/examples/account/list-mfa-factors.md | 2 +- docs/examples/account/list-sessions.md | 2 +- docs/examples/account/update-email.md | 2 +- docs/examples/account/update-m-f-a.md | 2 +- docs/examples/account/update-magic-u-r-l-session.md | 2 +- docs/examples/account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- docs/examples/account/update-mfa-recovery-codes.md | 2 +- docs/examples/account/update-name.md | 2 +- docs/examples/account/update-password.md | 2 +- docs/examples/account/update-phone-session.md | 2 +- docs/examples/account/update-phone-verification.md | 2 +- docs/examples/account/update-phone.md | 2 +- docs/examples/account/update-prefs.md | 2 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-status.md | 2 +- docs/examples/account/update-verification.md | 2 +- docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-favicon.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/avatars/get-image.md | 2 +- docs/examples/avatars/get-initials.md | 2 +- docs/examples/avatars/get-q-r.md | 2 +- docs/examples/databases/create-boolean-attribute.md | 4 ++-- docs/examples/databases/create-collection.md | 4 ++-- docs/examples/databases/create-datetime-attribute.md | 4 ++-- docs/examples/databases/create-document.md | 2 +- docs/examples/databases/create-email-attribute.md | 4 ++-- docs/examples/databases/create-enum-attribute.md | 4 ++-- docs/examples/databases/create-float-attribute.md | 4 ++-- docs/examples/databases/create-index.md | 4 ++-- docs/examples/databases/create-integer-attribute.md | 4 ++-- docs/examples/databases/create-ip-attribute.md | 4 ++-- docs/examples/databases/create-relationship-attribute.md | 4 ++-- docs/examples/databases/create-string-attribute.md | 4 ++-- docs/examples/databases/create-url-attribute.md | 4 ++-- docs/examples/databases/create.md | 4 ++-- docs/examples/databases/delete-attribute.md | 4 ++-- docs/examples/databases/delete-collection.md | 4 ++-- docs/examples/databases/delete-document.md | 2 +- docs/examples/databases/delete-index.md | 4 ++-- docs/examples/databases/delete.md | 4 ++-- docs/examples/databases/get-attribute.md | 4 ++-- docs/examples/databases/get-collection.md | 4 ++-- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/get-index.md | 4 ++-- docs/examples/databases/get.md | 4 ++-- docs/examples/databases/list-attributes.md | 4 ++-- docs/examples/databases/list-collections.md | 4 ++-- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.md | 4 ++-- docs/examples/databases/list.md | 4 ++-- docs/examples/databases/update-boolean-attribute.md | 4 ++-- docs/examples/databases/update-collection.md | 4 ++-- docs/examples/databases/update-datetime-attribute.md | 4 ++-- docs/examples/databases/update-document.md | 2 +- docs/examples/databases/update-email-attribute.md | 4 ++-- docs/examples/databases/update-enum-attribute.md | 4 ++-- docs/examples/databases/update-float-attribute.md | 4 ++-- docs/examples/databases/update-integer-attribute.md | 4 ++-- docs/examples/databases/update-ip-attribute.md | 4 ++-- docs/examples/databases/update-relationship-attribute.md | 4 ++-- docs/examples/databases/update-string-attribute.md | 4 ++-- docs/examples/databases/update-url-attribute.md | 4 ++-- docs/examples/databases/update.md | 4 ++-- docs/examples/functions/create-build.md | 4 ++-- docs/examples/functions/create-deployment.md | 4 ++-- docs/examples/functions/create-execution.md | 2 +- docs/examples/functions/create-variable.md | 4 ++-- docs/examples/functions/create.md | 4 ++-- docs/examples/functions/delete-deployment.md | 4 ++-- docs/examples/functions/delete-execution.md | 4 ++-- docs/examples/functions/delete-variable.md | 4 ++-- docs/examples/functions/delete.md | 4 ++-- docs/examples/functions/get-deployment-download.md | 2 +- docs/examples/functions/get-deployment.md | 4 ++-- docs/examples/functions/get-execution.md | 2 +- docs/examples/functions/get-template.md | 2 +- docs/examples/functions/get-variable.md | 4 ++-- docs/examples/functions/get.md | 4 ++-- docs/examples/functions/list-deployments.md | 4 ++-- docs/examples/functions/list-executions.md | 2 +- docs/examples/functions/list-runtimes.md | 4 ++-- docs/examples/functions/list-specifications.md | 4 ++-- docs/examples/functions/list-templates.md | 2 +- docs/examples/functions/list-variables.md | 4 ++-- docs/examples/functions/list.md | 4 ++-- docs/examples/functions/update-deployment-build.md | 4 ++-- docs/examples/functions/update-deployment.md | 4 ++-- docs/examples/functions/update-variable.md | 4 ++-- docs/examples/functions/update.md | 4 ++-- docs/examples/graphql/mutation.md | 4 ++-- docs/examples/graphql/query.md | 4 ++-- docs/examples/health/get-antivirus.md | 4 ++-- docs/examples/health/get-cache.md | 4 ++-- docs/examples/health/get-certificate.md | 4 ++-- docs/examples/health/get-d-b.md | 4 ++-- docs/examples/health/get-failed-jobs.md | 4 ++-- docs/examples/health/get-pub-sub.md | 4 ++-- docs/examples/health/get-queue-builds.md | 4 ++-- docs/examples/health/get-queue-certificates.md | 4 ++-- docs/examples/health/get-queue-databases.md | 4 ++-- docs/examples/health/get-queue-deletes.md | 4 ++-- docs/examples/health/get-queue-functions.md | 4 ++-- docs/examples/health/get-queue-logs.md | 4 ++-- docs/examples/health/get-queue-mails.md | 4 ++-- docs/examples/health/get-queue-messaging.md | 4 ++-- docs/examples/health/get-queue-migrations.md | 4 ++-- docs/examples/health/get-queue-usage-dump.md | 4 ++-- docs/examples/health/get-queue-usage.md | 4 ++-- docs/examples/health/get-queue-webhooks.md | 4 ++-- docs/examples/health/get-queue.md | 4 ++-- docs/examples/health/get-storage-local.md | 4 ++-- docs/examples/health/get-storage.md | 4 ++-- docs/examples/health/get-time.md | 4 ++-- docs/examples/health/get.md | 4 ++-- docs/examples/locale/get.md | 2 +- docs/examples/locale/list-codes.md | 2 +- docs/examples/locale/list-continents.md | 2 +- docs/examples/locale/list-countries-e-u.md | 2 +- docs/examples/locale/list-countries-phones.md | 2 +- docs/examples/locale/list-countries.md | 2 +- docs/examples/locale/list-currencies.md | 2 +- docs/examples/locale/list-languages.md | 2 +- docs/examples/messaging/create-apns-provider.md | 4 ++-- docs/examples/messaging/create-email.md | 4 ++-- docs/examples/messaging/create-fcm-provider.md | 4 ++-- docs/examples/messaging/create-mailgun-provider.md | 4 ++-- docs/examples/messaging/create-msg91provider.md | 4 ++-- docs/examples/messaging/create-push.md | 4 ++-- docs/examples/messaging/create-sendgrid-provider.md | 4 ++-- docs/examples/messaging/create-sms.md | 4 ++-- docs/examples/messaging/create-smtp-provider.md | 4 ++-- docs/examples/messaging/create-subscriber.md | 4 ++-- docs/examples/messaging/create-telesign-provider.md | 4 ++-- docs/examples/messaging/create-textmagic-provider.md | 4 ++-- docs/examples/messaging/create-topic.md | 4 ++-- docs/examples/messaging/create-twilio-provider.md | 4 ++-- docs/examples/messaging/create-vonage-provider.md | 4 ++-- docs/examples/messaging/delete-provider.md | 4 ++-- docs/examples/messaging/delete-subscriber.md | 4 ++-- docs/examples/messaging/delete-topic.md | 4 ++-- docs/examples/messaging/delete.md | 4 ++-- docs/examples/messaging/get-message.md | 4 ++-- docs/examples/messaging/get-provider.md | 4 ++-- docs/examples/messaging/get-subscriber.md | 4 ++-- docs/examples/messaging/get-topic.md | 4 ++-- docs/examples/messaging/list-message-logs.md | 4 ++-- docs/examples/messaging/list-messages.md | 4 ++-- docs/examples/messaging/list-provider-logs.md | 4 ++-- docs/examples/messaging/list-providers.md | 4 ++-- docs/examples/messaging/list-subscriber-logs.md | 4 ++-- docs/examples/messaging/list-subscribers.md | 4 ++-- docs/examples/messaging/list-targets.md | 4 ++-- docs/examples/messaging/list-topic-logs.md | 4 ++-- docs/examples/messaging/list-topics.md | 4 ++-- docs/examples/messaging/update-apns-provider.md | 4 ++-- docs/examples/messaging/update-email.md | 4 ++-- docs/examples/messaging/update-fcm-provider.md | 4 ++-- docs/examples/messaging/update-mailgun-provider.md | 4 ++-- docs/examples/messaging/update-msg91provider.md | 4 ++-- docs/examples/messaging/update-push.md | 4 ++-- docs/examples/messaging/update-sendgrid-provider.md | 4 ++-- docs/examples/messaging/update-sms.md | 4 ++-- docs/examples/messaging/update-smtp-provider.md | 4 ++-- docs/examples/messaging/update-telesign-provider.md | 4 ++-- docs/examples/messaging/update-textmagic-provider.md | 4 ++-- docs/examples/messaging/update-topic.md | 4 ++-- docs/examples/messaging/update-twilio-provider.md | 4 ++-- docs/examples/messaging/update-vonage-provider.md | 4 ++-- docs/examples/storage/create-bucket.md | 4 ++-- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/delete-bucket.md | 4 ++-- docs/examples/storage/delete-file.md | 2 +- docs/examples/storage/get-bucket.md | 4 ++-- docs/examples/storage/get-file-download.md | 2 +- docs/examples/storage/get-file-preview.md | 2 +- docs/examples/storage/get-file-view.md | 2 +- docs/examples/storage/get-file.md | 2 +- docs/examples/storage/list-buckets.md | 4 ++-- docs/examples/storage/list-files.md | 2 +- docs/examples/storage/update-bucket.md | 4 ++-- docs/examples/storage/update-file.md | 2 +- docs/examples/teams/create-membership.md | 2 +- docs/examples/teams/create.md | 2 +- docs/examples/teams/delete-membership.md | 2 +- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 2 +- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-memberships.md | 2 +- docs/examples/teams/list.md | 2 +- docs/examples/teams/update-membership-status.md | 2 +- docs/examples/teams/update-membership.md | 2 +- docs/examples/teams/update-name.md | 2 +- docs/examples/teams/update-prefs.md | 2 +- docs/examples/users/create-argon2user.md | 4 ++-- docs/examples/users/create-bcrypt-user.md | 4 ++-- docs/examples/users/create-j-w-t.md | 4 ++-- docs/examples/users/create-m-d5user.md | 4 ++-- docs/examples/users/create-mfa-recovery-codes.md | 4 ++-- docs/examples/users/create-p-h-pass-user.md | 4 ++-- docs/examples/users/create-s-h-a-user.md | 4 ++-- docs/examples/users/create-scrypt-modified-user.md | 4 ++-- docs/examples/users/create-scrypt-user.md | 4 ++-- docs/examples/users/create-session.md | 4 ++-- docs/examples/users/create-target.md | 4 ++-- docs/examples/users/create-token.md | 4 ++-- docs/examples/users/create.md | 4 ++-- docs/examples/users/delete-identity.md | 4 ++-- docs/examples/users/delete-mfa-authenticator.md | 4 ++-- docs/examples/users/delete-session.md | 4 ++-- docs/examples/users/delete-sessions.md | 4 ++-- docs/examples/users/delete-target.md | 4 ++-- docs/examples/users/delete.md | 4 ++-- docs/examples/users/get-mfa-recovery-codes.md | 4 ++-- docs/examples/users/get-prefs.md | 4 ++-- docs/examples/users/get-target.md | 4 ++-- docs/examples/users/get.md | 4 ++-- docs/examples/users/list-identities.md | 4 ++-- docs/examples/users/list-logs.md | 4 ++-- docs/examples/users/list-memberships.md | 4 ++-- docs/examples/users/list-mfa-factors.md | 4 ++-- docs/examples/users/list-sessions.md | 4 ++-- docs/examples/users/list-targets.md | 4 ++-- docs/examples/users/list.md | 4 ++-- docs/examples/users/update-email-verification.md | 4 ++-- docs/examples/users/update-email.md | 4 ++-- docs/examples/users/update-labels.md | 4 ++-- docs/examples/users/update-mfa-recovery-codes.md | 4 ++-- docs/examples/users/update-mfa.md | 4 ++-- docs/examples/users/update-name.md | 4 ++-- docs/examples/users/update-password.md | 4 ++-- docs/examples/users/update-phone-verification.md | 4 ++-- docs/examples/users/update-phone.md | 4 ++-- docs/examples/users/update-prefs.md | 4 ++-- docs/examples/users/update-status.md | 4 ++-- docs/examples/users/update-target.md | 4 ++-- 266 files changed, 441 insertions(+), 441 deletions(-) diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index ebc970f..a52ca61 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -46,4 +46,4 @@ class Runtime(Enum): CPP_17 = "cpp-17" CPP_20 = "cpp-20" BUN_1_0 = "bun-1.0" - GO_1_22 = "go-1.22" + GO_1_23 = "go-1.23" diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index a8d0cd5..36ed47d 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 1e9233c..b85cc3d 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 6700b12..4c18324 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 182c49d..2121514 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 8380de3..c015418 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 14b16de..16a8e2e 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 1edb1ed..017fdd2 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticationFactor client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index f6bf7ed..452b47f 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 84438a3..0cc89df 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -3,7 +3,7 @@ from appwrite.enums import OAuthProvider client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 8542457..30c80df 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index dd28e34..fd0a262 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e2822a4..e9613cd 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index d4e31c1..d129e10 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index a671d9d..5ff238f 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 226c5c7..33b6f3f 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 7029c35..ef57289 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 138e36d..0fbe8c7 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 091eca8..fa0049c 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 7c64d66..6ebe286 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 39137c7..ec70595 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 67db03a..67d0741 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 9262799..f7ae72d 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 1b4c8fe..9ded8e9 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index ed163b3..c51da2c 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index ca2fcfa..750f977 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 1d09d97..2220475 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 936b11b..b3427c0 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 5cec58c..b0a2a16 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 821a549..561e7cc 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index 0cd8fc6..f6b69b0 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index e980538..42b91f1 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 3bce7f3..5964df4 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index fd98633..4f0b136 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 2ff8454..d0027a8 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index e6c9554..888349e 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index d4a35d8..404d2b4 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 0f9db88..41ceb4b 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 540b09a..b7414e6 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 04e4a8f..f69dc12 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 4ff91d4..a331413 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 289cb65..3768326 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 8bf6914..4f9add8 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index ed2d77a..35faf53 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 3301776..91dde3b 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -3,7 +3,7 @@ from appwrite.enums import Browser client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index da81afc..cec2f61 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -3,7 +3,7 @@ from appwrite.enums import CreditCard client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index edffdef..4aa0177 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index a1c07e2..6b12dac 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -3,7 +3,7 @@ from appwrite.enums import Flag client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 1a4a4c9..202955c 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index b443aa4..233da1b 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 3cb9dcc..1296394 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 2611488..183a2b6 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 4950d88..fd9e3a6 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 020d7b6..7435742 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 3b54bab..bd3993f 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index d6cd87d..f4b427e 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index ee2c96e..dce6355 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index cce0e70..a658bd8 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 9e6d16f..015b762 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -3,8 +3,8 @@ from appwrite.enums import IndexType client = Client() client.set_endpoint('https://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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 984800f..9f409e4 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index a27c7d7..ab4d357 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index c62d5cb..76b5db1 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -3,8 +3,8 @@ from appwrite.enums import RelationshipType client = Client() client.set_endpoint('https://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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 06f86f6..d6f7f94 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 3b882c5..3b105d8 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 33e8770..a4ddc92 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index ce454ba..7f490b2 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index c63bedf..c3083a5 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 94afc57..c3e296a 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 6890a55..d5a12c1 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index f7506ff..41d5f18 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 3e1d786..e505fe9 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 2e2d408..7be57ea 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 9c3dfd4..83faade 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 4a9da1d..6038868 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 214e59b..8fe2358 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index dfb1463..a29aefa 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index b6ea0ae..0e61332 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index d167d89..dee130e 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 4699aae..40578a1 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 6e8f8ac..aa934b2 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index d28a93a..8afccf9 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 1710df8..3432b6b 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 0c3ae96..c85a60e 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 6675a6c..07bba76 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index fddd79e..cb9bc42 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 6b53a08..5336cbf 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 325a3ca..23d1f81 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index e5105db..d9206af 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 4473eb1..7370d09 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 5db57e7..3221865 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index c8a5de8..0741d36 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 857d6be..d240be2 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index ca8d5ea..765f28a 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index 152d330..c4eb9d0 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 665651a..da9b559 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -3,8 +3,8 @@ from appwrite.input_file import InputFile client = Client() client.set_endpoint('https://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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index a4ff68b..e1decb9 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 621a04a..cd73e30 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index db03ffc..a65b87d 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -3,8 +3,8 @@ from appwrite.enums import client = Client() client.set_endpoint('https://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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 59fa729..780ce9d 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 61919ca..7c3ea09 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 15c82dc..646a0f3 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 660d70b..2950ed0 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index f6725a2..2813ad3 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 9475ae0..8846888 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index ccca086..f3dfc0f 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) diff --git a/docs/examples/functions/get-template.md b/docs/examples/functions/get-template.md index dfb7735..bea5b6a 100644 --- a/docs/examples/functions/get-template.md +++ b/docs/examples/functions/get-template.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID functions = Functions(client) diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 1164f28..fd903f3 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 82d834c..cb765e4 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 1d5dc72..f776345 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 9862222..0012baf 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 4efe60a..edad1a9 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 8c63a87..a9c7417 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-templates.md b/docs/examples/functions/list-templates.md index 2de2b90..b3ee38a 100644 --- a/docs/examples/functions/list-templates.md +++ b/docs/examples/functions/list-templates.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID functions = Functions(client) diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 29d6bf0..188c17b 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 0ef5eba..5b315e1 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md index d5e9c54..a8d93b8 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-build.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 3bc5ac0..9fce384 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 2fdd4a0..238fc91 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 52d63cb..5f2a70b 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index d9e0ba6..0ec3d3e 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key graphql = Graphql(client) diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 55b526c..95709fd 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key graphql = Graphql(client) diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 2cbf4dc..ff93cea 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 12d7060..fa2a6da 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index fdf5583..2a73583 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 2f47125..18e3968 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 402fde9..ce33c8c 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -3,8 +3,8 @@ from appwrite.enums import client = Client() client.set_endpoint('https://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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 27d1f22..db66c7f 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index a811b10..9daed58 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 6e3e18b..a7d35bc 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 502294c..50f8943 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index bbae3eb..b6e6a4d 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index deffbb9..5868b3c 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 081bdfc..254fe23 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index f1dafb6..c6ab409 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 6b5c2fe..1007913 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 58ba3eb..db59028 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-usage-dump.md index 33f6607..cc31b4f 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-usage-dump.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index e01272c..67d9e64 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index b194541..9188467 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 6bc0fd2..61e5a40 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index d5a8c36..276c305 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index d1d225b..b2de63b 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 2205c13..4089305 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index 5a5b80c..f41e0e3 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index b47f365..fc048dd 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 700455a..d516538 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 0db5650..f6d8495 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 1b74f1b..8bdac2e 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index d3432f1..516d822 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 76db17e..8fcbe1a 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 45993bb..4708498 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 9b255ae..9583cd8 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index c74886c..022209d 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 2c9f7a5..38005a3 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 1f19316..84c38ea 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 5e90d42..fa94da9 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 16e1075..0cffc4e 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 825104a..ffed825 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 9ec7d8d..6e9b812 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 50bd9c8..c3e7fe7 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index d18b883..24108d2 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 8c6eab3..81b0c5f 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -2,8 +2,8 @@ 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 -client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token messaging = Messaging(client) diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index cf26b82..b06033c 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 896fbf5..6dc1030 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 0d58b9d..b0184b5 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 9be321f..c73e941 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index a39246d..cfee0ad 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index cb06a2b..4d2bd6d 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index ca25bdb..5d404d1 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -2,8 +2,8 @@ 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 -client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index e91403a..b270b2a 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index b6d7081..c62c8c0 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 90b2035..4b4ef39 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index b493760..fdf94f0 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 68427cf..7f8284f 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 158c18f..57c465b 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index d920a93..752e449 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 0cb376e..7219f09 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 8590f9b..148814c 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index cc6aec1..3e89695 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index e39c81f..7efaead 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 1c49bc0..fe2442d 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 5d38f70..0622571 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 6b31245..de72a76 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 6bdd594..1379708 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 5fb6c06..2bfd3ed 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 2b7576a..6cff0ae 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 4a4b3dc..7ca9f38 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index f64307e..a89338d 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 2d88e70..4c61950 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 6069a92..3c3965c 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index d54c5cc..8b67b7a 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 9f1902b..aadbd9a 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 0bbe18d..74232e9 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index b285490..2649281 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 4384e4c..bbe4a93 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 3d084b1..ee4d004 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index e8bb4c0..52eed3b 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 1158515..7cb1594 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 2ca86a5..c6e9e33 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 391b642..d275070 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -3,7 +3,7 @@ from appwrite.input_file import InputFile client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 980e1ec..77d72eb 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 8bce51d..775065d 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index a1712b3..adb78e8 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index d865835..b419ea0 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index f69f922..2e3b2ac 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 043772a..9ce04e2 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index af451af..9f04ef4 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index e6202bd..84eab54 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index d140858..8a2aa6d 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index bcb59ea..4eea2a9 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 22e32cb..0137af5 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 3664e35..4846295 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 94a0467..544ee3a 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 9dccc49..7f0cbd4 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index f920488..fc84152 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index fa961e3..6075cc7 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 6b097f1..d740e69 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 20a807e..6d44b80 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 02bb575..f7a072a 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 7a3018f..afb5de1 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 6e06b8d..ee6d211 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index ecdfe2b..6726150 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index b5f44aa..693654d 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index c31f64f..4661601 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -2,7 +2,7 @@ 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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index ab35ec6..575aa42 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index eadd5e4..f6cd2fe 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index 56d27f4..a758d4e 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 81c1b46..cabf875 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 0d2f63e..606878f 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index e499792..0d8f990 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index c7cacbc..b0ae799 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index a3fd282..d7d17c4 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 483755a..507fb1f 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index d28faf9..a2ba12a 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 2f3ccb6..9ad8364 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -3,8 +3,8 @@ from appwrite.enums import MessagingProviderType client = Client() client.set_endpoint('https://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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index ee58dbb..e2ef2f6 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index e310b81..c3e7fd5 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 493f618..4c78038 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index e7c3525..c7101d1 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -3,8 +3,8 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://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 +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 658a498..c0fabdb 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 6fdd149..328a9ee 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 67d94d3..5c2d9df 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 056647f..de8b35b 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 21e9b27..b37739c 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 62c0488..23109a9 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 994fbfa..d494460 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 3fbfdc7..d7dda45 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 20de979..7764d74 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 6c73764..d1c6b0a 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 38f1b05..27db71f 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 425f498..39aed0c 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 7271449..fd091b9 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index e0c2889..b5b67b9 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 5401629..b191f8a 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index af0387e..72ddf7a 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index fb9f0b5..c977d95 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 58e7145..04c3999 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 7aede58..ca3b96a 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 9ed34b5..e145f9b 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index d232424..d546b95 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 1d3c301..0c7e7bf 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 5f61f94..b13c4fb 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 246e0a7..ecb0172 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 0fafb6d..ca6999c 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index d970440..ebec495 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 97370cb..f9bdfb4 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -2,8 +2,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) From b8a377b60915cd1b8deea066102b1d3dc082e595 Mon Sep 17 00:00:00 2001 From: root <christyjacob4@gmail.com> Date: Fri, 23 Aug 2024 15:27:10 +0000 Subject: [PATCH 24/60] chore: update SDKs for appwrite 1.6.0 --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index 0ea4b87..f85ab9f 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/6.0.0-rc.2 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/6.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '6.0.0-rc.2', + 'x-sdk-version': '6.0.0', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/setup.py b/setup.py index 96be85f..251121c 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '6.0.0-rc.2', + version = '6.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@localhost.test', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0-rc.2.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0.tar.gz', install_requires=[ 'requests', ], From bd96a2d0d4112199ad2ff3137ccaa616b3fe4184 Mon Sep 17 00:00:00 2001 From: root <christyjacob4@gmail.com> Date: Mon, 26 Aug 2024 16:57:23 +0000 Subject: [PATCH 25/60] chore: update team email --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 251121c..498598f 100644 --- a/setup.py +++ b/setup.py @@ -19,9 +19,9 @@ long_description = long_description, long_description_content_type = 'text/markdown', author = 'Appwrite Team', - author_email = 'team@localhost.test', + author_email = 'team@appwrite.io', maintainer = 'Appwrite Team', - maintainer_email = 'team@localhost.test', + maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0.tar.gz', install_requires=[ From 311881fd6fda88da26816849684310a8797869ec Mon Sep 17 00:00:00 2001 From: root <christyjacob4@gmail.com> Date: Tue, 27 Aug 2024 10:55:22 +0000 Subject: [PATCH 26/60] chore: update Appwrite version --- appwrite/services/functions.py | 16 ---------------- docs/examples/functions/list-templates.md | 14 -------------- 2 files changed, 30 deletions(-) delete mode 100644 docs/examples/functions/list-templates.md diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 92cd4fb..6fdf579 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -85,22 +85,6 @@ def list_specifications(self): 'content-type': 'application/json', }, api_params) - def list_templates(self, runtimes = None, use_cases = None, limit = None, offset = None): - """List function templates""" - - - api_path = '/functions/templates' - api_params = {} - - api_params['runtimes'] = runtimes - api_params['useCases'] = use_cases - api_params['limit'] = limit - api_params['offset'] = offset - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - def get_template(self, template_id): """Get function template""" diff --git a/docs/examples/functions/list-templates.md b/docs/examples/functions/list-templates.md deleted file mode 100644 index b3ee38a..0000000 --- a/docs/examples/functions/list-templates.md +++ /dev/null @@ -1,14 +0,0 @@ -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 - -functions = Functions(client) - -result = functions.list_templates( - runtimes = [], # optional - use_cases = [], # optional - limit = 1, # optional - offset = 0 # optional -) From 05045090547e9c83ffee495103e7890e083a9d32 Mon Sep 17 00:00:00 2001 From: root <christyjacob4@gmail.com> Date: Tue, 27 Aug 2024 11:17:09 +0000 Subject: [PATCH 27/60] chore: updates for appwrite 1.6.x --- appwrite/services/functions.py | 16 ---------------- .../functions/get-deployment-download.md | 2 +- docs/examples/functions/get-template.md | 11 ----------- 3 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 docs/examples/functions/get-template.md diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 6fdf579..34b13a9 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -81,22 +81,6 @@ def list_specifications(self): api_path = '/functions/specifications' api_params = {} - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_template(self, template_id): - """Get function template""" - - - api_path = '/functions/templates/{templateId}' - api_params = {} - if template_id is None: - raise AppwriteException('Missing required parameter: "template_id"') - - api_path = api_path.replace('{templateId}', template_id) - - return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 2813ad3..490d952 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -3,7 +3,7 @@ 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 -client.set_session('') # The user session to authenticate with +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get-template.md b/docs/examples/functions/get-template.md deleted file mode 100644 index bea5b6a..0000000 --- a/docs/examples/functions/get-template.md +++ /dev/null @@ -1,11 +0,0 @@ -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 - -functions = Functions(client) - -result = functions.get_template( - template_id = '<TEMPLATE_ID>' -) From d9de0e489709d10b43938565fd9b1436611e9ef3 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Mon, 9 Sep 2024 19:25:06 +1200 Subject: [PATCH 28/60] Add update attribute parameters --- README.md | 4 +- appwrite/client.py | 11 ++- appwrite/enums/name.py | 2 +- appwrite/enums/runtime.py | 1 + appwrite/services/account.py | 14 ++-- appwrite/services/databases.py | 31 ++++--- appwrite/services/functions.py | 81 +++++++++++++++---- appwrite/services/users.py | 18 +++++ .../account/create-anonymous-session.md | 2 +- .../account/create-email-password-session.md | 2 +- docs/examples/account/create-email-token.md | 2 +- docs/examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-token.md | 2 +- .../account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- .../account/create-mfa-recovery-codes.md | 2 +- docs/examples/account/create-o-auth2token.md | 2 +- docs/examples/account/create-phone-token.md | 2 +- .../account/create-phone-verification.md | 2 +- docs/examples/account/create-recovery.md | 2 +- docs/examples/account/create-session.md | 2 +- docs/examples/account/create-verification.md | 2 +- docs/examples/account/create.md | 2 +- docs/examples/account/delete-identity.md | 2 +- .../account/delete-mfa-authenticator.md | 5 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/delete-sessions.md | 2 +- .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/get-prefs.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/get.md | 2 +- docs/examples/account/list-identities.md | 2 +- docs/examples/account/list-logs.md | 2 +- docs/examples/account/list-mfa-factors.md | 2 +- docs/examples/account/list-sessions.md | 2 +- docs/examples/account/update-email.md | 2 +- docs/examples/account/update-m-f-a.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- .../account/update-mfa-recovery-codes.md | 2 +- docs/examples/account/update-name.md | 2 +- docs/examples/account/update-password.md | 2 +- docs/examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- docs/examples/account/update-phone.md | 2 +- docs/examples/account/update-prefs.md | 2 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-status.md | 2 +- docs/examples/account/update-verification.md | 2 +- docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-favicon.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/avatars/get-image.md | 2 +- docs/examples/avatars/get-initials.md | 2 +- docs/examples/avatars/get-q-r.md | 2 +- .../databases/create-boolean-attribute.md | 4 +- docs/examples/databases/create-collection.md | 4 +- .../databases/create-datetime-attribute.md | 4 +- docs/examples/databases/create-document.md | 2 +- .../databases/create-email-attribute.md | 4 +- .../databases/create-enum-attribute.md | 4 +- .../databases/create-float-attribute.md | 4 +- docs/examples/databases/create-index.md | 4 +- .../databases/create-integer-attribute.md | 4 +- .../examples/databases/create-ip-attribute.md | 4 +- .../create-relationship-attribute.md | 4 +- .../databases/create-string-attribute.md | 4 +- .../databases/create-url-attribute.md | 4 +- docs/examples/databases/create.md | 4 +- docs/examples/databases/delete-attribute.md | 4 +- docs/examples/databases/delete-collection.md | 4 +- docs/examples/databases/delete-document.md | 2 +- docs/examples/databases/delete-index.md | 4 +- docs/examples/databases/delete.md | 4 +- docs/examples/databases/get-attribute.md | 4 +- docs/examples/databases/get-collection.md | 4 +- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/get-index.md | 4 +- docs/examples/databases/get.md | 4 +- docs/examples/databases/list-attributes.md | 4 +- docs/examples/databases/list-collections.md | 4 +- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.md | 4 +- docs/examples/databases/list.md | 4 +- .../databases/update-boolean-attribute.md | 7 +- docs/examples/databases/update-collection.md | 4 +- .../databases/update-datetime-attribute.md | 7 +- docs/examples/databases/update-document.md | 2 +- .../databases/update-email-attribute.md | 7 +- .../databases/update-enum-attribute.md | 7 +- .../databases/update-float-attribute.md | 7 +- .../databases/update-integer-attribute.md | 7 +- .../examples/databases/update-ip-attribute.md | 7 +- .../update-relationship-attribute.md | 7 +- .../databases/update-string-attribute.md | 8 +- .../databases/update-url-attribute.md | 7 +- docs/examples/databases/update.md | 4 +- docs/examples/functions/create-build.md | 6 +- docs/examples/functions/create-deployment.md | 4 +- docs/examples/functions/create-execution.md | 5 +- docs/examples/functions/create-variable.md | 4 +- docs/examples/functions/create.md | 8 +- docs/examples/functions/delete-deployment.md | 4 +- docs/examples/functions/delete-execution.md | 13 +++ docs/examples/functions/delete-variable.md | 4 +- docs/examples/functions/delete.md | 4 +- ...ployment.md => get-deployment-download.md} | 6 +- docs/examples/functions/get-deployment.md | 4 +- docs/examples/functions/get-execution.md | 2 +- docs/examples/functions/get-variable.md | 4 +- docs/examples/functions/get.md | 4 +- docs/examples/functions/list-deployments.md | 4 +- docs/examples/functions/list-executions.md | 2 +- docs/examples/functions/list-runtimes.md | 4 +- .../examples/functions/list-specifications.md | 10 +++ docs/examples/functions/list-variables.md | 4 +- docs/examples/functions/list.md | 4 +- .../functions/update-deployment-build.md | 13 +++ docs/examples/functions/update-deployment.md | 4 +- docs/examples/functions/update-variable.md | 4 +- docs/examples/functions/update.md | 8 +- docs/examples/graphql/mutation.md | 4 +- docs/examples/graphql/query.md | 4 +- docs/examples/health/get-antivirus.md | 4 +- docs/examples/health/get-cache.md | 4 +- docs/examples/health/get-certificate.md | 4 +- docs/examples/health/get-d-b.md | 4 +- docs/examples/health/get-failed-jobs.md | 4 +- docs/examples/health/get-pub-sub.md | 4 +- docs/examples/health/get-queue-builds.md | 4 +- .../examples/health/get-queue-certificates.md | 4 +- docs/examples/health/get-queue-databases.md | 4 +- docs/examples/health/get-queue-deletes.md | 4 +- docs/examples/health/get-queue-functions.md | 4 +- docs/examples/health/get-queue-logs.md | 4 +- docs/examples/health/get-queue-mails.md | 4 +- docs/examples/health/get-queue-messaging.md | 4 +- docs/examples/health/get-queue-migrations.md | 4 +- docs/examples/health/get-queue-usage-dump.md | 4 +- docs/examples/health/get-queue-usage.md | 4 +- docs/examples/health/get-queue-webhooks.md | 4 +- docs/examples/health/get-queue.md | 4 +- docs/examples/health/get-storage-local.md | 4 +- docs/examples/health/get-storage.md | 4 +- docs/examples/health/get-time.md | 4 +- docs/examples/health/get.md | 4 +- docs/examples/locale/get.md | 2 +- docs/examples/locale/list-codes.md | 2 +- docs/examples/locale/list-continents.md | 2 +- docs/examples/locale/list-countries-e-u.md | 2 +- docs/examples/locale/list-countries-phones.md | 2 +- docs/examples/locale/list-countries.md | 2 +- docs/examples/locale/list-currencies.md | 2 +- docs/examples/locale/list-languages.md | 2 +- .../messaging/create-apns-provider.md | 4 +- docs/examples/messaging/create-email.md | 4 +- .../examples/messaging/create-fcm-provider.md | 4 +- .../messaging/create-mailgun-provider.md | 4 +- .../messaging/create-msg91provider.md | 4 +- docs/examples/messaging/create-push.md | 4 +- .../messaging/create-sendgrid-provider.md | 4 +- docs/examples/messaging/create-sms.md | 4 +- .../messaging/create-smtp-provider.md | 4 +- docs/examples/messaging/create-subscriber.md | 4 +- .../messaging/create-telesign-provider.md | 4 +- .../messaging/create-textmagic-provider.md | 4 +- docs/examples/messaging/create-topic.md | 4 +- .../messaging/create-twilio-provider.md | 4 +- .../messaging/create-vonage-provider.md | 4 +- docs/examples/messaging/delete-provider.md | 4 +- docs/examples/messaging/delete-subscriber.md | 4 +- docs/examples/messaging/delete-topic.md | 4 +- docs/examples/messaging/delete.md | 4 +- docs/examples/messaging/get-message.md | 4 +- docs/examples/messaging/get-provider.md | 4 +- docs/examples/messaging/get-subscriber.md | 4 +- docs/examples/messaging/get-topic.md | 4 +- docs/examples/messaging/list-message-logs.md | 4 +- docs/examples/messaging/list-messages.md | 4 +- docs/examples/messaging/list-provider-logs.md | 4 +- docs/examples/messaging/list-providers.md | 4 +- .../messaging/list-subscriber-logs.md | 4 +- docs/examples/messaging/list-subscribers.md | 4 +- docs/examples/messaging/list-targets.md | 4 +- docs/examples/messaging/list-topic-logs.md | 4 +- docs/examples/messaging/list-topics.md | 4 +- .../messaging/update-apns-provider.md | 4 +- docs/examples/messaging/update-email.md | 4 +- .../examples/messaging/update-fcm-provider.md | 4 +- .../messaging/update-mailgun-provider.md | 4 +- .../messaging/update-msg91provider.md | 4 +- docs/examples/messaging/update-push.md | 4 +- .../messaging/update-sendgrid-provider.md | 4 +- docs/examples/messaging/update-sms.md | 4 +- .../messaging/update-smtp-provider.md | 4 +- .../messaging/update-telesign-provider.md | 4 +- .../messaging/update-textmagic-provider.md | 4 +- docs/examples/messaging/update-topic.md | 4 +- .../messaging/update-twilio-provider.md | 4 +- .../messaging/update-vonage-provider.md | 4 +- docs/examples/storage/create-bucket.md | 4 +- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/delete-bucket.md | 4 +- docs/examples/storage/delete-file.md | 2 +- docs/examples/storage/get-bucket.md | 4 +- docs/examples/storage/get-file-download.md | 2 +- docs/examples/storage/get-file-preview.md | 2 +- docs/examples/storage/get-file-view.md | 2 +- docs/examples/storage/get-file.md | 2 +- docs/examples/storage/list-buckets.md | 4 +- docs/examples/storage/list-files.md | 2 +- docs/examples/storage/update-bucket.md | 4 +- docs/examples/storage/update-file.md | 2 +- docs/examples/teams/create-membership.md | 2 +- docs/examples/teams/create.md | 2 +- docs/examples/teams/delete-membership.md | 2 +- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 2 +- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-memberships.md | 2 +- docs/examples/teams/list.md | 2 +- .../teams/update-membership-status.md | 2 +- docs/examples/teams/update-membership.md | 2 +- docs/examples/teams/update-name.md | 2 +- docs/examples/teams/update-prefs.md | 2 +- docs/examples/users/create-argon2user.md | 4 +- docs/examples/users/create-bcrypt-user.md | 4 +- docs/examples/users/create-j-w-t.md | 14 ++++ docs/examples/users/create-m-d5user.md | 4 +- .../users/create-mfa-recovery-codes.md | 4 +- docs/examples/users/create-p-h-pass-user.md | 4 +- docs/examples/users/create-s-h-a-user.md | 4 +- .../users/create-scrypt-modified-user.md | 4 +- docs/examples/users/create-scrypt-user.md | 4 +- docs/examples/users/create-session.md | 4 +- docs/examples/users/create-target.md | 4 +- docs/examples/users/create-token.md | 4 +- docs/examples/users/create.md | 4 +- docs/examples/users/delete-identity.md | 4 +- .../users/delete-mfa-authenticator.md | 4 +- docs/examples/users/delete-session.md | 4 +- docs/examples/users/delete-sessions.md | 4 +- docs/examples/users/delete-target.md | 4 +- docs/examples/users/delete.md | 4 +- docs/examples/users/get-mfa-recovery-codes.md | 4 +- docs/examples/users/get-prefs.md | 4 +- docs/examples/users/get-target.md | 4 +- docs/examples/users/get.md | 4 +- docs/examples/users/list-identities.md | 4 +- docs/examples/users/list-logs.md | 4 +- docs/examples/users/list-memberships.md | 4 +- docs/examples/users/list-mfa-factors.md | 4 +- docs/examples/users/list-sessions.md | 4 +- docs/examples/users/list-targets.md | 4 +- docs/examples/users/list.md | 4 +- .../users/update-email-verification.md | 4 +- docs/examples/users/update-email.md | 4 +- docs/examples/users/update-labels.md | 4 +- .../users/update-mfa-recovery-codes.md | 4 +- docs/examples/users/update-mfa.md | 4 +- docs/examples/users/update-name.md | 4 +- docs/examples/users/update-password.md | 4 +- .../users/update-phone-verification.md | 4 +- docs/examples/users/update-phone.md | 4 +- docs/examples/users/update-prefs.md | 4 +- docs/examples/users/update-status.md | 4 +- docs/examples/users/update-target.md | 4 +- setup.py | 4 +- 272 files changed, 638 insertions(+), 489 deletions(-) create mode 100644 docs/examples/functions/delete-execution.md rename docs/examples/functions/{download-deployment.md => get-deployment-download.md} (58%) create mode 100644 docs/examples/functions/list-specifications.md create mode 100644 docs/examples/functions/update-deployment-build.md create mode 100644 docs/examples/users/create-j-w-t.md diff --git a/README.md b/README.md index 99af0d3..eb42d99 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.5.6-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** +**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite/client.py b/appwrite/client.py index 256732e..f85ab9f 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,12 +13,12 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/5.0.3 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/6.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '5.0.3', - 'X-Appwrite-Response-Format' : '1.5.0', + 'x-sdk-version': '6.0.0', + 'X-Appwrite-Response-Format' : '1.6.0', } def set_self_signed(self, status=True): @@ -113,6 +113,11 @@ def call(self, method, path='', headers=None, params=None, response_type='json') response.raise_for_status() + warnings = response.headers.get('x-appwrite-warning') + if warnings: + for warning in warnings.split(';'): + print(f'Warning: {warning}') + content_type = response.headers['Content-Type'] if response_type == 'location': diff --git a/appwrite/enums/name.py b/appwrite/enums/name.py index b61606a..c5ad74e 100644 --- a/appwrite/enums/name.py +++ b/appwrite/enums/name.py @@ -8,7 +8,7 @@ class Name(Enum): V1_FUNCTIONS = "v1-functions" V1_USAGE = "v1-usage" V1_USAGE_DUMP = "v1-usage-dump" - WEBHOOKSV1 = "webhooksv1" + V1_WEBHOOKS = "v1-webhooks" V1_CERTIFICATES = "v1-certificates" V1_BUILDS = "v1-builds" V1_MESSAGING = "v1-messaging" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index c4273e6..a52ca61 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -46,3 +46,4 @@ class Runtime(Enum): CPP_17 = "cpp-17" CPP_20 = "cpp-20" BUN_1_0 = "bun-1.0" + GO_1_23 = "go-1.23" diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 5f30898..7e38e08 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -95,7 +95,7 @@ def create_jwt(self): """Create JWT""" - api_path = '/account/jwt' + api_path = '/account/jwts' api_params = {} return self.client.call('post', api_path, { @@ -132,7 +132,7 @@ def update_mfa(self, mfa): }, api_params) def create_mfa_authenticator(self, type): - """Add Authenticator""" + """Create Authenticator""" api_path = '/account/mfa/authenticators/{type}' @@ -167,7 +167,7 @@ def update_mfa_authenticator(self, type, otp): 'content-type': 'application/json', }, api_params) - def delete_mfa_authenticator(self, type, otp): + def delete_mfa_authenticator(self, type): """Delete Authenticator""" @@ -176,19 +176,15 @@ def delete_mfa_authenticator(self, type, otp): if type is None: raise AppwriteException('Missing required parameter: "type"') - if otp is None: - raise AppwriteException('Missing required parameter: "otp"') - api_path = api_path.replace('{type}', type) - api_params['otp'] = otp return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) def create_mfa_challenge(self, factor): - """Create 2FA Challenge""" + """Create MFA Challenge""" api_path = '/account/mfa/challenge' @@ -693,7 +689,7 @@ def create_phone_verification(self): }, api_params) def update_phone_verification(self, user_id, secret): - """Create phone verification (confirmation)""" + """Update phone verification (confirmation)""" api_path = '/account/verification/phone' diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 801b19b..aa47e4e 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -257,7 +257,7 @@ def create_boolean_attribute(self, database_id, collection_id, key, required, de 'content-type': 'application/json', }, api_params) - def update_boolean_attribute(self, database_id, collection_id, key, required, default): + def update_boolean_attribute(self, database_id, collection_id, key, required, default, new_key = None): """Update boolean attribute""" @@ -281,6 +281,7 @@ def update_boolean_attribute(self, database_id, collection_id, key, required, de api_params['required'] = required api_params['default'] = default + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -316,7 +317,7 @@ def create_datetime_attribute(self, database_id, collection_id, key, required, d 'content-type': 'application/json', }, api_params) - def update_datetime_attribute(self, database_id, collection_id, key, required, default): + def update_datetime_attribute(self, database_id, collection_id, key, required, default, new_key = None): """Update dateTime attribute""" @@ -340,6 +341,7 @@ def update_datetime_attribute(self, database_id, collection_id, key, required, d api_params['required'] = required api_params['default'] = default + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -375,7 +377,7 @@ def create_email_attribute(self, database_id, collection_id, key, required, defa 'content-type': 'application/json', }, api_params) - def update_email_attribute(self, database_id, collection_id, key, required, default): + def update_email_attribute(self, database_id, collection_id, key, required, default, new_key = None): """Update email attribute""" @@ -399,6 +401,7 @@ def update_email_attribute(self, database_id, collection_id, key, required, defa api_params['required'] = required api_params['default'] = default + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -438,7 +441,7 @@ def create_enum_attribute(self, database_id, collection_id, key, elements, requi 'content-type': 'application/json', }, api_params) - def update_enum_attribute(self, database_id, collection_id, key, elements, required, default): + def update_enum_attribute(self, database_id, collection_id, key, elements, required, default, new_key = None): """Update enum attribute""" @@ -466,6 +469,7 @@ def update_enum_attribute(self, database_id, collection_id, key, elements, requi api_params['elements'] = elements api_params['required'] = required api_params['default'] = default + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -503,7 +507,7 @@ def create_float_attribute(self, database_id, collection_id, key, required, min 'content-type': 'application/json', }, api_params) - def update_float_attribute(self, database_id, collection_id, key, required, min, max, default): + def update_float_attribute(self, database_id, collection_id, key, required, min, max, default, new_key = None): """Update float attribute""" @@ -535,6 +539,7 @@ def update_float_attribute(self, database_id, collection_id, key, required, min, api_params['min'] = min api_params['max'] = max api_params['default'] = default + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -572,7 +577,7 @@ def create_integer_attribute(self, database_id, collection_id, key, required, mi 'content-type': 'application/json', }, api_params) - def update_integer_attribute(self, database_id, collection_id, key, required, min, max, default): + def update_integer_attribute(self, database_id, collection_id, key, required, min, max, default, new_key = None): """Update integer attribute""" @@ -604,6 +609,7 @@ def update_integer_attribute(self, database_id, collection_id, key, required, mi api_params['min'] = min api_params['max'] = max api_params['default'] = default + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -639,7 +645,7 @@ def create_ip_attribute(self, database_id, collection_id, key, required, default 'content-type': 'application/json', }, api_params) - def update_ip_attribute(self, database_id, collection_id, key, required, default): + def update_ip_attribute(self, database_id, collection_id, key, required, default, new_key = None): """Update IP address attribute""" @@ -663,6 +669,7 @@ def update_ip_attribute(self, database_id, collection_id, key, required, default api_params['required'] = required api_params['default'] = default + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -735,7 +742,7 @@ def create_string_attribute(self, database_id, collection_id, key, size, require 'content-type': 'application/json', }, api_params) - def update_string_attribute(self, database_id, collection_id, key, required, default): + def update_string_attribute(self, database_id, collection_id, key, required, default, size = None, new_key = None): """Update string attribute""" @@ -759,6 +766,8 @@ def update_string_attribute(self, database_id, collection_id, key, required, def api_params['required'] = required api_params['default'] = default + api_params['size'] = size + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -794,7 +803,7 @@ def create_url_attribute(self, database_id, collection_id, key, required, defaul 'content-type': 'application/json', }, api_params) - def update_url_attribute(self, database_id, collection_id, key, required, default): + def update_url_attribute(self, database_id, collection_id, key, required, default, new_key = None): """Update URL attribute""" @@ -818,6 +827,7 @@ def update_url_attribute(self, database_id, collection_id, key, required, defaul api_params['required'] = required api_params['default'] = default + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', @@ -871,7 +881,7 @@ def delete_attribute(self, database_id, collection_id, key): 'content-type': 'application/json', }, api_params) - def update_relationship_attribute(self, database_id, collection_id, key, on_delete = None): + def update_relationship_attribute(self, database_id, collection_id, key, on_delete = None, new_key = None): """Update relationship attribute""" @@ -891,6 +901,7 @@ def update_relationship_attribute(self, database_id, collection_id, key, on_dele api_path = api_path.replace('{key}', key) api_params['onDelete'] = on_delete + api_params['newKey'] = new_key return self.client.call('patch', api_path, { 'content-type': 'application/json', diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index f5e3d42..34b13a9 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -20,7 +20,7 @@ def list(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_branch = None): + def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None, specification = None): """Create function""" @@ -47,6 +47,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche api_params['logging'] = logging api_params['entrypoint'] = entrypoint api_params['commands'] = commands + api_params['scopes'] = scopes api_params['installationId'] = installation_id api_params['providerRepositoryId'] = provider_repository_id api_params['providerBranch'] = provider_branch @@ -55,7 +56,8 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche api_params['templateRepository'] = template_repository api_params['templateOwner'] = template_owner api_params['templateRootDirectory'] = template_root_directory - api_params['templateBranch'] = template_branch + api_params['templateVersion'] = template_version + api_params['specification'] = specification return self.client.call('post', api_path, { 'content-type': 'application/json', @@ -72,6 +74,17 @@ def list_runtimes(self): 'content-type': 'application/json', }, api_params) + def list_specifications(self): + """List available function runtime specifications""" + + + api_path = '/functions/specifications' + api_params = {} + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + def get(self, function_id): """Get function""" @@ -88,7 +101,7 @@ def get(self, function_id): 'content-type': 'application/json', }, api_params) - def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None): + def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, specification = None): """Update function""" @@ -112,11 +125,13 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non api_params['logging'] = logging api_params['entrypoint'] = entrypoint api_params['commands'] = commands + api_params['scopes'] = scopes api_params['installationId'] = installation_id api_params['providerRepositoryId'] = provider_repository_id api_params['providerBranch'] = provider_branch api_params['providerSilentMode'] = provider_silent_mode api_params['providerRootDirectory'] = provider_root_directory + api_params['specification'] = specification return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -208,7 +223,7 @@ def get_deployment(self, function_id, deployment_id): }, api_params) def update_deployment(self, function_id, deployment_id): - """Update function deployment""" + """Update deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' @@ -247,11 +262,11 @@ def delete_deployment(self, function_id, deployment_id): 'content-type': 'application/json', }, api_params) - def create_build(self, function_id, deployment_id, build_id): - """Create build""" + def create_build(self, function_id, deployment_id, build_id = None): + """Rebuild deployment""" - api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}' + api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} if function_id is None: raise AppwriteException('Missing required parameter: "function_id"') @@ -259,20 +274,37 @@ def create_build(self, function_id, deployment_id, build_id): if deployment_id is None: raise AppwriteException('Missing required parameter: "deployment_id"') - if build_id is None: - raise AppwriteException('Missing required parameter: "build_id"') - api_path = api_path.replace('{functionId}', function_id) api_path = api_path.replace('{deploymentId}', deployment_id) - api_path = api_path.replace('{buildId}', build_id) + api_params['buildId'] = build_id return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def download_deployment(self, function_id, deployment_id): - """Download Deployment""" + def update_deployment_build(self, function_id, deployment_id): + """Cancel deployment""" + + + api_path = '/functions/{functionId}/deployments/{deploymentId}/build' + api_params = {} + if function_id is None: + raise AppwriteException('Missing required parameter: "function_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{functionId}', function_id) + api_path = api_path.replace('{deploymentId}', deployment_id) + + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_deployment_download(self, function_id, deployment_id): + """Download deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}/download' @@ -309,7 +341,7 @@ def list_executions(self, function_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None): + def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None): """Create execution""" @@ -325,6 +357,7 @@ def create_execution(self, function_id, body = None, xasync = None, path = None, api_params['path'] = path api_params['method'] = method api_params['headers'] = headers + api_params['scheduledAt'] = scheduled_at return self.client.call('post', api_path, { 'content-type': 'application/json', @@ -350,6 +383,26 @@ def get_execution(self, function_id, execution_id): 'content-type': 'application/json', }, api_params) + def delete_execution(self, function_id, execution_id): + """Delete execution""" + + + api_path = '/functions/{functionId}/executions/{executionId}' + api_params = {} + if function_id is None: + raise AppwriteException('Missing required parameter: "function_id"') + + if execution_id is None: + raise AppwriteException('Missing required parameter: "execution_id"') + + api_path = api_path.replace('{functionId}', function_id) + api_path = api_path.replace('{executionId}', execution_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + def list_variables(self, function_id): """List variables""" diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 137d2ba..698fbf1 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -330,6 +330,24 @@ def update_email(self, user_id, email): 'content-type': 'application/json', }, api_params) + def create_jwt(self, user_id, session_id = None, duration = None): + """Create user JWT""" + + + api_path = '/users/{userId}/jwts' + api_params = {} + if user_id is None: + raise AppwriteException('Missing required parameter: "user_id"') + + api_path = api_path.replace('{userId}', user_id) + + api_params['sessionId'] = session_id + api_params['duration'] = duration + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_labels(self, user_id, labels): """Update user labels""" diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index afaa76b..36ed47d 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 667d85a..b85cc3d 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index a283f42..4c18324 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index bc9b684..2121514 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 1f6593b..c015418 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 1c59624..16a8e2e 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 5448d96..017fdd2 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticationFactor client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index c675936..452b47f 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 96c0f88..0cc89df 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -3,7 +3,7 @@ from appwrite.enums import OAuthProvider client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index b7597df..30c80df 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index ca46b01..fd0a262 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index c16be97..e9613cd 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 118a1ab..d129e10 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 6138686..5ff238f 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index d165697..33b6f3f 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 1462fbc..ef57289 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 5deb210..0fbe8c7 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -3,12 +3,11 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +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, - otp = '<OTP>' + type = AuthenticatorType.TOTP ) diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 030d698..fa0049c 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 182c375..6ebe286 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 123fe4b..ec70595 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 102f4dc..67d0741 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index b9483ac..f7ae72d 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index cc66fe6..9ded8e9 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 3e0d4e0..c51da2c 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 0c0b28a..750f977 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 007c237..2220475 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 23398dc..b3427c0 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 353edb0..b0a2a16 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index b59ede8..561e7cc 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index 631fac0..f6b69b0 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index dc9a21f..42b91f1 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 7074e6d..5964df4 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 281d892..4f0b136 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 8e16f49..d0027a8 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 7d651c2..888349e 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index ff0c10d..404d2b4 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index adb5b35..41ceb4b 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index c05bb16..b7414e6 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 2c58cca..f69dc12 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 4dca711..a331413 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 006c508..3768326 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 5c17fa1..4f9add8 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 84c8c4b..35faf53 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with account = Account(client) diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 1de5eab..91dde3b 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -3,7 +3,7 @@ from appwrite.enums import Browser client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 9437ff8..cec2f61 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -3,7 +3,7 @@ from appwrite.enums import CreditCard client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 2867696..4aa0177 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 37ac482..6b12dac 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -3,7 +3,7 @@ from appwrite.enums import Flag client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 00afe0c..202955c 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 0a20c14..233da1b 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index bee29f7..1296394 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with avatars = Avatars(client) diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index bf09562..183a2b6 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index dfe3611..fd9e3a6 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 0b8a555..7435742 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index a457811..bd3993f 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 840e6b5..f4b427e 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 0e891d5..dce6355 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 34fda4f..a658bd8 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 72fe622..015b762 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -3,8 +3,8 @@ from appwrite.enums import IndexType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 057cfb7..9f409e4 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 54e887c..ab4d357 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 0d1dbe0..76b5db1 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -3,8 +3,8 @@ from appwrite.enums import RelationshipType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index c15512a..d6f7f94 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index f77a630..3b105d8 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 329e653..a4ddc92 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 87fcf57..7f490b2 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 296c69d..c3083a5 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 3191f10..c3e296a 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index bd4fcf5..d5a12c1 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 302a652..41d5f18 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 8316fe7..e505fe9 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 7b0c7e4..7be57ea 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 978c5a5..83faade 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index e53878c..6038868 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index b12f7d8..8fe2358 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 4628394..a29aefa 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 0ceed95..0e61332 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 08f3c89..dee130e 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 05a9e15..40578a1 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 8ba8b28..aa934b2 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 8cf9bc8..553d94b 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -12,5 +12,6 @@ result = databases.update_boolean_attribute( collection_id = '<COLLECTION_ID>', key = '', required = False, - default = False + default = False, + new_key = '' # optional ) diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 9f0615f..3432b6b 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 5541dd4..f9056d2 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -12,5 +12,6 @@ result = databases.update_datetime_attribute( collection_id = '<COLLECTION_ID>', key = '', required = False, - default = '' + default = '', + new_key = '' # optional ) diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 37c1b43..07bba76 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with databases = Databases(client) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index cedde9d..45a8d0d 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -12,5 +12,6 @@ result = databases.update_email_attribute( collection_id = '<COLLECTION_ID>', key = '', required = False, - default = 'email@example.com' + default = 'email@example.com', + new_key = '' # optional ) diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 76ede75..c07f375 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -13,5 +13,6 @@ result = databases.update_enum_attribute( key = '', elements = [], required = False, - default = '<DEFAULT>' + default = '<DEFAULT>', + new_key = '' # optional ) diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 1556e03..fa1767e 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -14,5 +14,6 @@ result = databases.update_float_attribute( required = False, min = None, max = None, - default = None + default = None, + new_key = '' # optional ) diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 37a87ed..0db9707 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -14,5 +14,6 @@ result = databases.update_integer_attribute( required = False, min = None, max = None, - default = None + default = None, + new_key = '' # optional ) diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index d6df600..135dbd8 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -12,5 +12,6 @@ result = databases.update_ip_attribute( collection_id = '<COLLECTION_ID>', key = '', required = False, - default = '' + default = '', + new_key = '' # optional ) diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 8c9fb45..bc528f1 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -11,5 +11,6 @@ result = databases.update_relationship_attribute( database_id = '<DATABASE_ID>', collection_id = '<COLLECTION_ID>', key = '', - on_delete = RelationMutate.CASCADE # optional + on_delete = RelationMutate.CASCADE, # optional + new_key = '' # optional ) diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index d765acf..bbe7ddb 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -12,5 +12,7 @@ result = databases.update_string_attribute( collection_id = '<COLLECTION_ID>', key = '', required = False, - default = '<DEFAULT>' + default = '<DEFAULT>', + size = None, # optional + new_key = '' # optional ) diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 3a6347c..8e3a28d 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) @@ -12,5 +12,6 @@ result = databases.update_url_attribute( collection_id = '<COLLECTION_ID>', key = '', required = False, - default = 'https://example.com' + default = 'https://example.com', + new_key = '' # optional ) diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index ab6227f..765f28a 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index f3422f3..c4eb9d0 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -2,13 +2,13 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +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_build( function_id = '<FUNCTION_ID>', deployment_id = '<DEPLOYMENT_ID>', - build_id = '<BUILD_ID>' + build_id = '<BUILD_ID>' # optional ) diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 68ae7a9..da9b559 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -3,8 +3,8 @@ from appwrite.input_file import InputFile client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 46c64b2..e1decb9 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) @@ -13,5 +13,6 @@ result = functions.create_execution( async = False, # optional path = '<PATH>', # optional method = ExecutionMethod.GET, # optional - headers = {} # optional + headers = {}, # optional + scheduled_at = '' # optional ) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 6b4e955..cd73e30 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 76320c2..a65b87d 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -3,8 +3,8 @@ from appwrite.enums import client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) @@ -20,6 +20,7 @@ result = functions.create( 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 @@ -28,5 +29,6 @@ result = functions.create( template_repository = '<TEMPLATE_REPOSITORY>', # optional template_owner = '<TEMPLATE_OWNER>', # optional template_root_directory = '<TEMPLATE_ROOT_DIRECTORY>', # optional - template_branch = '<TEMPLATE_BRANCH>' # optional + template_version = '<TEMPLATE_VERSION>', # optional + specification = '' # optional ) diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index def007b..780ce9d 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md new file mode 100644 index 0000000..7c3ea09 --- /dev/null +++ b/docs/examples/functions/delete-execution.md @@ -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 +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete_execution( + function_id = '<FUNCTION_ID>', + execution_id = '<EXECUTION_ID>' +) diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 96f1304..646a0f3 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 7e20857..2950ed0 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/get-deployment-download.md similarity index 58% rename from docs/examples/functions/download-deployment.md rename to docs/examples/functions/get-deployment-download.md index 91c1fac..490d952 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/get-deployment-download.md @@ -2,12 +2,12 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) -result = functions.download_deployment( +result = functions.get_deployment_download( function_id = '<FUNCTION_ID>', deployment_id = '<DEPLOYMENT_ID>' ) diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index e2b8e3f..8846888 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 04be41b..f3dfc0f 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 2115700..fd903f3 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index f630486..cb765e4 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index c681463..f776345 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 50dc7cb..0012baf 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with functions = Functions(client) diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index ae64245..edad1a9 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md new file mode 100644 index 0000000..a9c7417 --- /dev/null +++ b/docs/examples/functions/list-specifications.md @@ -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('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.list_specifications() diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index cfd0b64..188c17b 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index bc4fc21..5b315e1 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md new file mode 100644 index 0000000..a8d93b8 --- /dev/null +++ b/docs/examples/functions/update-deployment-build.md @@ -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 +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.update_deployment_build( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 59e183e..9fce384 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 3fb73e0..238fc91 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index edc1b0c..5f2a70b 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) @@ -19,9 +19,11 @@ result = functions.update( 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 + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + specification = '' # optional ) diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 3d9ad02..0ec3d3e 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key graphql = Graphql(client) diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index deb07a8..95709fd 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key graphql = Graphql(client) diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 5ba2199..ff93cea 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 02b85b3..fa2a6da 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 83018cf..2a73583 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 5446df5..18e3968 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index ad9f88c..ce33c8c 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -3,8 +3,8 @@ from appwrite.enums import client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 84ffd97..db66c7f 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index b513c2c..9daed58 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index bbeece1..a7d35bc 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 936266c..50f8943 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index b39b445..b6e6a4d 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index a989a6a..5868b3c 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 47a56f7..254fe23 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 39fc879..c6ab409 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 3862c9e..1007913 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 85a5e56..db59028 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-usage-dump.md index 2b8e302..cc31b4f 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-usage-dump.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 42d7281..67d9e64 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 435ba95..9188467 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 81ea4ba..61e5a40 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index c262455..276c305 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index ebe83ed..b2de63b 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 02405db..4089305 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index 22034e7..f41e0e3 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 8915eb1..fc048dd 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 9d2c939..d516538 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index fadd5f3..f6d8495 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 2f3bd50..8bdac2e 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 134ddaa..516d822 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index f344cc1..8fcbe1a 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 19d831f..4708498 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 6de06d3..9583cd8 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with locale = Locale(client) diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 287472f..022209d 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index acca4d5..38005a3 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 43c882b..84c38ea 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 38eb415..fa94da9 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index d11812c..0cffc4e 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 7da7ac7..ffed825 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index e22dad8..6e9b812 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 38c3665..c3e7fe7 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index b3b299b..24108d2 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index d6ffd09..81b0c5f 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token messaging = Messaging(client) diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index b1fbab3..b06033c 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index bd251d9..6dc1030 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index e8532b2..b0184b5 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 3535fd0..c73e941 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 6078096..cfee0ad 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 58e1684..4d2bd6d 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 4988d06..5d404d1 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token messaging = Messaging(client) diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 769df6e..b270b2a 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index a25e80b..c62c8c0 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index db6506e..4b4ef39 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 3e71e95..fdf94f0 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index e8bb030..7f8284f 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index a5e9e7b..57c465b 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 1cfbb2e..752e449 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 4292733..7219f09 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index be2f735..148814c 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 477c3b2..3e89695 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 744b53f..7efaead 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index ec8ef1d..fe2442d 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 7ccc6f9..0622571 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 4813049..de72a76 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 6bae445..1379708 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 4e3f998..2bfd3ed 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index a2d2589..6cff0ae 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index d2179b6..7ca9f38 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index d04c617..a89338d 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index d13a387..4c61950 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index ff136b9..3c3965c 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 4d10aad..8b67b7a 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 4b9319b..aadbd9a 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index f3a9b96..74232e9 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 9c3c5bb..2649281 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 4da5e71..bbe4a93 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 73c2c88..ee4d004 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 8461df0..52eed3b 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 32708b0..7cb1594 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key messaging = Messaging(client) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index bbeebf1..c6e9e33 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index b8cae35..d275070 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -3,7 +3,7 @@ from appwrite.input_file import InputFile client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index cd008a7..77d72eb 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 69fe398..775065d 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 8740eb5..adb78e8 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 30fff99..b419ea0 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 08dcb47..2e3b2ac 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 6cf8565..9ce04e2 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index f54c7a5..9f04ef4 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 909d6f7..84eab54 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 73f4a28..8a2aa6d 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 4722284..4eea2a9 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key storage = Storage(client) diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 0a0b78c..0137af5 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with storage = Storage(client) diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 5be1405..4846295 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index c305b46..544ee3a 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index b9f34aa..7f0cbd4 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 18623d1..fc84152 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 06d270a..6075cc7 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 046d638..d740e69 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index ee5fdf6..6d44b80 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 997a106..f7a072a 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index f066e01..afb5de1 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 5ab354e..ee6d211 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index a681533..6726150 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 2430570..693654d 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 27de647..4661601 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with teams = Teams(client) diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 2317c81..575aa42 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 7ea2345..f6cd2fe 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md new file mode 100644 index 0000000..a758d4e --- /dev/null +++ b/docs/examples/users/create-j-w-t.md @@ -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('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_jwt( + user_id = '<USER_ID>', + session_id = '<SESSION_ID>', # optional + duration = 0 # optional +) diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 10b33e5..cabf875 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 35706cc..606878f 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 5f92330..0d8f990 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index c4c9a92..b0ae799 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 321642f..d7d17c4 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index e7da3a5..507fb1f 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 2440e50..a2ba12a 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 123a092..9ad8364 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -3,8 +3,8 @@ from appwrite.enums import MessagingProviderType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 27e4f51..e2ef2f6 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 716c4ac..c3e7fd5 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 8e9918f..4c78038 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index d418107..c7101d1 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -3,8 +3,8 @@ from appwrite.enums import AuthenticatorType client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index b3bdcb2..c0fabdb 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 08640f5..328a9ee 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 5309b17..5c2d9df 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index bb73199..de8b35b 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 529346a..b37739c 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 34614de..23109a9 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index d07591f..d494460 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index efa5941..d7dda45 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index e19a3dd..7764d74 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 54e6886..d1c6b0a 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index d0de2fb..27db71f 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 8092b0f..39aed0c 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index f4a5946..fd091b9 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 3b1e28b..b5b67b9 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 9dbe774..b191f8a 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 7c541c9..72ddf7a 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index e1c95ee..c977d95 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 2a54e76..04c3999 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 5ff7bfe..ca3b96a 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 305566a..e145f9b 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 17ebfb6..d546b95 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 1ee3edb..0c7e7bf 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 70ce29f..b13c4fb 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 10c5e61..ecb0172 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index df77346..ca6999c 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 6b8e8b8..ebec495 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index c7ec1a6..f9bdfb4 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -2,8 +2,8 @@ from appwrite.client import Client client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('5df5acd0d48c2') # Your project ID -client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) diff --git a/setup.py b/setup.py index df39af5..498598f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '5.0.3', + version = '6.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/5.0.3.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0.tar.gz', install_requires=[ 'requests', ], From b062c62601e8e2285e26ead4868bb1f4b2112c7b Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Mon, 9 Sep 2024 19:44:05 +1200 Subject: [PATCH 29/60] Update version --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index f85ab9f..9c96d2e 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/6.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/6.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '6.0.0', + 'x-sdk-version': '6.1.0', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/setup.py b/setup.py index 498598f..8064d17 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '6.0.0', + version = '6.1.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/6.1.0.tar.gz', install_requires=[ 'requests', ], From 4e673d0215d0112929effc39544d7219b6c8527d Mon Sep 17 00:00:00 2001 From: root <matejbaco2000@gmail.com> Date: Wed, 18 Sep 2024 15:35:03 +0000 Subject: [PATCH 30/60] SDK binary support for executions --- appwrite/client.py | 50 ++--- appwrite/enums/runtime.py | 3 + appwrite/input_file.py | 21 --- appwrite/multipart.py | 48 +++++ appwrite/payload.py | 63 +++++++ appwrite/services/account.py | 173 +++++------------ appwrite/services/avatars.py | 29 +-- appwrite/services/databases.py | 169 +++++------------ appwrite/services/functions.py | 110 ++++------- appwrite/services/graphql.py | 9 +- appwrite/services/health.py | 93 +++------- appwrite/services/locale.py | 33 +--- appwrite/services/messaging.py | 185 +++++-------------- appwrite/services/storage.py | 57 ++---- appwrite/services/teams.py | 53 ++---- appwrite/services/users.py | 169 +++++------------ docs/examples/functions/create-deployment.md | 4 +- docs/examples/functions/create-execution.md | 2 +- docs/examples/storage/create-file.md | 4 +- setup.py | 4 +- 20 files changed, 422 insertions(+), 857 deletions(-) delete mode 100644 appwrite/input_file.py create mode 100644 appwrite/multipart.py create mode 100644 appwrite/payload.py diff --git a/appwrite/client.py b/appwrite/client.py index 9c96d2e..17b4fe3 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -1,8 +1,7 @@ -import io import json -import os import requests -from .input_file import InputFile +from .payload import Payload +from .multipart import MultipartParser from .exception import AppwriteException from .encoders.value_class_encoder import ValueClassEncoder @@ -13,11 +12,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/6.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/7.0.0-rc1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '6.1.0', + 'x-sdk-version': '7.0.0-rc1', 'X-Appwrite-Response-Format' : '1.6.0', } @@ -91,10 +90,14 @@ def call(self, method, path='', headers=None, params=None, response_type='json') if headers['content-type'].startswith('multipart/form-data'): del headers['content-type'] + headers['accept'] = 'multipart/form-data' stringify = True for key in data.copy(): - if isinstance(data[key], InputFile): - files[key] = (data[key].filename, data[key].data) + if isinstance(data[key], Payload): + if data[key].filename: + files[key] = (data[key].filename, data[key].to_binary()) + else: + data[key] = data[key].to_binary() del data[key] data = self.flatten(data, stringify=stringify) @@ -126,6 +129,9 @@ def call(self, method, path='', headers=None, params=None, response_type='json') if content_type.startswith('application/json'): return response.json() + if content_type.startswith('multipart/form-data'): + return MultipartParser(response.content, content_type).to_dict() + return response._content except Exception as e: if response != None: @@ -146,20 +152,10 @@ def chunked_upload( on_progress = None, upload_id = '' ): - input_file = params[param_name] - - if input_file.source_type == 'path': - size = os.stat(input_file.path).st_size - input = open(input_file.path, 'rb') - elif input_file.source_type == 'bytes': - size = len(input_file.data) - input = input_file.data - - if size < self._chunk_size: - if input_file.source_type == 'path': - input_file.data = input.read() + payload = params[param_name] + size = params[param_name].size - params[param_name] = input_file + if size < self._chunk_size: return self.call( 'post', path, @@ -182,16 +178,10 @@ def chunked_upload( input.seek(offset) while offset < size: - if input_file.source_type == 'path': - input_file.data = input.read(self._chunk_size) or input.read(size - offset) - elif input_file.source_type == 'bytes': - if offset + self._chunk_size < size: - end = offset + self._chunk_size - else: - end = size - offset - input_file.data = input[offset:end] - - params[param_name] = input_file + params[param_name] = Payload.from_binary( + payload.to_binary(offset, min(self._chunk_size, size - offset)), + payload.filename + ) headers["content-range"] = f'bytes {offset}-{min((offset + self._chunk_size) - 1, size - 1)}/{size}' result = self.call( diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index a52ca61..1e0b47a 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -21,6 +21,9 @@ class Runtime(Enum): PYTHON_3_11 = "python-3.11" PYTHON_3_12 = "python-3.12" PYTHON_ML_3_11 = "python-ml-3.11" + DENO_1_21 = "deno-1.21" + DENO_1_24 = "deno-1.24" + DENO_1_35 = "deno-1.35" DENO_1_40 = "deno-1.40" DART_2_15 = "dart-2.15" DART_2_16 = "dart-2.16" diff --git a/appwrite/input_file.py b/appwrite/input_file.py deleted file mode 100644 index 33d5a77..0000000 --- a/appwrite/input_file.py +++ /dev/null @@ -1,21 +0,0 @@ -import os -import mimetypes - -class InputFile: - @classmethod - def from_path(cls, path): - instance = cls() - instance.path = path - instance.filename = os.path.basename(path) - instance.mime_type = mimetypes.guess_type(path) - instance.source_type = 'path' - return instance - - @classmethod - def from_bytes(cls, bytes, filename, mime_type = None): - instance = cls() - instance.data = bytes - instance.filename = filename - instance.mime_type = mime_type - instance.source_type = 'bytes' - return instance \ No newline at end of file diff --git a/appwrite/multipart.py b/appwrite/multipart.py new file mode 100644 index 0000000..27ceb63 --- /dev/null +++ b/appwrite/multipart.py @@ -0,0 +1,48 @@ +from email.parser import BytesParser +from email.policy import default +from .payload import Payload + +class MultipartParser: + def __init__(self, multipart_bytes, content_type): + self.multipart_bytes = multipart_bytes + self.content_type = content_type + self.parts = {} + self.parse() + + def parse(self): + # Create a message object + headers = f'Content-Type: {self.content_type}\r\n\r\n'.encode('ascii') + msg = BytesParser(policy=default).parsebytes(headers + self.multipart_bytes) + + # Process each part + for part in msg.walk(): + if part.is_multipart(): + continue + + # Get the name from Content-Disposition + content_disposition = part.get("Content-Disposition", "") + name = part.get_param("name", header="content-disposition") + if not name: + name = f"unnamed_part_{len(self.parts)}" + + # Store the parsed data + self.parts[name] = { + "contents": part.get_payload(decode=True), + "headers": dict(part.items()) + } + + def to_dict(self): + result = {} + for name, part in self.parts.items(): + if name == "responseBody": + result[name] = Payload.from_binary(part["contents"]) + elif name == "responseHeaders": + headers_str = part["contents"].decode('utf-8', errors='replace') + result[name] = dict(line.split(": ", 1) for line in headers_str.split("\r\n") if line) + elif name == "responseStatusCode": + result[name] = int(part["contents"]) + elif name == "duration": + result[name] = float(part["contents"]) + else: + result[name] = part["contents"].decode('utf-8', errors='replace') + return result \ No newline at end of file diff --git a/appwrite/payload.py b/appwrite/payload.py new file mode 100644 index 0000000..7d1108d --- /dev/null +++ b/appwrite/payload.py @@ -0,0 +1,63 @@ +from typing import Optional, Dict, Any +import os, json + +class Payload: + size: int + filename: Optional[str] = None + + _path: Optional[str] = None + _data: Optional[bytes] = None + + def __init__(self, path: Optional[str] = None, data: Optional[bytes] = None, filename: Optional[str] = None): + if not path and not data: + raise ValueError("One of path or data must be provided") + + self._path = path + self._data = data + + self.filename = filename + if not self._data: + self.size = os.path.getsize(self._path) + else: + self.size = len(self._data) + + def to_binary(self, offset: Optional[int] = 0, length: Optional[int] = None) -> bytes: + if not length: + length = self.size + + if not self._data: + with open(self._path, 'rb') as f: + f.seek(offset) + return f.read(length) + + return self._data[offset:offset + length] + + def to_string(self) -> str: + return str(self.to_binary()) + + def to_json(self) -> Dict[str, Any]: + return json.loads(self.to_string()) + + def to_file(self, path: str) -> None: # in the client SDKs, this is def to_file() -> File: + with open(path, 'wb') as f: + return f.write(self.to_binary()) + + @classmethod + def from_binary(cls, data: bytes, filename: Optional[str] = None) -> 'Payload': + return cls(data=data, filename=filename) + + @classmethod + def from_string(cls, data: str) -> 'Payload': + return cls(data=data.encode()) + + @classmethod + def from_file(cls, path: str, filename: Optional[str] = None) -> 'Payload': + if not os.path.exists(path): + raise FileNotFoundError(f"File {path} not found") + if not filename: + filename = os.path.basename(path) + return cls(path=path, filename=filename) + + @classmethod + def from_json(cls, json: Dict[str, Any]) -> 'Payload': + return cls(data=json.dumps(json)) \ No newline at end of file diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 7e38e08..d782da0 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Account, self).__init__(client) def get(self): - """Get account""" - - + """Get account""" api_path = '/account' api_params = {} @@ -18,9 +16,7 @@ def get(self): }, api_params) def create(self, user_id, email, password, name = None): - """Create account""" - - + """Create account""" api_path = '/account' api_params = {} if user_id is None: @@ -43,9 +39,7 @@ def create(self, user_id, email, password, name = None): }, api_params) def update_email(self, email, password): - """Update email""" - - + """Update email""" api_path = '/account/email' api_params = {} if email is None: @@ -63,9 +57,7 @@ def update_email(self, email, password): }, api_params) def list_identities(self, queries = None): - """List Identities""" - - + """List Identities""" api_path = '/account/identities' api_params = {} @@ -76,9 +68,7 @@ def list_identities(self, queries = None): }, api_params) def delete_identity(self, identity_id): - """Delete identity""" - - + """Delete identity""" api_path = '/account/identities/{identityId}' api_params = {} if identity_id is None: @@ -92,9 +82,7 @@ def delete_identity(self, identity_id): }, api_params) def create_jwt(self): - """Create JWT""" - - + """Create JWT""" api_path = '/account/jwts' api_params = {} @@ -103,9 +91,7 @@ def create_jwt(self): }, api_params) def list_logs(self, queries = None): - """List logs""" - - + """List logs""" api_path = '/account/logs' api_params = {} @@ -116,9 +102,7 @@ def list_logs(self, queries = None): }, api_params) def update_mfa(self, mfa): - """Update MFA""" - - + """Update MFA""" api_path = '/account/mfa' api_params = {} if mfa is None: @@ -132,9 +116,7 @@ def update_mfa(self, mfa): }, api_params) def create_mfa_authenticator(self, type): - """Create Authenticator""" - - + """Create Authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -148,9 +130,7 @@ def create_mfa_authenticator(self, type): }, api_params) def update_mfa_authenticator(self, type, otp): - """Verify Authenticator""" - - + """Verify Authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -168,9 +148,7 @@ def update_mfa_authenticator(self, type, otp): }, api_params) def delete_mfa_authenticator(self, type): - """Delete Authenticator""" - - + """Delete Authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -184,9 +162,7 @@ def delete_mfa_authenticator(self, type): }, api_params) def create_mfa_challenge(self, factor): - """Create MFA Challenge""" - - + """Create MFA Challenge""" api_path = '/account/mfa/challenge' api_params = {} if factor is None: @@ -200,9 +176,7 @@ def create_mfa_challenge(self, factor): }, api_params) def update_mfa_challenge(self, challenge_id, otp): - """Create MFA Challenge (confirmation)""" - - + """Create MFA Challenge (confirmation)""" api_path = '/account/mfa/challenge' api_params = {} if challenge_id is None: @@ -220,9 +194,7 @@ def update_mfa_challenge(self, challenge_id, otp): }, api_params) def list_mfa_factors(self): - """List Factors""" - - + """List Factors""" api_path = '/account/mfa/factors' api_params = {} @@ -231,9 +203,7 @@ def list_mfa_factors(self): }, api_params) def get_mfa_recovery_codes(self): - """Get MFA Recovery Codes""" - - + """Get MFA Recovery Codes""" api_path = '/account/mfa/recovery-codes' api_params = {} @@ -242,9 +212,7 @@ def get_mfa_recovery_codes(self): }, api_params) def create_mfa_recovery_codes(self): - """Create MFA Recovery Codes""" - - + """Create MFA Recovery Codes""" api_path = '/account/mfa/recovery-codes' api_params = {} @@ -253,9 +221,7 @@ def create_mfa_recovery_codes(self): }, api_params) def update_mfa_recovery_codes(self): - """Regenerate MFA Recovery Codes""" - - + """Regenerate MFA Recovery Codes""" api_path = '/account/mfa/recovery-codes' api_params = {} @@ -264,9 +230,7 @@ def update_mfa_recovery_codes(self): }, api_params) def update_name(self, name): - """Update name""" - - + """Update name""" api_path = '/account/name' api_params = {} if name is None: @@ -280,9 +244,7 @@ def update_name(self, name): }, api_params) def update_password(self, password, old_password = None): - """Update password""" - - + """Update password""" api_path = '/account/password' api_params = {} if password is None: @@ -297,9 +259,7 @@ def update_password(self, password, old_password = None): }, api_params) def update_phone(self, phone, password): - """Update phone""" - - + """Update phone""" api_path = '/account/phone' api_params = {} if phone is None: @@ -317,9 +277,7 @@ def update_phone(self, phone, password): }, api_params) def get_prefs(self): - """Get account preferences""" - - + """Get account preferences""" api_path = '/account/prefs' api_params = {} @@ -328,9 +286,7 @@ def get_prefs(self): }, api_params) def update_prefs(self, prefs): - """Update preferences""" - - + """Update preferences""" api_path = '/account/prefs' api_params = {} if prefs is None: @@ -344,9 +300,7 @@ def update_prefs(self, prefs): }, api_params) def create_recovery(self, email, url): - """Create password recovery""" - - + """Create password recovery""" api_path = '/account/recovery' api_params = {} if email is None: @@ -364,9 +318,7 @@ def create_recovery(self, email, url): }, api_params) def update_recovery(self, user_id, secret, password): - """Create password recovery (confirmation)""" - - + """Create password recovery (confirmation)""" api_path = '/account/recovery' api_params = {} if user_id is None: @@ -388,9 +340,7 @@ def update_recovery(self, user_id, secret, password): }, api_params) def list_sessions(self): - """List sessions""" - - + """List sessions""" api_path = '/account/sessions' api_params = {} @@ -399,9 +349,7 @@ def list_sessions(self): }, api_params) def delete_sessions(self): - """Delete sessions""" - - + """Delete sessions""" api_path = '/account/sessions' api_params = {} @@ -410,9 +358,7 @@ def delete_sessions(self): }, api_params) def create_anonymous_session(self): - """Create anonymous session""" - - + """Create anonymous session""" api_path = '/account/sessions/anonymous' api_params = {} @@ -421,9 +367,7 @@ def create_anonymous_session(self): }, api_params) def create_email_password_session(self, email, password): - """Create email password session""" - - + """Create email password session""" api_path = '/account/sessions/email' api_params = {} if email is None: @@ -441,9 +385,7 @@ def create_email_password_session(self, email, password): }, api_params) def update_magic_url_session(self, user_id, secret): - """Update magic URL session""" - - + """Update magic URL session""" api_path = '/account/sessions/magic-url' api_params = {} if user_id is None: @@ -461,9 +403,7 @@ def update_magic_url_session(self, user_id, secret): }, api_params) def update_phone_session(self, user_id, secret): - """Update phone session""" - - + """Update phone session""" api_path = '/account/sessions/phone' api_params = {} if user_id is None: @@ -481,9 +421,7 @@ def update_phone_session(self, user_id, secret): }, api_params) def create_session(self, user_id, secret): - """Create session""" - - + """Create session""" api_path = '/account/sessions/token' api_params = {} if user_id is None: @@ -501,9 +439,7 @@ def create_session(self, user_id, secret): }, api_params) def get_session(self, session_id): - """Get session""" - - + """Get session""" api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -517,9 +453,7 @@ def get_session(self, session_id): }, api_params) def update_session(self, session_id): - """Update session""" - - + """Update session""" api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -533,9 +467,7 @@ def update_session(self, session_id): }, api_params) def delete_session(self, session_id): - """Delete session""" - - + """Delete session""" api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -549,9 +481,7 @@ def delete_session(self, session_id): }, api_params) def update_status(self): - """Update status""" - - + """Update status""" api_path = '/account/status' api_params = {} @@ -560,9 +490,7 @@ def update_status(self): }, api_params) def create_email_token(self, user_id, email, phrase = None): - """Create email token (OTP)""" - - + """Create email token (OTP)""" api_path = '/account/tokens/email' api_params = {} if user_id is None: @@ -581,9 +509,7 @@ def create_email_token(self, user_id, email, phrase = None): }, api_params) def create_magic_url_token(self, user_id, email, url = None, phrase = None): - """Create magic URL token""" - - + """Create magic URL token""" api_path = '/account/tokens/magic-url' api_params = {} if user_id is None: @@ -603,9 +529,7 @@ def create_magic_url_token(self, user_id, email, url = None, phrase = None): }, api_params) def create_o_auth2_token(self, provider, success = None, failure = None, scopes = None): - """Create OAuth2 token""" - - + """Create OAuth2 token""" api_path = '/account/tokens/oauth2/{provider}' api_params = {} if provider is None: @@ -622,9 +546,7 @@ def create_o_auth2_token(self, provider, success = None, failure = None, scopes }, api_params, response_type='location') def create_phone_token(self, user_id, phone): - """Create phone token""" - - + """Create phone token""" api_path = '/account/tokens/phone' api_params = {} if user_id is None: @@ -642,9 +564,7 @@ def create_phone_token(self, user_id, phone): }, api_params) def create_verification(self, url): - """Create email verification""" - - + """Create email verification""" api_path = '/account/verification' api_params = {} if url is None: @@ -658,9 +578,7 @@ def create_verification(self, url): }, api_params) def update_verification(self, user_id, secret): - """Create email verification (confirmation)""" - - + """Create email verification (confirmation)""" api_path = '/account/verification' api_params = {} if user_id is None: @@ -678,9 +596,7 @@ def update_verification(self, user_id, secret): }, api_params) def create_phone_verification(self): - """Create phone verification""" - - + """Create phone verification""" api_path = '/account/verification/phone' api_params = {} @@ -689,9 +605,7 @@ def create_phone_verification(self): }, api_params) def update_phone_verification(self, user_id, secret): - """Update phone verification (confirmation)""" - - + """Update phone verification (confirmation)""" api_path = '/account/verification/phone' api_params = {} if user_id is None: @@ -707,3 +621,4 @@ def update_phone_verification(self, user_id, secret): return self.client.call('put', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 0a9b400..a8e23ce 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Avatars, self).__init__(client) def get_browser(self, code, width = None, height = None, quality = None): - """Get browser icon""" - - + """Get browser icon""" api_path = '/avatars/browsers/{code}' api_params = {} if code is None: @@ -26,9 +24,7 @@ def get_browser(self, code, width = None, height = None, quality = None): }, api_params) def get_credit_card(self, code, width = None, height = None, quality = None): - """Get credit card icon""" - - + """Get credit card icon""" api_path = '/avatars/credit-cards/{code}' api_params = {} if code is None: @@ -45,9 +41,7 @@ def get_credit_card(self, code, width = None, height = None, quality = None): }, api_params) def get_favicon(self, url): - """Get favicon""" - - + """Get favicon""" api_path = '/avatars/favicon' api_params = {} if url is None: @@ -61,9 +55,7 @@ def get_favicon(self, url): }, api_params) def get_flag(self, code, width = None, height = None, quality = None): - """Get country flag""" - - + """Get country flag""" api_path = '/avatars/flags/{code}' api_params = {} if code is None: @@ -80,9 +72,7 @@ def get_flag(self, code, width = None, height = None, quality = None): }, api_params) def get_image(self, url, width = None, height = None): - """Get image from URL""" - - + """Get image from URL""" api_path = '/avatars/image' api_params = {} if url is None: @@ -98,9 +88,7 @@ def get_image(self, url, width = None, height = None): }, api_params) def get_initials(self, name = None, width = None, height = None, background = None): - """Get user initials""" - - + """Get user initials""" api_path = '/avatars/initials' api_params = {} @@ -114,9 +102,7 @@ def get_initials(self, name = None, width = None, height = None, background = No }, api_params) def get_qr(self, text, size = None, margin = None, download = None): - """Get QR code""" - - + """Get QR code""" api_path = '/avatars/qr' api_params = {} if text is None: @@ -131,3 +117,4 @@ def get_qr(self, text, size = None, margin = None, download = None): return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index aa47e4e..c39d7ec 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Databases, self).__init__(client) def list(self, queries = None, search = None): - """List databases""" - - + """List databases""" api_path = '/databases' api_params = {} @@ -21,9 +19,7 @@ def list(self, queries = None, search = None): }, api_params) def create(self, database_id, name, enabled = None): - """Create database""" - - + """Create database""" api_path = '/databases' api_params = {} if database_id is None: @@ -42,9 +38,7 @@ def create(self, database_id, name, enabled = None): }, api_params) def get(self, database_id): - """Get database""" - - + """Get database""" api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -58,9 +52,7 @@ def get(self, database_id): }, api_params) def update(self, database_id, name, enabled = None): - """Update database""" - - + """Update database""" api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -79,9 +71,7 @@ def update(self, database_id, name, enabled = None): }, api_params) def delete(self, database_id): - """Delete database""" - - + """Delete database""" api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -95,9 +85,7 @@ def delete(self, database_id): }, api_params) def list_collections(self, database_id, queries = None, search = None): - """List collections""" - - + """List collections""" api_path = '/databases/{databaseId}/collections' api_params = {} if database_id is None: @@ -113,9 +101,7 @@ def list_collections(self, database_id, queries = None, search = None): }, api_params) def create_collection(self, database_id, collection_id, name, permissions = None, document_security = None, enabled = None): - """Create collection""" - - + """Create collection""" api_path = '/databases/{databaseId}/collections' api_params = {} if database_id is None: @@ -140,9 +126,7 @@ def create_collection(self, database_id, collection_id, name, permissions = None }, api_params) def get_collection(self, database_id, collection_id): - """Get collection""" - - + """Get collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -160,9 +144,7 @@ def get_collection(self, database_id, collection_id): }, api_params) def update_collection(self, database_id, collection_id, name, permissions = None, document_security = None, enabled = None): - """Update collection""" - - + """Update collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -187,9 +169,7 @@ def update_collection(self, database_id, collection_id, name, permissions = None }, api_params) def delete_collection(self, database_id, collection_id): - """Delete collection""" - - + """Delete collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -207,9 +187,7 @@ def delete_collection(self, database_id, collection_id): }, api_params) def list_attributes(self, database_id, collection_id, queries = None): - """List attributes""" - - + """List attributes""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' api_params = {} if database_id is None: @@ -228,9 +206,7 @@ def list_attributes(self, database_id, collection_id, queries = None): }, api_params) def create_boolean_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create boolean attribute""" - - + """Create boolean attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean' api_params = {} if database_id is None: @@ -258,9 +234,7 @@ def create_boolean_attribute(self, database_id, collection_id, key, required, de }, api_params) def update_boolean_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update boolean attribute""" - - + """Update boolean attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}' api_params = {} if database_id is None: @@ -288,9 +262,7 @@ def update_boolean_attribute(self, database_id, collection_id, key, required, de }, api_params) def create_datetime_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create datetime attribute""" - - + """Create datetime attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime' api_params = {} if database_id is None: @@ -318,9 +290,7 @@ def create_datetime_attribute(self, database_id, collection_id, key, required, d }, api_params) def update_datetime_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update dateTime attribute""" - - + """Update dateTime attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}' api_params = {} if database_id is None: @@ -348,9 +318,7 @@ def update_datetime_attribute(self, database_id, collection_id, key, required, d }, api_params) def create_email_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create email attribute""" - - + """Create email attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email' api_params = {} if database_id is None: @@ -378,9 +346,7 @@ def create_email_attribute(self, database_id, collection_id, key, required, defa }, api_params) def update_email_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update email attribute""" - - + """Update email attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}' api_params = {} if database_id is None: @@ -408,9 +374,7 @@ def update_email_attribute(self, database_id, collection_id, key, required, defa }, api_params) def create_enum_attribute(self, database_id, collection_id, key, elements, required, default = None, array = None): - """Create enum attribute""" - - + """Create enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' api_params = {} if database_id is None: @@ -442,9 +406,7 @@ def create_enum_attribute(self, database_id, collection_id, key, elements, requi }, api_params) def update_enum_attribute(self, database_id, collection_id, key, elements, required, default, new_key = None): - """Update enum attribute""" - - + """Update enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}' api_params = {} if database_id is None: @@ -476,9 +438,7 @@ def update_enum_attribute(self, database_id, collection_id, key, elements, requi }, api_params) def create_float_attribute(self, database_id, collection_id, key, required, min = None, max = None, default = None, array = None): - """Create float attribute""" - - + """Create float attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float' api_params = {} if database_id is None: @@ -508,9 +468,7 @@ def create_float_attribute(self, database_id, collection_id, key, required, min }, api_params) def update_float_attribute(self, database_id, collection_id, key, required, min, max, default, new_key = None): - """Update float attribute""" - - + """Update float attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}' api_params = {} if database_id is None: @@ -546,9 +504,7 @@ def update_float_attribute(self, database_id, collection_id, key, required, min, }, api_params) def create_integer_attribute(self, database_id, collection_id, key, required, min = None, max = None, default = None, array = None): - """Create integer attribute""" - - + """Create integer attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer' api_params = {} if database_id is None: @@ -578,9 +534,7 @@ def create_integer_attribute(self, database_id, collection_id, key, required, mi }, api_params) def update_integer_attribute(self, database_id, collection_id, key, required, min, max, default, new_key = None): - """Update integer attribute""" - - + """Update integer attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}' api_params = {} if database_id is None: @@ -616,9 +570,7 @@ def update_integer_attribute(self, database_id, collection_id, key, required, mi }, api_params) def create_ip_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create IP address attribute""" - - + """Create IP address attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip' api_params = {} if database_id is None: @@ -646,9 +598,7 @@ def create_ip_attribute(self, database_id, collection_id, key, required, default }, api_params) def update_ip_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update IP address attribute""" - - + """Update IP address attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}' api_params = {} if database_id is None: @@ -676,9 +626,7 @@ def update_ip_attribute(self, database_id, collection_id, key, required, default }, api_params) def create_relationship_attribute(self, database_id, collection_id, related_collection_id, type, two_way = None, key = None, two_way_key = None, on_delete = None): - """Create relationship attribute""" - - + """Create relationship attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship' api_params = {} if database_id is None: @@ -708,9 +656,7 @@ def create_relationship_attribute(self, database_id, collection_id, related_coll }, api_params) def create_string_attribute(self, database_id, collection_id, key, size, required, default = None, array = None, encrypt = None): - """Create string attribute""" - - + """Create string attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string' api_params = {} if database_id is None: @@ -743,9 +689,7 @@ def create_string_attribute(self, database_id, collection_id, key, size, require }, api_params) def update_string_attribute(self, database_id, collection_id, key, required, default, size = None, new_key = None): - """Update string attribute""" - - + """Update string attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}' api_params = {} if database_id is None: @@ -774,9 +718,7 @@ def update_string_attribute(self, database_id, collection_id, key, required, def }, api_params) def create_url_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create URL attribute""" - - + """Create URL attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url' api_params = {} if database_id is None: @@ -804,9 +746,7 @@ def create_url_attribute(self, database_id, collection_id, key, required, defaul }, api_params) def update_url_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update URL attribute""" - - + """Update URL attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}' api_params = {} if database_id is None: @@ -834,9 +774,7 @@ def update_url_attribute(self, database_id, collection_id, key, required, defaul }, api_params) def get_attribute(self, database_id, collection_id, key): - """Get attribute""" - - + """Get attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} if database_id is None: @@ -858,9 +796,7 @@ def get_attribute(self, database_id, collection_id, key): }, api_params) def delete_attribute(self, database_id, collection_id, key): - """Delete attribute""" - - + """Delete attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} if database_id is None: @@ -882,9 +818,7 @@ def delete_attribute(self, database_id, collection_id, key): }, api_params) def update_relationship_attribute(self, database_id, collection_id, key, on_delete = None, new_key = None): - """Update relationship attribute""" - - + """Update relationship attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship' api_params = {} if database_id is None: @@ -908,9 +842,7 @@ def update_relationship_attribute(self, database_id, collection_id, key, on_dele }, api_params) def list_documents(self, database_id, collection_id, queries = None): - """List documents""" - - + """List documents""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} if database_id is None: @@ -929,9 +861,7 @@ def list_documents(self, database_id, collection_id, queries = None): }, api_params) def create_document(self, database_id, collection_id, document_id, data, permissions = None): - """Create document""" - - + """Create document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} if database_id is None: @@ -958,9 +888,7 @@ def create_document(self, database_id, collection_id, document_id, data, permiss }, api_params) def get_document(self, database_id, collection_id, document_id, queries = None): - """Get document""" - - + """Get document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -983,9 +911,7 @@ def get_document(self, database_id, collection_id, document_id, queries = None): }, api_params) def update_document(self, database_id, collection_id, document_id, data = None, permissions = None): - """Update document""" - - + """Update document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -1009,9 +935,7 @@ def update_document(self, database_id, collection_id, document_id, data = None, }, api_params) def delete_document(self, database_id, collection_id, document_id): - """Delete document""" - - + """Delete document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -1033,9 +957,7 @@ def delete_document(self, database_id, collection_id, document_id): }, api_params) def list_indexes(self, database_id, collection_id, queries = None): - """List indexes""" - - + """List indexes""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} if database_id is None: @@ -1054,9 +976,7 @@ def list_indexes(self, database_id, collection_id, queries = None): }, api_params) def create_index(self, database_id, collection_id, key, type, attributes, orders = None): - """Create index""" - - + """Create index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} if database_id is None: @@ -1087,9 +1007,7 @@ def create_index(self, database_id, collection_id, key, type, attributes, orders }, api_params) def get_index(self, database_id, collection_id, key): - """Get index""" - - + """Get index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} if database_id is None: @@ -1111,9 +1029,7 @@ def get_index(self, database_id, collection_id, key): }, api_params) def delete_index(self, database_id, collection_id, key): - """Delete index""" - - + """Delete index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} if database_id is None: @@ -1133,3 +1049,4 @@ def delete_index(self, database_id, collection_id, key): return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 34b13a9..d59e288 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Functions, self).__init__(client) def list(self, queries = None, search = None): - """List functions""" - - + """List functions""" api_path = '/functions' api_params = {} @@ -21,9 +19,7 @@ def list(self, queries = None, search = None): }, api_params) def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None, specification = None): - """Create function""" - - + """Create function""" api_path = '/functions' api_params = {} if function_id is None: @@ -64,9 +60,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche }, api_params) def list_runtimes(self): - """List runtimes""" - - + """List runtimes""" api_path = '/functions/runtimes' api_params = {} @@ -75,9 +69,7 @@ def list_runtimes(self): }, api_params) def list_specifications(self): - """List available function runtime specifications""" - - + """List available function runtime specifications""" api_path = '/functions/specifications' api_params = {} @@ -86,9 +78,7 @@ def list_specifications(self): }, api_params) def get(self, function_id): - """Get function""" - - + """Get function""" api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -102,9 +92,7 @@ def get(self, function_id): }, api_params) def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, specification = None): - """Update function""" - - + """Update function""" api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -138,9 +126,7 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non }, api_params) def delete(self, function_id): - """Delete function""" - - + """Delete function""" api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -154,9 +140,7 @@ def delete(self, function_id): }, api_params) def list_deployments(self, function_id, queries = None, search = None): - """List deployments""" - - + """List deployments""" api_path = '/functions/{functionId}/deployments' api_params = {} if function_id is None: @@ -172,9 +156,7 @@ def list_deployments(self, function_id, queries = None, search = None): }, api_params) def create_deployment(self, function_id, code, activate, entrypoint = None, commands = None, on_progress = None): - """Create deployment""" - - + """Create deployment""" api_path = '/functions/{functionId}/deployments' api_params = {} if function_id is None: @@ -194,18 +176,15 @@ def create_deployment(self, function_id, code, activate, entrypoint = None, comm api_params['activate'] = str(activate).lower() if type(activate) is bool else activate param_name = 'code' - - upload_id = '' return self.client.chunked_upload(api_path, { 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_deployment(self, function_id, deployment_id): - """Get deployment""" - + def get_deployment(self, function_id, deployment_id): + """Get deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -223,9 +202,7 @@ def get_deployment(self, function_id, deployment_id): }, api_params) def update_deployment(self, function_id, deployment_id): - """Update deployment""" - - + """Update deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -243,9 +220,7 @@ def update_deployment(self, function_id, deployment_id): }, api_params) def delete_deployment(self, function_id, deployment_id): - """Delete deployment""" - - + """Delete deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -263,9 +238,7 @@ def delete_deployment(self, function_id, deployment_id): }, api_params) def create_build(self, function_id, deployment_id, build_id = None): - """Rebuild deployment""" - - + """Rebuild deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} if function_id is None: @@ -284,9 +257,7 @@ def create_build(self, function_id, deployment_id, build_id = None): }, api_params) def update_deployment_build(self, function_id, deployment_id): - """Cancel deployment""" - - + """Cancel deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} if function_id is None: @@ -304,9 +275,7 @@ def update_deployment_build(self, function_id, deployment_id): }, api_params) def get_deployment_download(self, function_id, deployment_id): - """Download deployment""" - - + """Download deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}/download' api_params = {} if function_id is None: @@ -324,9 +293,7 @@ def get_deployment_download(self, function_id, deployment_id): }, api_params) def list_executions(self, function_id, queries = None, search = None): - """List executions""" - - + """List executions""" api_path = '/functions/{functionId}/executions' api_params = {} if function_id is None: @@ -341,10 +308,8 @@ def list_executions(self, function_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None): - """Create execution""" - - + def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None, on_progress = None): + """Create execution""" api_path = '/functions/{functionId}/executions' api_params = {} if function_id is None: @@ -352,21 +317,19 @@ def create_execution(self, function_id, body = None, xasync = None, path = None, api_path = api_path.replace('{functionId}', function_id) - api_params['body'] = body - api_params['async'] = xasync + api_params['body'] = str(body).lower() if type(body) is bool else body + api_params['async'] = str(xasync).lower() if type(xasync) is bool else xasync api_params['path'] = path api_params['method'] = method - api_params['headers'] = headers + api_params['headers'] = str(headers).lower() if type(headers) is bool else headers api_params['scheduledAt'] = scheduled_at return self.client.call('post', api_path, { - 'content-type': 'application/json', + 'content-type': 'multipart/form-data', }, api_params) def get_execution(self, function_id, execution_id): - """Get execution""" - - + """Get execution""" api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} if function_id is None: @@ -384,9 +347,7 @@ def get_execution(self, function_id, execution_id): }, api_params) def delete_execution(self, function_id, execution_id): - """Delete execution""" - - + """Delete execution""" api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} if function_id is None: @@ -404,9 +365,7 @@ def delete_execution(self, function_id, execution_id): }, api_params) def list_variables(self, function_id): - """List variables""" - - + """List variables""" api_path = '/functions/{functionId}/variables' api_params = {} if function_id is None: @@ -420,9 +379,7 @@ def list_variables(self, function_id): }, api_params) def create_variable(self, function_id, key, value): - """Create variable""" - - + """Create variable""" api_path = '/functions/{functionId}/variables' api_params = {} if function_id is None: @@ -444,9 +401,7 @@ def create_variable(self, function_id, key, value): }, api_params) def get_variable(self, function_id, variable_id): - """Get variable""" - - + """Get variable""" api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: @@ -464,9 +419,7 @@ def get_variable(self, function_id, variable_id): }, api_params) def update_variable(self, function_id, variable_id, key, value = None): - """Update variable""" - - + """Update variable""" api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: @@ -489,9 +442,7 @@ def update_variable(self, function_id, variable_id, key, value = None): }, api_params) def delete_variable(self, function_id, variable_id): - """Delete variable""" - - + """Delete variable""" api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: @@ -507,3 +458,4 @@ def delete_variable(self, function_id, variable_id): return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 58a6e99..defa60c 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Graphql, self).__init__(client) def query(self, query): - """GraphQL endpoint""" - - + """GraphQL endpoint""" api_path = '/graphql' api_params = {} if query is None: @@ -24,9 +22,7 @@ def query(self, query): }, api_params) def mutation(self, query): - """GraphQL endpoint""" - - + """GraphQL endpoint""" api_path = '/graphql/mutation' api_params = {} if query is None: @@ -39,3 +35,4 @@ def mutation(self, query): 'x-sdk-graphql': 'true', 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/health.py b/appwrite/services/health.py index ef4b3cd..ea1e6f2 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Health, self).__init__(client) def get(self): - """Get HTTP""" - - + """Get HTTP""" api_path = '/health' api_params = {} @@ -18,9 +16,7 @@ def get(self): }, api_params) def get_antivirus(self): - """Get antivirus""" - - + """Get antivirus""" api_path = '/health/anti-virus' api_params = {} @@ -29,9 +25,7 @@ def get_antivirus(self): }, api_params) def get_cache(self): - """Get cache""" - - + """Get cache""" api_path = '/health/cache' api_params = {} @@ -40,9 +34,7 @@ def get_cache(self): }, api_params) def get_certificate(self, domain = None): - """Get the SSL certificate for a domain""" - - + """Get the SSL certificate for a domain""" api_path = '/health/certificate' api_params = {} @@ -53,9 +45,7 @@ def get_certificate(self, domain = None): }, api_params) def get_db(self): - """Get DB""" - - + """Get DB""" api_path = '/health/db' api_params = {} @@ -64,9 +54,7 @@ def get_db(self): }, api_params) def get_pub_sub(self): - """Get pubsub""" - - + """Get pubsub""" api_path = '/health/pubsub' api_params = {} @@ -75,9 +63,7 @@ def get_pub_sub(self): }, api_params) def get_queue(self): - """Get queue""" - - + """Get queue""" api_path = '/health/queue' api_params = {} @@ -86,9 +72,7 @@ def get_queue(self): }, api_params) def get_queue_builds(self, threshold = None): - """Get builds queue""" - - + """Get builds queue""" api_path = '/health/queue/builds' api_params = {} @@ -99,9 +83,7 @@ def get_queue_builds(self, threshold = None): }, api_params) def get_queue_certificates(self, threshold = None): - """Get certificates queue""" - - + """Get certificates queue""" api_path = '/health/queue/certificates' api_params = {} @@ -112,9 +94,7 @@ def get_queue_certificates(self, threshold = None): }, api_params) def get_queue_databases(self, name = None, threshold = None): - """Get databases queue""" - - + """Get databases queue""" api_path = '/health/queue/databases' api_params = {} @@ -126,9 +106,7 @@ def get_queue_databases(self, name = None, threshold = None): }, api_params) def get_queue_deletes(self, threshold = None): - """Get deletes queue""" - - + """Get deletes queue""" api_path = '/health/queue/deletes' api_params = {} @@ -139,9 +117,7 @@ def get_queue_deletes(self, threshold = None): }, api_params) def get_failed_jobs(self, name, threshold = None): - """Get number of failed queue jobs""" - - + """Get number of failed queue jobs""" api_path = '/health/queue/failed/{name}' api_params = {} if name is None: @@ -156,9 +132,7 @@ def get_failed_jobs(self, name, threshold = None): }, api_params) def get_queue_functions(self, threshold = None): - """Get functions queue""" - - + """Get functions queue""" api_path = '/health/queue/functions' api_params = {} @@ -169,9 +143,7 @@ def get_queue_functions(self, threshold = None): }, api_params) def get_queue_logs(self, threshold = None): - """Get logs queue""" - - + """Get logs queue""" api_path = '/health/queue/logs' api_params = {} @@ -182,9 +154,7 @@ def get_queue_logs(self, threshold = None): }, api_params) def get_queue_mails(self, threshold = None): - """Get mails queue""" - - + """Get mails queue""" api_path = '/health/queue/mails' api_params = {} @@ -195,9 +165,7 @@ def get_queue_mails(self, threshold = None): }, api_params) def get_queue_messaging(self, threshold = None): - """Get messaging queue""" - - + """Get messaging queue""" api_path = '/health/queue/messaging' api_params = {} @@ -208,9 +176,7 @@ def get_queue_messaging(self, threshold = None): }, api_params) def get_queue_migrations(self, threshold = None): - """Get migrations queue""" - - + """Get migrations queue""" api_path = '/health/queue/migrations' api_params = {} @@ -221,9 +187,7 @@ def get_queue_migrations(self, threshold = None): }, api_params) def get_queue_usage(self, threshold = None): - """Get usage queue""" - - + """Get usage queue""" api_path = '/health/queue/usage' api_params = {} @@ -234,9 +198,7 @@ def get_queue_usage(self, threshold = None): }, api_params) def get_queue_usage_dump(self, threshold = None): - """Get usage dump queue""" - - + """Get usage dump queue""" api_path = '/health/queue/usage-dump' api_params = {} @@ -247,9 +209,7 @@ def get_queue_usage_dump(self, threshold = None): }, api_params) def get_queue_webhooks(self, threshold = None): - """Get webhooks queue""" - - + """Get webhooks queue""" api_path = '/health/queue/webhooks' api_params = {} @@ -260,9 +220,7 @@ def get_queue_webhooks(self, threshold = None): }, api_params) def get_storage(self): - """Get storage""" - - + """Get storage""" api_path = '/health/storage' api_params = {} @@ -271,9 +229,7 @@ def get_storage(self): }, api_params) def get_storage_local(self): - """Get local storage""" - - + """Get local storage""" api_path = '/health/storage/local' api_params = {} @@ -282,12 +238,11 @@ def get_storage_local(self): }, api_params) def get_time(self): - """Get time""" - - + """Get time""" api_path = '/health/time' api_params = {} return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index 2ba17ac..bd386f0 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Locale, self).__init__(client) def get(self): - """Get user locale""" - - + """Get user locale""" api_path = '/locale' api_params = {} @@ -18,9 +16,7 @@ def get(self): }, api_params) def list_codes(self): - """List Locale Codes""" - - + """List Locale Codes""" api_path = '/locale/codes' api_params = {} @@ -29,9 +25,7 @@ def list_codes(self): }, api_params) def list_continents(self): - """List continents""" - - + """List continents""" api_path = '/locale/continents' api_params = {} @@ -40,9 +34,7 @@ def list_continents(self): }, api_params) def list_countries(self): - """List countries""" - - + """List countries""" api_path = '/locale/countries' api_params = {} @@ -51,9 +43,7 @@ def list_countries(self): }, api_params) def list_countries_eu(self): - """List EU countries""" - - + """List EU countries""" api_path = '/locale/countries/eu' api_params = {} @@ -62,9 +52,7 @@ def list_countries_eu(self): }, api_params) def list_countries_phones(self): - """List countries phone codes""" - - + """List countries phone codes""" api_path = '/locale/countries/phones' api_params = {} @@ -73,9 +61,7 @@ def list_countries_phones(self): }, api_params) def list_currencies(self): - """List currencies""" - - + """List currencies""" api_path = '/locale/currencies' api_params = {} @@ -84,12 +70,11 @@ def list_currencies(self): }, api_params) def list_languages(self): - """List languages""" - - + """List languages""" api_path = '/locale/languages' api_params = {} return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 11e73be..9a94ad0 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Messaging, self).__init__(client) def list_messages(self, queries = None, search = None): - """List messages""" - - + """List messages""" api_path = '/messaging/messages' api_params = {} @@ -21,9 +19,7 @@ def list_messages(self, queries = None, search = None): }, api_params) def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, attachments = None, draft = None, html = None, scheduled_at = None): - """Create email""" - - + """Create email""" api_path = '/messaging/messages/email' api_params = {} if message_id is None: @@ -54,9 +50,7 @@ def create_email(self, message_id, subject, content, topics = None, users = None }, api_params) def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, draft = None, html = None, cc = None, bcc = None, scheduled_at = None, attachments = None): - """Update email""" - - + """Update email""" api_path = '/messaging/messages/email/{messageId}' api_params = {} if message_id is None: @@ -81,9 +75,7 @@ def update_email(self, message_id, topics = None, users = None, targets = None, }, api_params) def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): - """Create push notification""" - - + """Create push notification""" api_path = '/messaging/messages/push' api_params = {} if message_id is None: @@ -118,9 +110,7 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ }, api_params) def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): - """Update push notification""" - - + """Update push notification""" api_path = '/messaging/messages/push/{messageId}' api_params = {} if message_id is None: @@ -149,9 +139,7 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t }, api_params) def create_sms(self, message_id, content, topics = None, users = None, targets = None, draft = None, scheduled_at = None): - """Create SMS""" - - + """Create SMS""" api_path = '/messaging/messages/sms' api_params = {} if message_id is None: @@ -174,9 +162,7 @@ def create_sms(self, message_id, content, topics = None, users = None, targets = }, api_params) def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, draft = None, scheduled_at = None): - """Update SMS""" - - + """Update SMS""" api_path = '/messaging/messages/sms/{messageId}' api_params = {} if message_id is None: @@ -196,9 +182,7 @@ def update_sms(self, message_id, topics = None, users = None, targets = None, co }, api_params) def get_message(self, message_id): - """Get message""" - - + """Get message""" api_path = '/messaging/messages/{messageId}' api_params = {} if message_id is None: @@ -212,9 +196,7 @@ def get_message(self, message_id): }, api_params) def delete(self, message_id): - """Delete message""" - - + """Delete message""" api_path = '/messaging/messages/{messageId}' api_params = {} if message_id is None: @@ -228,9 +210,7 @@ def delete(self, message_id): }, api_params) def list_message_logs(self, message_id, queries = None): - """List message logs""" - - + """List message logs""" api_path = '/messaging/messages/{messageId}/logs' api_params = {} if message_id is None: @@ -245,9 +225,7 @@ def list_message_logs(self, message_id, queries = None): }, api_params) def list_targets(self, message_id, queries = None): - """List message targets""" - - + """List message targets""" api_path = '/messaging/messages/{messageId}/targets' api_params = {} if message_id is None: @@ -262,9 +240,7 @@ def list_targets(self, message_id, queries = None): }, api_params) def list_providers(self, queries = None, search = None): - """List providers""" - - + """List providers""" api_path = '/messaging/providers' api_params = {} @@ -276,9 +252,7 @@ def list_providers(self, queries = None, search = None): }, api_params) def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, sandbox = None, enabled = None): - """Create APNS provider""" - - + """Create APNS provider""" api_path = '/messaging/providers/apns' api_params = {} if provider_id is None: @@ -302,9 +276,7 @@ def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = }, api_params) def update_apns_provider(self, provider_id, name = None, enabled = None, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, sandbox = None): - """Update APNS provider""" - - + """Update APNS provider""" api_path = '/messaging/providers/apns/{providerId}' api_params = {} if provider_id is None: @@ -325,9 +297,7 @@ def update_apns_provider(self, provider_id, name = None, enabled = None, auth_ke }, api_params) def create_fcm_provider(self, provider_id, name, service_account_json = None, enabled = None): - """Create FCM provider""" - - + """Create FCM provider""" api_path = '/messaging/providers/fcm' api_params = {} if provider_id is None: @@ -347,9 +317,7 @@ def create_fcm_provider(self, provider_id, name, service_account_json = None, en }, api_params) def update_fcm_provider(self, provider_id, name = None, enabled = None, service_account_json = None): - """Update FCM provider""" - - + """Update FCM provider""" api_path = '/messaging/providers/fcm/{providerId}' api_params = {} if provider_id is None: @@ -366,9 +334,7 @@ def update_fcm_provider(self, provider_id, name = None, enabled = None, service_ }, api_params) def create_mailgun_provider(self, provider_id, name, api_key = None, domain = None, is_eu_region = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create Mailgun provider""" - - + """Create Mailgun provider""" api_path = '/messaging/providers/mailgun' api_params = {} if provider_id is None: @@ -394,9 +360,7 @@ def create_mailgun_provider(self, provider_id, name, api_key = None, domain = No }, api_params) def update_mailgun_provider(self, provider_id, name = None, api_key = None, domain = None, is_eu_region = None, enabled = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): - """Update Mailgun provider""" - - + """Update Mailgun provider""" api_path = '/messaging/providers/mailgun/{providerId}' api_params = {} if provider_id is None: @@ -419,9 +383,7 @@ def update_mailgun_provider(self, provider_id, name = None, api_key = None, doma }, api_params) def create_msg91_provider(self, provider_id, name, template_id = None, sender_id = None, auth_key = None, enabled = None): - """Create Msg91 provider""" - - + """Create Msg91 provider""" api_path = '/messaging/providers/msg91' api_params = {} if provider_id is None: @@ -443,9 +405,7 @@ def create_msg91_provider(self, provider_id, name, template_id = None, sender_id }, api_params) def update_msg91_provider(self, provider_id, name = None, enabled = None, template_id = None, sender_id = None, auth_key = None): - """Update Msg91 provider""" - - + """Update Msg91 provider""" api_path = '/messaging/providers/msg91/{providerId}' api_params = {} if provider_id is None: @@ -464,9 +424,7 @@ def update_msg91_provider(self, provider_id, name = None, enabled = None, templa }, api_params) def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create Sendgrid provider""" - - + """Create Sendgrid provider""" api_path = '/messaging/providers/sendgrid' api_params = {} if provider_id is None: @@ -490,9 +448,7 @@ def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name }, api_params) def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): - """Update Sendgrid provider""" - - + """Update Sendgrid provider""" api_path = '/messaging/providers/sendgrid/{providerId}' api_params = {} if provider_id is None: @@ -513,9 +469,7 @@ def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api }, api_params) def create_smtp_provider(self, provider_id, name, host, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create SMTP provider""" - - + """Create SMTP provider""" api_path = '/messaging/providers/smtp' api_params = {} if provider_id is None: @@ -548,9 +502,7 @@ def create_smtp_provider(self, provider_id, name, host, port = None, username = }, api_params) def update_smtp_provider(self, provider_id, name = None, host = None, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Update SMTP provider""" - - + """Update SMTP provider""" api_path = '/messaging/providers/smtp/{providerId}' api_params = {} if provider_id is None: @@ -577,9 +529,7 @@ def update_smtp_provider(self, provider_id, name = None, host = None, port = Non }, api_params) def create_telesign_provider(self, provider_id, name, xfrom = None, customer_id = None, api_key = None, enabled = None): - """Create Telesign provider""" - - + """Create Telesign provider""" api_path = '/messaging/providers/telesign' api_params = {} if provider_id is None: @@ -601,9 +551,7 @@ def create_telesign_provider(self, provider_id, name, xfrom = None, customer_id }, api_params) def update_telesign_provider(self, provider_id, name = None, enabled = None, customer_id = None, api_key = None, xfrom = None): - """Update Telesign provider""" - - + """Update Telesign provider""" api_path = '/messaging/providers/telesign/{providerId}' api_params = {} if provider_id is None: @@ -622,9 +570,7 @@ def update_telesign_provider(self, provider_id, name = None, enabled = None, cus }, api_params) def create_textmagic_provider(self, provider_id, name, xfrom = None, username = None, api_key = None, enabled = None): - """Create Textmagic provider""" - - + """Create Textmagic provider""" api_path = '/messaging/providers/textmagic' api_params = {} if provider_id is None: @@ -646,9 +592,7 @@ def create_textmagic_provider(self, provider_id, name, xfrom = None, username = }, api_params) def update_textmagic_provider(self, provider_id, name = None, enabled = None, username = None, api_key = None, xfrom = None): - """Update Textmagic provider""" - - + """Update Textmagic provider""" api_path = '/messaging/providers/textmagic/{providerId}' api_params = {} if provider_id is None: @@ -667,9 +611,7 @@ def update_textmagic_provider(self, provider_id, name = None, enabled = None, us }, api_params) def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = None, auth_token = None, enabled = None): - """Create Twilio provider""" - - + """Create Twilio provider""" api_path = '/messaging/providers/twilio' api_params = {} if provider_id is None: @@ -691,9 +633,7 @@ def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = }, api_params) def update_twilio_provider(self, provider_id, name = None, enabled = None, account_sid = None, auth_token = None, xfrom = None): - """Update Twilio provider""" - - + """Update Twilio provider""" api_path = '/messaging/providers/twilio/{providerId}' api_params = {} if provider_id is None: @@ -712,9 +652,7 @@ def update_twilio_provider(self, provider_id, name = None, enabled = None, accou }, api_params) def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None, api_secret = None, enabled = None): - """Create Vonage provider""" - - + """Create Vonage provider""" api_path = '/messaging/providers/vonage' api_params = {} if provider_id is None: @@ -736,9 +674,7 @@ def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None }, api_params) def update_vonage_provider(self, provider_id, name = None, enabled = None, api_key = None, api_secret = None, xfrom = None): - """Update Vonage provider""" - - + """Update Vonage provider""" api_path = '/messaging/providers/vonage/{providerId}' api_params = {} if provider_id is None: @@ -757,9 +693,7 @@ def update_vonage_provider(self, provider_id, name = None, enabled = None, api_k }, api_params) def get_provider(self, provider_id): - """Get provider""" - - + """Get provider""" api_path = '/messaging/providers/{providerId}' api_params = {} if provider_id is None: @@ -773,9 +707,7 @@ def get_provider(self, provider_id): }, api_params) def delete_provider(self, provider_id): - """Delete provider""" - - + """Delete provider""" api_path = '/messaging/providers/{providerId}' api_params = {} if provider_id is None: @@ -789,9 +721,7 @@ def delete_provider(self, provider_id): }, api_params) def list_provider_logs(self, provider_id, queries = None): - """List provider logs""" - - + """List provider logs""" api_path = '/messaging/providers/{providerId}/logs' api_params = {} if provider_id is None: @@ -806,9 +736,7 @@ def list_provider_logs(self, provider_id, queries = None): }, api_params) def list_subscriber_logs(self, subscriber_id, queries = None): - """List subscriber logs""" - - + """List subscriber logs""" api_path = '/messaging/subscribers/{subscriberId}/logs' api_params = {} if subscriber_id is None: @@ -823,9 +751,7 @@ def list_subscriber_logs(self, subscriber_id, queries = None): }, api_params) def list_topics(self, queries = None, search = None): - """List topics""" - - + """List topics""" api_path = '/messaging/topics' api_params = {} @@ -837,9 +763,7 @@ def list_topics(self, queries = None, search = None): }, api_params) def create_topic(self, topic_id, name, subscribe = None): - """Create topic""" - - + """Create topic""" api_path = '/messaging/topics' api_params = {} if topic_id is None: @@ -858,9 +782,7 @@ def create_topic(self, topic_id, name, subscribe = None): }, api_params) def get_topic(self, topic_id): - """Get topic""" - - + """Get topic""" api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -874,9 +796,7 @@ def get_topic(self, topic_id): }, api_params) def update_topic(self, topic_id, name = None, subscribe = None): - """Update topic""" - - + """Update topic""" api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -892,9 +812,7 @@ def update_topic(self, topic_id, name = None, subscribe = None): }, api_params) def delete_topic(self, topic_id): - """Delete topic""" - - + """Delete topic""" api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -908,9 +826,7 @@ def delete_topic(self, topic_id): }, api_params) def list_topic_logs(self, topic_id, queries = None): - """List topic logs""" - - + """List topic logs""" api_path = '/messaging/topics/{topicId}/logs' api_params = {} if topic_id is None: @@ -925,9 +841,7 @@ def list_topic_logs(self, topic_id, queries = None): }, api_params) def list_subscribers(self, topic_id, queries = None, search = None): - """List subscribers""" - - + """List subscribers""" api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} if topic_id is None: @@ -943,9 +857,7 @@ def list_subscribers(self, topic_id, queries = None, search = None): }, api_params) def create_subscriber(self, topic_id, subscriber_id, target_id): - """Create subscriber""" - - + """Create subscriber""" api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} if topic_id is None: @@ -967,9 +879,7 @@ def create_subscriber(self, topic_id, subscriber_id, target_id): }, api_params) def get_subscriber(self, topic_id, subscriber_id): - """Get subscriber""" - - + """Get subscriber""" api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} if topic_id is None: @@ -987,9 +897,7 @@ def get_subscriber(self, topic_id, subscriber_id): }, api_params) def delete_subscriber(self, topic_id, subscriber_id): - """Delete subscriber""" - - + """Delete subscriber""" api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} if topic_id is None: @@ -1005,3 +913,4 @@ def delete_subscriber(self, topic_id, subscriber_id): return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index d86e412..8684d0a 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Storage, self).__init__(client) def list_buckets(self, queries = None, search = None): - """List buckets""" - - + """List buckets""" api_path = '/storage/buckets' api_params = {} @@ -21,9 +19,7 @@ def list_buckets(self, queries = None, search = None): }, api_params) def create_bucket(self, bucket_id, name, permissions = None, file_security = None, enabled = None, maximum_file_size = None, allowed_file_extensions = None, compression = None, encryption = None, antivirus = None): - """Create bucket""" - - + """Create bucket""" api_path = '/storage/buckets' api_params = {} if bucket_id is None: @@ -49,9 +45,7 @@ def create_bucket(self, bucket_id, name, permissions = None, file_security = Non }, api_params) def get_bucket(self, bucket_id): - """Get bucket""" - - + """Get bucket""" api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -65,9 +59,7 @@ def get_bucket(self, bucket_id): }, api_params) def update_bucket(self, bucket_id, name, permissions = None, file_security = None, enabled = None, maximum_file_size = None, allowed_file_extensions = None, compression = None, encryption = None, antivirus = None): - """Update bucket""" - - + """Update bucket""" api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -93,9 +85,7 @@ def update_bucket(self, bucket_id, name, permissions = None, file_security = Non }, api_params) def delete_bucket(self, bucket_id): - """Delete bucket""" - - + """Delete bucket""" api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -109,9 +99,7 @@ def delete_bucket(self, bucket_id): }, api_params) def list_files(self, bucket_id, queries = None, search = None): - """List files""" - - + """List files""" api_path = '/storage/buckets/{bucketId}/files' api_params = {} if bucket_id is None: @@ -127,9 +115,7 @@ def list_files(self, bucket_id, queries = None, search = None): }, api_params) def create_file(self, bucket_id, file_id, file, permissions = None, on_progress = None): - """Create file""" - - + """Create file""" api_path = '/storage/buckets/{bucketId}/files' api_params = {} if bucket_id is None: @@ -148,19 +134,15 @@ def create_file(self, bucket_id, file_id, file, permissions = None, on_progress api_params['permissions'] = permissions param_name = 'file' - - upload_id = '' upload_id = file_id - return self.client.chunked_upload(api_path, { 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_file(self, bucket_id, file_id): - """Get file""" - + def get_file(self, bucket_id, file_id): + """Get file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -178,9 +160,7 @@ def get_file(self, bucket_id, file_id): }, api_params) def update_file(self, bucket_id, file_id, name = None, permissions = None): - """Update file""" - - + """Update file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -200,9 +180,7 @@ def update_file(self, bucket_id, file_id, name = None, permissions = None): }, api_params) def delete_file(self, bucket_id, file_id): - """Delete File""" - - + """Delete File""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -220,9 +198,7 @@ def delete_file(self, bucket_id, file_id): }, api_params) def get_file_download(self, bucket_id, file_id): - """Get file for download""" - - + """Get file for download""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/download' api_params = {} if bucket_id is None: @@ -240,9 +216,7 @@ def get_file_download(self, bucket_id, file_id): }, api_params) def get_file_preview(self, bucket_id, file_id, width = None, height = None, gravity = None, quality = None, border_width = None, border_color = None, border_radius = None, opacity = None, rotation = None, background = None, output = None): - """Get file preview""" - - + """Get file preview""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/preview' api_params = {} if bucket_id is None: @@ -271,9 +245,7 @@ def get_file_preview(self, bucket_id, file_id, width = None, height = None, grav }, api_params) def get_file_view(self, bucket_id, file_id): - """Get file for view""" - - + """Get file for view""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/view' api_params = {} if bucket_id is None: @@ -289,3 +261,4 @@ def get_file_view(self, bucket_id, file_id): return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 2c387ed..0dd009d 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Teams, self).__init__(client) def list(self, queries = None, search = None): - """List teams""" - - + """List teams""" api_path = '/teams' api_params = {} @@ -21,9 +19,7 @@ def list(self, queries = None, search = None): }, api_params) def create(self, team_id, name, roles = None): - """Create team""" - - + """Create team""" api_path = '/teams' api_params = {} if team_id is None: @@ -42,9 +38,7 @@ def create(self, team_id, name, roles = None): }, api_params) def get(self, team_id): - """Get team""" - - + """Get team""" api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -58,9 +52,7 @@ def get(self, team_id): }, api_params) def update_name(self, team_id, name): - """Update name""" - - + """Update name""" api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -78,9 +70,7 @@ def update_name(self, team_id, name): }, api_params) def delete(self, team_id): - """Delete team""" - - + """Delete team""" api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -94,9 +84,7 @@ def delete(self, team_id): }, api_params) def list_memberships(self, team_id, queries = None, search = None): - """List team memberships""" - - + """List team memberships""" api_path = '/teams/{teamId}/memberships' api_params = {} if team_id is None: @@ -112,9 +100,7 @@ def list_memberships(self, team_id, queries = None, search = None): }, api_params) def create_membership(self, team_id, roles, email = None, user_id = None, phone = None, url = None, name = None): - """Create team membership""" - - + """Create team membership""" api_path = '/teams/{teamId}/memberships' api_params = {} if team_id is None: @@ -137,9 +123,7 @@ def create_membership(self, team_id, roles, email = None, user_id = None, phone }, api_params) def get_membership(self, team_id, membership_id): - """Get team membership""" - - + """Get team membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -157,9 +141,7 @@ def get_membership(self, team_id, membership_id): }, api_params) def update_membership(self, team_id, membership_id, roles): - """Update membership""" - - + """Update membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -181,9 +163,7 @@ def update_membership(self, team_id, membership_id, roles): }, api_params) def delete_membership(self, team_id, membership_id): - """Delete team membership""" - - + """Delete team membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -201,9 +181,7 @@ def delete_membership(self, team_id, membership_id): }, api_params) def update_membership_status(self, team_id, membership_id, user_id, secret): - """Update team membership status""" - - + """Update team membership status""" api_path = '/teams/{teamId}/memberships/{membershipId}/status' api_params = {} if team_id is None: @@ -229,9 +207,7 @@ def update_membership_status(self, team_id, membership_id, user_id, secret): }, api_params) def get_prefs(self, team_id): - """Get team preferences""" - - + """Get team preferences""" api_path = '/teams/{teamId}/prefs' api_params = {} if team_id is None: @@ -245,9 +221,7 @@ def get_prefs(self, team_id): }, api_params) def update_prefs(self, team_id, prefs): - """Update preferences""" - - + """Update preferences""" api_path = '/teams/{teamId}/prefs' api_params = {} if team_id is None: @@ -263,3 +237,4 @@ def update_prefs(self, team_id, prefs): return self.client.call('put', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 698fbf1..92b266e 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Users, self).__init__(client) def list(self, queries = None, search = None): - """List users""" - - + """List users""" api_path = '/users' api_params = {} @@ -21,9 +19,7 @@ def list(self, queries = None, search = None): }, api_params) def create(self, user_id, email = None, phone = None, password = None, name = None): - """Create user""" - - + """Create user""" api_path = '/users' api_params = {} if user_id is None: @@ -41,9 +37,7 @@ def create(self, user_id, email = None, phone = None, password = None, name = No }, api_params) def create_argon2_user(self, user_id, email, password, name = None): - """Create user with Argon2 password""" - - + """Create user with Argon2 password""" api_path = '/users/argon2' api_params = {} if user_id is None: @@ -66,9 +60,7 @@ def create_argon2_user(self, user_id, email, password, name = None): }, api_params) def create_bcrypt_user(self, user_id, email, password, name = None): - """Create user with bcrypt password""" - - + """Create user with bcrypt password""" api_path = '/users/bcrypt' api_params = {} if user_id is None: @@ -91,9 +83,7 @@ def create_bcrypt_user(self, user_id, email, password, name = None): }, api_params) def list_identities(self, queries = None, search = None): - """List Identities""" - - + """List Identities""" api_path = '/users/identities' api_params = {} @@ -105,9 +95,7 @@ def list_identities(self, queries = None, search = None): }, api_params) def delete_identity(self, identity_id): - """Delete identity""" - - + """Delete identity""" api_path = '/users/identities/{identityId}' api_params = {} if identity_id is None: @@ -121,9 +109,7 @@ def delete_identity(self, identity_id): }, api_params) def create_md5_user(self, user_id, email, password, name = None): - """Create user with MD5 password""" - - + """Create user with MD5 password""" api_path = '/users/md5' api_params = {} if user_id is None: @@ -146,9 +132,7 @@ def create_md5_user(self, user_id, email, password, name = None): }, api_params) def create_ph_pass_user(self, user_id, email, password, name = None): - """Create user with PHPass password""" - - + """Create user with PHPass password""" api_path = '/users/phpass' api_params = {} if user_id is None: @@ -171,9 +155,7 @@ def create_ph_pass_user(self, user_id, email, password, name = None): }, api_params) def create_scrypt_user(self, user_id, email, password, password_salt, password_cpu, password_memory, password_parallel, password_length, name = None): - """Create user with Scrypt password""" - - + """Create user with Scrypt password""" api_path = '/users/scrypt' api_params = {} if user_id is None: @@ -216,9 +198,7 @@ def create_scrypt_user(self, user_id, email, password, password_salt, password_c }, api_params) def create_scrypt_modified_user(self, user_id, email, password, password_salt, password_salt_separator, password_signer_key, name = None): - """Create user with Scrypt modified password""" - - + """Create user with Scrypt modified password""" api_path = '/users/scrypt-modified' api_params = {} if user_id is None: @@ -253,9 +233,7 @@ def create_scrypt_modified_user(self, user_id, email, password, password_salt, p }, api_params) def create_sha_user(self, user_id, email, password, password_version = None, name = None): - """Create user with SHA password""" - - + """Create user with SHA password""" api_path = '/users/sha' api_params = {} if user_id is None: @@ -279,9 +257,7 @@ def create_sha_user(self, user_id, email, password, password_version = None, nam }, api_params) def get(self, user_id): - """Get user""" - - + """Get user""" api_path = '/users/{userId}' api_params = {} if user_id is None: @@ -295,9 +271,7 @@ def get(self, user_id): }, api_params) def delete(self, user_id): - """Delete user""" - - + """Delete user""" api_path = '/users/{userId}' api_params = {} if user_id is None: @@ -311,9 +285,7 @@ def delete(self, user_id): }, api_params) def update_email(self, user_id, email): - """Update email""" - - + """Update email""" api_path = '/users/{userId}/email' api_params = {} if user_id is None: @@ -331,9 +303,7 @@ def update_email(self, user_id, email): }, api_params) def create_jwt(self, user_id, session_id = None, duration = None): - """Create user JWT""" - - + """Create user JWT""" api_path = '/users/{userId}/jwts' api_params = {} if user_id is None: @@ -349,9 +319,7 @@ def create_jwt(self, user_id, session_id = None, duration = None): }, api_params) def update_labels(self, user_id, labels): - """Update user labels""" - - + """Update user labels""" api_path = '/users/{userId}/labels' api_params = {} if user_id is None: @@ -369,9 +337,7 @@ def update_labels(self, user_id, labels): }, api_params) def list_logs(self, user_id, queries = None): - """List user logs""" - - + """List user logs""" api_path = '/users/{userId}/logs' api_params = {} if user_id is None: @@ -386,9 +352,7 @@ def list_logs(self, user_id, queries = None): }, api_params) def list_memberships(self, user_id): - """List user memberships""" - - + """List user memberships""" api_path = '/users/{userId}/memberships' api_params = {} if user_id is None: @@ -402,9 +366,7 @@ def list_memberships(self, user_id): }, api_params) def update_mfa(self, user_id, mfa): - """Update MFA""" - - + """Update MFA""" api_path = '/users/{userId}/mfa' api_params = {} if user_id is None: @@ -422,9 +384,7 @@ def update_mfa(self, user_id, mfa): }, api_params) def delete_mfa_authenticator(self, user_id, type): - """Delete Authenticator""" - - + """Delete Authenticator""" api_path = '/users/{userId}/mfa/authenticators/{type}' api_params = {} if user_id is None: @@ -442,9 +402,7 @@ def delete_mfa_authenticator(self, user_id, type): }, api_params) def list_mfa_factors(self, user_id): - """List Factors""" - - + """List Factors""" api_path = '/users/{userId}/mfa/factors' api_params = {} if user_id is None: @@ -458,9 +416,7 @@ def list_mfa_factors(self, user_id): }, api_params) def get_mfa_recovery_codes(self, user_id): - """Get MFA Recovery Codes""" - - + """Get MFA Recovery Codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -474,9 +430,7 @@ def get_mfa_recovery_codes(self, user_id): }, api_params) def update_mfa_recovery_codes(self, user_id): - """Regenerate MFA Recovery Codes""" - - + """Regenerate MFA Recovery Codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -490,9 +444,7 @@ def update_mfa_recovery_codes(self, user_id): }, api_params) def create_mfa_recovery_codes(self, user_id): - """Create MFA Recovery Codes""" - - + """Create MFA Recovery Codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -506,9 +458,7 @@ def create_mfa_recovery_codes(self, user_id): }, api_params) def update_name(self, user_id, name): - """Update name""" - - + """Update name""" api_path = '/users/{userId}/name' api_params = {} if user_id is None: @@ -526,9 +476,7 @@ def update_name(self, user_id, name): }, api_params) def update_password(self, user_id, password): - """Update password""" - - + """Update password""" api_path = '/users/{userId}/password' api_params = {} if user_id is None: @@ -546,9 +494,7 @@ def update_password(self, user_id, password): }, api_params) def update_phone(self, user_id, number): - """Update phone""" - - + """Update phone""" api_path = '/users/{userId}/phone' api_params = {} if user_id is None: @@ -566,9 +512,7 @@ def update_phone(self, user_id, number): }, api_params) def get_prefs(self, user_id): - """Get user preferences""" - - + """Get user preferences""" api_path = '/users/{userId}/prefs' api_params = {} if user_id is None: @@ -582,9 +526,7 @@ def get_prefs(self, user_id): }, api_params) def update_prefs(self, user_id, prefs): - """Update user preferences""" - - + """Update user preferences""" api_path = '/users/{userId}/prefs' api_params = {} if user_id is None: @@ -602,9 +544,7 @@ def update_prefs(self, user_id, prefs): }, api_params) def list_sessions(self, user_id): - """List user sessions""" - - + """List user sessions""" api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -618,9 +558,7 @@ def list_sessions(self, user_id): }, api_params) def create_session(self, user_id): - """Create session""" - - + """Create session""" api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -634,9 +572,7 @@ def create_session(self, user_id): }, api_params) def delete_sessions(self, user_id): - """Delete user sessions""" - - + """Delete user sessions""" api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -650,9 +586,7 @@ def delete_sessions(self, user_id): }, api_params) def delete_session(self, user_id, session_id): - """Delete user session""" - - + """Delete user session""" api_path = '/users/{userId}/sessions/{sessionId}' api_params = {} if user_id is None: @@ -670,9 +604,7 @@ def delete_session(self, user_id, session_id): }, api_params) def update_status(self, user_id, status): - """Update user status""" - - + """Update user status""" api_path = '/users/{userId}/status' api_params = {} if user_id is None: @@ -690,9 +622,7 @@ def update_status(self, user_id, status): }, api_params) def list_targets(self, user_id, queries = None): - """List User Targets""" - - + """List User Targets""" api_path = '/users/{userId}/targets' api_params = {} if user_id is None: @@ -707,9 +637,7 @@ def list_targets(self, user_id, queries = None): }, api_params) def create_target(self, user_id, target_id, provider_type, identifier, provider_id = None, name = None): - """Create User Target""" - - + """Create User Target""" api_path = '/users/{userId}/targets' api_params = {} if user_id is None: @@ -737,9 +665,7 @@ def create_target(self, user_id, target_id, provider_type, identifier, provider_ }, api_params) def get_target(self, user_id, target_id): - """Get User Target""" - - + """Get User Target""" api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -757,9 +683,7 @@ def get_target(self, user_id, target_id): }, api_params) def update_target(self, user_id, target_id, identifier = None, provider_id = None, name = None): - """Update User target""" - - + """Update User target""" api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -780,9 +704,7 @@ def update_target(self, user_id, target_id, identifier = None, provider_id = Non }, api_params) def delete_target(self, user_id, target_id): - """Delete user target""" - - + """Delete user target""" api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -800,9 +722,7 @@ def delete_target(self, user_id, target_id): }, api_params) def create_token(self, user_id, length = None, expire = None): - """Create token""" - - + """Create token""" api_path = '/users/{userId}/tokens' api_params = {} if user_id is None: @@ -818,9 +738,7 @@ def create_token(self, user_id, length = None, expire = None): }, api_params) def update_email_verification(self, user_id, email_verification): - """Update email verification""" - - + """Update email verification""" api_path = '/users/{userId}/verification' api_params = {} if user_id is None: @@ -838,9 +756,7 @@ def update_email_verification(self, user_id, email_verification): }, api_params) def update_phone_verification(self, user_id, phone_verification): - """Update phone verification""" - - + """Update phone verification""" api_path = '/users/{userId}/verification/phone' api_params = {} if user_id is None: @@ -856,3 +772,4 @@ def update_phone_verification(self, user_id, phone_verification): return self.client.call('patch', api_path, { 'content-type': 'application/json', }, api_params) + diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index da9b559..9e2b711 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.input_file import InputFile +from appwrite.payload import Payload client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint @@ -10,7 +10,7 @@ functions = Functions(client) result = functions.create_deployment( function_id = '<FUNCTION_ID>', - code = InputFile.from_path('file.png'), + code = Payload.from_file('/path/to/file.png'), activate = False, entrypoint = '<ENTRYPOINT>', # optional commands = '<COMMANDS>' # optional diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index e1decb9..aa4a2f5 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -9,7 +9,7 @@ functions = Functions(client) result = functions.create_execution( function_id = '<FUNCTION_ID>', - body = '<BODY>', # optional + body = Payload.from_json({"x": "y"}), # optional async = False, # optional path = '<PATH>', # optional method = ExecutionMethod.GET, # optional diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index d275070..2884c26 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.input_file import InputFile +from appwrite.payload import Payload client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint @@ -11,6 +11,6 @@ storage = Storage(client) result = storage.create_file( bucket_id = '<BUCKET_ID>', file_id = '<FILE_ID>', - file = InputFile.from_path('file.png'), + file = Payload.from_file('/path/to/file.png'), permissions = ["read("any")"] # optional ) diff --git a/setup.py b/setup.py index 8064d17..52160a3 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '6.1.0', + version = '7.0.0-rc1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/6.1.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/7.0.0-rc1.tar.gz', install_requires=[ 'requests', ], From 6c28b14e996635b9ea2d9490b6b54d3acdf9eb8d Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:28:53 +0100 Subject: [PATCH 31/60] fix: multipart testing --- appwrite/client.py | 8 +++--- appwrite/multipart.py | 3 ++- appwrite/payload.py | 47 +++++++++++++++++++++--------------- appwrite/services/account.py | 20 +++++++-------- appwrite/services/locale.py | 2 +- appwrite/services/storage.py | 2 +- appwrite/services/users.py | 20 +++++++-------- setup.py | 4 +-- 8 files changed, 58 insertions(+), 48 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index 17b4fe3..4d5092f 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -12,11 +12,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/7.0.0-rc1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/7.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '7.0.0-rc1', + 'x-sdk-version': '7.0.0', 'X-Appwrite-Response-Format' : '1.6.0', } @@ -96,9 +96,9 @@ def call(self, method, path='', headers=None, params=None, response_type='json') if isinstance(data[key], Payload): if data[key].filename: files[key] = (data[key].filename, data[key].to_binary()) + del data[key] else: - data[key] = data[key].to_binary() - del data[key] + data[key] = data[key].to_string() data = self.flatten(data, stringify=stringify) response = None diff --git a/appwrite/multipart.py b/appwrite/multipart.py index 27ceb63..f2d5360 100644 --- a/appwrite/multipart.py +++ b/appwrite/multipart.py @@ -1,6 +1,7 @@ from email.parser import BytesParser from email.policy import default from .payload import Payload +import json class MultipartParser: def __init__(self, multipart_bytes, content_type): @@ -38,7 +39,7 @@ def to_dict(self): result[name] = Payload.from_binary(part["contents"]) elif name == "responseHeaders": headers_str = part["contents"].decode('utf-8', errors='replace') - result[name] = dict(line.split(": ", 1) for line in headers_str.split("\r\n") if line) + result[name] = json.loads(headers_str) elif name == "responseStatusCode": result[name] = int(part["contents"]) elif name == "duration": diff --git a/appwrite/payload.py b/appwrite/payload.py index 7d1108d..93249b9 100644 --- a/appwrite/payload.py +++ b/appwrite/payload.py @@ -2,43 +2,52 @@ import os, json class Payload: - size: int filename: Optional[str] = None _path: Optional[str] = None _data: Optional[bytes] = None + _size: int = 0 + + @property + def size(self) -> int: + return self._size def __init__(self, path: Optional[str] = None, data: Optional[bytes] = None, filename: Optional[str] = None): - if not path and not data: + if path is None and data is None: raise ValueError("One of path or data must be provided") self._path = path self._data = data self.filename = filename - if not self._data: - self.size = os.path.getsize(self._path) + if self._data is None: + self._size = os.path.getsize(self._path) else: - self.size = len(self._data) - + self._size = len(self._data) + def to_binary(self, offset: Optional[int] = 0, length: Optional[int] = None) -> bytes: - if not length: - length = self.size - - if not self._data: + if length is None: + length = self._size + + if self._data is None: with open(self._path, 'rb') as f: f.seek(offset) return f.read(length) - + return self._data[offset:offset + length] - - def to_string(self) -> str: - return str(self.to_binary()) + + def to_string(self, encoding="utf-8") -> str: + return self.to_binary().decode(encoding) + + def __str__(self) -> str: + return self.to_string() def to_json(self) -> Dict[str, Any]: return json.loads(self.to_string()) - - def to_file(self, path: str) -> None: # in the client SDKs, this is def to_file() -> File: + + def to_file(self, path: str) -> None: + os.makedirs(os.path.dirname(path), exist_ok=True) + with open(path, 'wb') as f: return f.write(self.to_binary()) @@ -49,7 +58,7 @@ def from_binary(cls, data: bytes, filename: Optional[str] = None) -> 'Payload': @classmethod def from_string(cls, data: str) -> 'Payload': return cls(data=data.encode()) - + @classmethod def from_file(cls, path: str, filename: Optional[str] = None) -> 'Payload': if not os.path.exists(path): @@ -59,5 +68,5 @@ def from_file(cls, path: str, filename: Optional[str] = None) -> 'Payload': return cls(path=path, filename=filename) @classmethod - def from_json(cls, json: Dict[str, Any]) -> 'Payload': - return cls(data=json.dumps(json)) \ No newline at end of file + def from_json(cls, data: Dict[str, Any]) -> 'Payload': + return cls.from_string(json.dumps(data)) diff --git a/appwrite/services/account.py b/appwrite/services/account.py index d782da0..6f40c88 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -57,7 +57,7 @@ def update_email(self, email, password): }, api_params) def list_identities(self, queries = None): - """List Identities""" + """List identities""" api_path = '/account/identities' api_params = {} @@ -116,7 +116,7 @@ def update_mfa(self, mfa): }, api_params) def create_mfa_authenticator(self, type): - """Create Authenticator""" + """Create authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -130,7 +130,7 @@ def create_mfa_authenticator(self, type): }, api_params) def update_mfa_authenticator(self, type, otp): - """Verify Authenticator""" + """Verify authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -148,7 +148,7 @@ def update_mfa_authenticator(self, type, otp): }, api_params) def delete_mfa_authenticator(self, type): - """Delete Authenticator""" + """Delete authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -162,7 +162,7 @@ def delete_mfa_authenticator(self, type): }, api_params) def create_mfa_challenge(self, factor): - """Create MFA Challenge""" + """Create MFA challenge""" api_path = '/account/mfa/challenge' api_params = {} if factor is None: @@ -176,7 +176,7 @@ def create_mfa_challenge(self, factor): }, api_params) def update_mfa_challenge(self, challenge_id, otp): - """Create MFA Challenge (confirmation)""" + """Create MFA challenge (confirmation)""" api_path = '/account/mfa/challenge' api_params = {} if challenge_id is None: @@ -194,7 +194,7 @@ def update_mfa_challenge(self, challenge_id, otp): }, api_params) def list_mfa_factors(self): - """List Factors""" + """List factors""" api_path = '/account/mfa/factors' api_params = {} @@ -203,7 +203,7 @@ def list_mfa_factors(self): }, api_params) def get_mfa_recovery_codes(self): - """Get MFA Recovery Codes""" + """Get MFA recovery codes""" api_path = '/account/mfa/recovery-codes' api_params = {} @@ -212,7 +212,7 @@ def get_mfa_recovery_codes(self): }, api_params) def create_mfa_recovery_codes(self): - """Create MFA Recovery Codes""" + """Create MFA recovery codes""" api_path = '/account/mfa/recovery-codes' api_params = {} @@ -221,7 +221,7 @@ def create_mfa_recovery_codes(self): }, api_params) def update_mfa_recovery_codes(self): - """Regenerate MFA Recovery Codes""" + """Regenerate MFA recovery codes""" api_path = '/account/mfa/recovery-codes' api_params = {} diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index bd386f0..9286502 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -16,7 +16,7 @@ def get(self): }, api_params) def list_codes(self): - """List Locale Codes""" + """List locale codes""" api_path = '/locale/codes' api_params = {} diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 8684d0a..f264c80 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -180,7 +180,7 @@ def update_file(self, bucket_id, file_id, name = None, permissions = None): }, api_params) def delete_file(self, bucket_id, file_id): - """Delete File""" + """Delete file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 92b266e..0774580 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -83,7 +83,7 @@ def create_bcrypt_user(self, user_id, email, password, name = None): }, api_params) def list_identities(self, queries = None, search = None): - """List Identities""" + """List identities""" api_path = '/users/identities' api_params = {} @@ -384,7 +384,7 @@ def update_mfa(self, user_id, mfa): }, api_params) def delete_mfa_authenticator(self, user_id, type): - """Delete Authenticator""" + """Delete authenticator""" api_path = '/users/{userId}/mfa/authenticators/{type}' api_params = {} if user_id is None: @@ -402,7 +402,7 @@ def delete_mfa_authenticator(self, user_id, type): }, api_params) def list_mfa_factors(self, user_id): - """List Factors""" + """List factors""" api_path = '/users/{userId}/mfa/factors' api_params = {} if user_id is None: @@ -416,7 +416,7 @@ def list_mfa_factors(self, user_id): }, api_params) def get_mfa_recovery_codes(self, user_id): - """Get MFA Recovery Codes""" + """Get MFA recovery codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -430,7 +430,7 @@ def get_mfa_recovery_codes(self, user_id): }, api_params) def update_mfa_recovery_codes(self, user_id): - """Regenerate MFA Recovery Codes""" + """Regenerate MFA recovery codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -444,7 +444,7 @@ def update_mfa_recovery_codes(self, user_id): }, api_params) def create_mfa_recovery_codes(self, user_id): - """Create MFA Recovery Codes""" + """Create MFA recovery codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -622,7 +622,7 @@ def update_status(self, user_id, status): }, api_params) def list_targets(self, user_id, queries = None): - """List User Targets""" + """List user targets""" api_path = '/users/{userId}/targets' api_params = {} if user_id is None: @@ -637,7 +637,7 @@ def list_targets(self, user_id, queries = None): }, api_params) def create_target(self, user_id, target_id, provider_type, identifier, provider_id = None, name = None): - """Create User Target""" + """Create user target""" api_path = '/users/{userId}/targets' api_params = {} if user_id is None: @@ -665,7 +665,7 @@ def create_target(self, user_id, target_id, provider_type, identifier, provider_ }, api_params) def get_target(self, user_id, target_id): - """Get User Target""" + """Get user target""" api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -683,7 +683,7 @@ def get_target(self, user_id, target_id): }, api_params) def update_target(self, user_id, target_id, identifier = None, provider_id = None, name = None): - """Update User target""" + """Update user target""" api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: diff --git a/setup.py b/setup.py index 52160a3..e0d1c11 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '7.0.0-rc1', + version = '7.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/7.0.0-rc1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/7.0.0.tar.gz', install_requires=[ 'requests', ], From 221040cd6c6632c8b79d1ea3cd4d0117b7b14055 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Tue, 8 Oct 2024 16:22:09 +0100 Subject: [PATCH 32/60] feat: multipart --- appwrite/enums/image_format.py | 1 + 1 file changed, 1 insertion(+) diff --git a/appwrite/enums/image_format.py b/appwrite/enums/image_format.py index 7cdd8f3..d507d17 100644 --- a/appwrite/enums/image_format.py +++ b/appwrite/enums/image_format.py @@ -6,3 +6,4 @@ class ImageFormat(Enum): GIF = "gif" PNG = "png" WEBP = "webp" + AVIF = "avif" From 924d72ac79564397e7661f7c2da4ee0c2cab3de0 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:46:35 +0000 Subject: [PATCH 33/60] fix: revert multipart --- appwrite/client.py | 48 +++-- appwrite/enums/runtime.py | 11 +- appwrite/input_file.py | 21 ++ appwrite/multipart.py | 49 ----- appwrite/payload.py | 72 ------- appwrite/services/account.py | 173 +++++++++++----- appwrite/services/avatars.py | 29 ++- appwrite/services/databases.py | 169 ++++++++++++---- appwrite/services/functions.py | 110 ++++++++--- appwrite/services/graphql.py | 9 +- appwrite/services/health.py | 93 ++++++--- appwrite/services/locale.py | 33 +++- appwrite/services/messaging.py | 185 +++++++++++++----- appwrite/services/storage.py | 57 ++++-- appwrite/services/teams.py | 53 +++-- appwrite/services/users.py | 169 ++++++++++++---- .../databases/update-string-attribute.md | 2 +- docs/examples/functions/create-deployment.md | 4 +- docs/examples/functions/create-execution.md | 2 +- docs/examples/storage/create-file.md | 4 +- 20 files changed, 865 insertions(+), 428 deletions(-) create mode 100644 appwrite/input_file.py delete mode 100644 appwrite/multipart.py delete mode 100644 appwrite/payload.py diff --git a/appwrite/client.py b/appwrite/client.py index 4d5092f..ba0ed1e 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -1,7 +1,8 @@ +import io import json +import os import requests -from .payload import Payload -from .multipart import MultipartParser +from .input_file import InputFile from .exception import AppwriteException from .encoders.value_class_encoder import ValueClassEncoder @@ -90,15 +91,11 @@ def call(self, method, path='', headers=None, params=None, response_type='json') if headers['content-type'].startswith('multipart/form-data'): del headers['content-type'] - headers['accept'] = 'multipart/form-data' stringify = True for key in data.copy(): - if isinstance(data[key], Payload): - if data[key].filename: - files[key] = (data[key].filename, data[key].to_binary()) - del data[key] - else: - data[key] = data[key].to_string() + if isinstance(data[key], InputFile): + files[key] = (data[key].filename, data[key].data) + del data[key] data = self.flatten(data, stringify=stringify) response = None @@ -129,9 +126,6 @@ def call(self, method, path='', headers=None, params=None, response_type='json') if content_type.startswith('application/json'): return response.json() - if content_type.startswith('multipart/form-data'): - return MultipartParser(response.content, content_type).to_dict() - return response._content except Exception as e: if response != None: @@ -152,10 +146,20 @@ def chunked_upload( on_progress = None, upload_id = '' ): - payload = params[param_name] - size = params[param_name].size + input_file = params[param_name] + + if input_file.source_type == 'path': + size = os.stat(input_file.path).st_size + input = open(input_file.path, 'rb') + elif input_file.source_type == 'bytes': + size = len(input_file.data) + input = input_file.data + + if size < self._chunk_size: + if input_file.source_type == 'path': + input_file.data = input.read() - if size < self._chunk_size: + params[param_name] = input_file return self.call( 'post', path, @@ -178,10 +182,16 @@ def chunked_upload( input.seek(offset) while offset < size: - params[param_name] = Payload.from_binary( - payload.to_binary(offset, min(self._chunk_size, size - offset)), - payload.filename - ) + if input_file.source_type == 'path': + input_file.data = input.read(self._chunk_size) or input.read(size - offset) + elif input_file.source_type == 'bytes': + if offset + self._chunk_size < size: + end = offset + self._chunk_size + else: + end = size - offset + input_file.data = input[offset:end] + + params[param_name] = input_file headers["content-range"] = f'bytes {offset}-{min((offset + self._chunk_size) - 1, size - 1)}/{size}' result = self.call( diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index 1e0b47a..db428ef 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -7,6 +7,7 @@ class Runtime(Enum): NODE_19_0 = "node-19.0" NODE_20_0 = "node-20.0" NODE_21_0 = "node-21.0" + NODE_22 = "node-22" PHP_8_0 = "php-8.0" PHP_8_1 = "php-8.1" PHP_8_2 = "php-8.2" @@ -25,6 +26,8 @@ class Runtime(Enum): DENO_1_24 = "deno-1.24" DENO_1_35 = "deno-1.35" DENO_1_40 = "deno-1.40" + DENO_1_46 = "deno-1.46" + DENO_2_0 = "deno-2.0" DART_2_15 = "dart-2.15" DART_2_16 = "dart-2.16" DART_2_17 = "dart-2.17" @@ -32,21 +35,27 @@ class Runtime(Enum): DART_3_0 = "dart-3.0" DART_3_1 = "dart-3.1" DART_3_3 = "dart-3.3" - DOTNET_3_1 = "dotnet-3.1" + DART_3_5 = "dart-3.5" DOTNET_6_0 = "dotnet-6.0" DOTNET_7_0 = "dotnet-7.0" + DOTNET_8_0 = "dotnet-8.0" JAVA_8_0 = "java-8.0" JAVA_11_0 = "java-11.0" JAVA_17_0 = "java-17.0" JAVA_18_0 = "java-18.0" JAVA_21_0 = "java-21.0" + JAVA_22 = "java-22" SWIFT_5_5 = "swift-5.5" SWIFT_5_8 = "swift-5.8" SWIFT_5_9 = "swift-5.9" + SWIFT_5_10 = "swift-5.10" KOTLIN_1_6 = "kotlin-1.6" KOTLIN_1_8 = "kotlin-1.8" KOTLIN_1_9 = "kotlin-1.9" + KOTLIN_2_0 = "kotlin-2.0" CPP_17 = "cpp-17" CPP_20 = "cpp-20" BUN_1_0 = "bun-1.0" + BUN_1_1 = "bun-1.1" GO_1_23 = "go-1.23" + STATIC_1 = "static-1" diff --git a/appwrite/input_file.py b/appwrite/input_file.py new file mode 100644 index 0000000..33d5a77 --- /dev/null +++ b/appwrite/input_file.py @@ -0,0 +1,21 @@ +import os +import mimetypes + +class InputFile: + @classmethod + def from_path(cls, path): + instance = cls() + instance.path = path + instance.filename = os.path.basename(path) + instance.mime_type = mimetypes.guess_type(path) + instance.source_type = 'path' + return instance + + @classmethod + def from_bytes(cls, bytes, filename, mime_type = None): + instance = cls() + instance.data = bytes + instance.filename = filename + instance.mime_type = mime_type + instance.source_type = 'bytes' + return instance \ No newline at end of file diff --git a/appwrite/multipart.py b/appwrite/multipart.py deleted file mode 100644 index f2d5360..0000000 --- a/appwrite/multipart.py +++ /dev/null @@ -1,49 +0,0 @@ -from email.parser import BytesParser -from email.policy import default -from .payload import Payload -import json - -class MultipartParser: - def __init__(self, multipart_bytes, content_type): - self.multipart_bytes = multipart_bytes - self.content_type = content_type - self.parts = {} - self.parse() - - def parse(self): - # Create a message object - headers = f'Content-Type: {self.content_type}\r\n\r\n'.encode('ascii') - msg = BytesParser(policy=default).parsebytes(headers + self.multipart_bytes) - - # Process each part - for part in msg.walk(): - if part.is_multipart(): - continue - - # Get the name from Content-Disposition - content_disposition = part.get("Content-Disposition", "") - name = part.get_param("name", header="content-disposition") - if not name: - name = f"unnamed_part_{len(self.parts)}" - - # Store the parsed data - self.parts[name] = { - "contents": part.get_payload(decode=True), - "headers": dict(part.items()) - } - - def to_dict(self): - result = {} - for name, part in self.parts.items(): - if name == "responseBody": - result[name] = Payload.from_binary(part["contents"]) - elif name == "responseHeaders": - headers_str = part["contents"].decode('utf-8', errors='replace') - result[name] = json.loads(headers_str) - elif name == "responseStatusCode": - result[name] = int(part["contents"]) - elif name == "duration": - result[name] = float(part["contents"]) - else: - result[name] = part["contents"].decode('utf-8', errors='replace') - return result \ No newline at end of file diff --git a/appwrite/payload.py b/appwrite/payload.py deleted file mode 100644 index 93249b9..0000000 --- a/appwrite/payload.py +++ /dev/null @@ -1,72 +0,0 @@ -from typing import Optional, Dict, Any -import os, json - -class Payload: - filename: Optional[str] = None - - _path: Optional[str] = None - _data: Optional[bytes] = None - _size: int = 0 - - @property - def size(self) -> int: - return self._size - - def __init__(self, path: Optional[str] = None, data: Optional[bytes] = None, filename: Optional[str] = None): - if path is None and data is None: - raise ValueError("One of path or data must be provided") - - self._path = path - self._data = data - - self.filename = filename - if self._data is None: - self._size = os.path.getsize(self._path) - else: - self._size = len(self._data) - - def to_binary(self, offset: Optional[int] = 0, length: Optional[int] = None) -> bytes: - if length is None: - length = self._size - - if self._data is None: - with open(self._path, 'rb') as f: - f.seek(offset) - return f.read(length) - - return self._data[offset:offset + length] - - def to_string(self, encoding="utf-8") -> str: - return self.to_binary().decode(encoding) - - def __str__(self) -> str: - return self.to_string() - - def to_json(self) -> Dict[str, Any]: - return json.loads(self.to_string()) - - def to_file(self, path: str) -> None: - os.makedirs(os.path.dirname(path), exist_ok=True) - - with open(path, 'wb') as f: - return f.write(self.to_binary()) - - @classmethod - def from_binary(cls, data: bytes, filename: Optional[str] = None) -> 'Payload': - return cls(data=data, filename=filename) - - @classmethod - def from_string(cls, data: str) -> 'Payload': - return cls(data=data.encode()) - - @classmethod - def from_file(cls, path: str, filename: Optional[str] = None) -> 'Payload': - if not os.path.exists(path): - raise FileNotFoundError(f"File {path} not found") - if not filename: - filename = os.path.basename(path) - return cls(path=path, filename=filename) - - @classmethod - def from_json(cls, data: Dict[str, Any]) -> 'Payload': - return cls.from_string(json.dumps(data)) diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 6f40c88..10255b2 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Account, self).__init__(client) def get(self): - """Get account""" + """Get account""" + + api_path = '/account' api_params = {} @@ -16,7 +18,9 @@ def get(self): }, api_params) def create(self, user_id, email, password, name = None): - """Create account""" + """Create account""" + + api_path = '/account' api_params = {} if user_id is None: @@ -39,7 +43,9 @@ def create(self, user_id, email, password, name = None): }, api_params) def update_email(self, email, password): - """Update email""" + """Update email""" + + api_path = '/account/email' api_params = {} if email is None: @@ -57,7 +63,9 @@ def update_email(self, email, password): }, api_params) def list_identities(self, queries = None): - """List identities""" + """List identities""" + + api_path = '/account/identities' api_params = {} @@ -68,7 +76,9 @@ def list_identities(self, queries = None): }, api_params) def delete_identity(self, identity_id): - """Delete identity""" + """Delete identity""" + + api_path = '/account/identities/{identityId}' api_params = {} if identity_id is None: @@ -82,7 +92,9 @@ def delete_identity(self, identity_id): }, api_params) def create_jwt(self): - """Create JWT""" + """Create JWT""" + + api_path = '/account/jwts' api_params = {} @@ -91,7 +103,9 @@ def create_jwt(self): }, api_params) def list_logs(self, queries = None): - """List logs""" + """List logs""" + + api_path = '/account/logs' api_params = {} @@ -102,7 +116,9 @@ def list_logs(self, queries = None): }, api_params) def update_mfa(self, mfa): - """Update MFA""" + """Update MFA""" + + api_path = '/account/mfa' api_params = {} if mfa is None: @@ -116,7 +132,9 @@ def update_mfa(self, mfa): }, api_params) def create_mfa_authenticator(self, type): - """Create authenticator""" + """Create authenticator""" + + api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -130,7 +148,9 @@ def create_mfa_authenticator(self, type): }, api_params) def update_mfa_authenticator(self, type, otp): - """Verify authenticator""" + """Verify authenticator""" + + api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -148,7 +168,9 @@ def update_mfa_authenticator(self, type, otp): }, api_params) def delete_mfa_authenticator(self, type): - """Delete authenticator""" + """Delete authenticator""" + + api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -162,7 +184,9 @@ def delete_mfa_authenticator(self, type): }, api_params) def create_mfa_challenge(self, factor): - """Create MFA challenge""" + """Create MFA challenge""" + + api_path = '/account/mfa/challenge' api_params = {} if factor is None: @@ -176,7 +200,9 @@ def create_mfa_challenge(self, factor): }, api_params) def update_mfa_challenge(self, challenge_id, otp): - """Create MFA challenge (confirmation)""" + """Create MFA challenge (confirmation)""" + + api_path = '/account/mfa/challenge' api_params = {} if challenge_id is None: @@ -194,7 +220,9 @@ def update_mfa_challenge(self, challenge_id, otp): }, api_params) def list_mfa_factors(self): - """List factors""" + """List factors""" + + api_path = '/account/mfa/factors' api_params = {} @@ -203,7 +231,9 @@ def list_mfa_factors(self): }, api_params) def get_mfa_recovery_codes(self): - """Get MFA recovery codes""" + """Get MFA recovery codes""" + + api_path = '/account/mfa/recovery-codes' api_params = {} @@ -212,7 +242,9 @@ def get_mfa_recovery_codes(self): }, api_params) def create_mfa_recovery_codes(self): - """Create MFA recovery codes""" + """Create MFA recovery codes""" + + api_path = '/account/mfa/recovery-codes' api_params = {} @@ -221,7 +253,9 @@ def create_mfa_recovery_codes(self): }, api_params) def update_mfa_recovery_codes(self): - """Regenerate MFA recovery codes""" + """Regenerate MFA recovery codes""" + + api_path = '/account/mfa/recovery-codes' api_params = {} @@ -230,7 +264,9 @@ def update_mfa_recovery_codes(self): }, api_params) def update_name(self, name): - """Update name""" + """Update name""" + + api_path = '/account/name' api_params = {} if name is None: @@ -244,7 +280,9 @@ def update_name(self, name): }, api_params) def update_password(self, password, old_password = None): - """Update password""" + """Update password""" + + api_path = '/account/password' api_params = {} if password is None: @@ -259,7 +297,9 @@ def update_password(self, password, old_password = None): }, api_params) def update_phone(self, phone, password): - """Update phone""" + """Update phone""" + + api_path = '/account/phone' api_params = {} if phone is None: @@ -277,7 +317,9 @@ def update_phone(self, phone, password): }, api_params) def get_prefs(self): - """Get account preferences""" + """Get account preferences""" + + api_path = '/account/prefs' api_params = {} @@ -286,7 +328,9 @@ def get_prefs(self): }, api_params) def update_prefs(self, prefs): - """Update preferences""" + """Update preferences""" + + api_path = '/account/prefs' api_params = {} if prefs is None: @@ -300,7 +344,9 @@ def update_prefs(self, prefs): }, api_params) def create_recovery(self, email, url): - """Create password recovery""" + """Create password recovery""" + + api_path = '/account/recovery' api_params = {} if email is None: @@ -318,7 +364,9 @@ def create_recovery(self, email, url): }, api_params) def update_recovery(self, user_id, secret, password): - """Create password recovery (confirmation)""" + """Create password recovery (confirmation)""" + + api_path = '/account/recovery' api_params = {} if user_id is None: @@ -340,7 +388,9 @@ def update_recovery(self, user_id, secret, password): }, api_params) def list_sessions(self): - """List sessions""" + """List sessions""" + + api_path = '/account/sessions' api_params = {} @@ -349,7 +399,9 @@ def list_sessions(self): }, api_params) def delete_sessions(self): - """Delete sessions""" + """Delete sessions""" + + api_path = '/account/sessions' api_params = {} @@ -358,7 +410,9 @@ def delete_sessions(self): }, api_params) def create_anonymous_session(self): - """Create anonymous session""" + """Create anonymous session""" + + api_path = '/account/sessions/anonymous' api_params = {} @@ -367,7 +421,9 @@ def create_anonymous_session(self): }, api_params) def create_email_password_session(self, email, password): - """Create email password session""" + """Create email password session""" + + api_path = '/account/sessions/email' api_params = {} if email is None: @@ -385,7 +441,9 @@ def create_email_password_session(self, email, password): }, api_params) def update_magic_url_session(self, user_id, secret): - """Update magic URL session""" + """Update magic URL session""" + + api_path = '/account/sessions/magic-url' api_params = {} if user_id is None: @@ -403,7 +461,9 @@ def update_magic_url_session(self, user_id, secret): }, api_params) def update_phone_session(self, user_id, secret): - """Update phone session""" + """Update phone session""" + + api_path = '/account/sessions/phone' api_params = {} if user_id is None: @@ -421,7 +481,9 @@ def update_phone_session(self, user_id, secret): }, api_params) def create_session(self, user_id, secret): - """Create session""" + """Create session""" + + api_path = '/account/sessions/token' api_params = {} if user_id is None: @@ -439,7 +501,9 @@ def create_session(self, user_id, secret): }, api_params) def get_session(self, session_id): - """Get session""" + """Get session""" + + api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -453,7 +517,9 @@ def get_session(self, session_id): }, api_params) def update_session(self, session_id): - """Update session""" + """Update session""" + + api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -467,7 +533,9 @@ def update_session(self, session_id): }, api_params) def delete_session(self, session_id): - """Delete session""" + """Delete session""" + + api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -481,7 +549,9 @@ def delete_session(self, session_id): }, api_params) def update_status(self): - """Update status""" + """Update status""" + + api_path = '/account/status' api_params = {} @@ -490,7 +560,9 @@ def update_status(self): }, api_params) def create_email_token(self, user_id, email, phrase = None): - """Create email token (OTP)""" + """Create email token (OTP)""" + + api_path = '/account/tokens/email' api_params = {} if user_id is None: @@ -509,7 +581,9 @@ def create_email_token(self, user_id, email, phrase = None): }, api_params) def create_magic_url_token(self, user_id, email, url = None, phrase = None): - """Create magic URL token""" + """Create magic URL token""" + + api_path = '/account/tokens/magic-url' api_params = {} if user_id is None: @@ -529,7 +603,9 @@ def create_magic_url_token(self, user_id, email, url = None, phrase = None): }, api_params) def create_o_auth2_token(self, provider, success = None, failure = None, scopes = None): - """Create OAuth2 token""" + """Create OAuth2 token""" + + api_path = '/account/tokens/oauth2/{provider}' api_params = {} if provider is None: @@ -546,7 +622,9 @@ def create_o_auth2_token(self, provider, success = None, failure = None, scopes }, api_params, response_type='location') def create_phone_token(self, user_id, phone): - """Create phone token""" + """Create phone token""" + + api_path = '/account/tokens/phone' api_params = {} if user_id is None: @@ -564,7 +642,9 @@ def create_phone_token(self, user_id, phone): }, api_params) def create_verification(self, url): - """Create email verification""" + """Create email verification""" + + api_path = '/account/verification' api_params = {} if url is None: @@ -578,7 +658,9 @@ def create_verification(self, url): }, api_params) def update_verification(self, user_id, secret): - """Create email verification (confirmation)""" + """Create email verification (confirmation)""" + + api_path = '/account/verification' api_params = {} if user_id is None: @@ -596,7 +678,9 @@ def update_verification(self, user_id, secret): }, api_params) def create_phone_verification(self): - """Create phone verification""" + """Create phone verification""" + + api_path = '/account/verification/phone' api_params = {} @@ -605,7 +689,9 @@ def create_phone_verification(self): }, api_params) def update_phone_verification(self, user_id, secret): - """Update phone verification (confirmation)""" + """Update phone verification (confirmation)""" + + api_path = '/account/verification/phone' api_params = {} if user_id is None: @@ -621,4 +707,3 @@ def update_phone_verification(self, user_id, secret): return self.client.call('put', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index a8e23ce..0a9b400 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Avatars, self).__init__(client) def get_browser(self, code, width = None, height = None, quality = None): - """Get browser icon""" + """Get browser icon""" + + api_path = '/avatars/browsers/{code}' api_params = {} if code is None: @@ -24,7 +26,9 @@ def get_browser(self, code, width = None, height = None, quality = None): }, api_params) def get_credit_card(self, code, width = None, height = None, quality = None): - """Get credit card icon""" + """Get credit card icon""" + + api_path = '/avatars/credit-cards/{code}' api_params = {} if code is None: @@ -41,7 +45,9 @@ def get_credit_card(self, code, width = None, height = None, quality = None): }, api_params) def get_favicon(self, url): - """Get favicon""" + """Get favicon""" + + api_path = '/avatars/favicon' api_params = {} if url is None: @@ -55,7 +61,9 @@ def get_favicon(self, url): }, api_params) def get_flag(self, code, width = None, height = None, quality = None): - """Get country flag""" + """Get country flag""" + + api_path = '/avatars/flags/{code}' api_params = {} if code is None: @@ -72,7 +80,9 @@ def get_flag(self, code, width = None, height = None, quality = None): }, api_params) def get_image(self, url, width = None, height = None): - """Get image from URL""" + """Get image from URL""" + + api_path = '/avatars/image' api_params = {} if url is None: @@ -88,7 +98,9 @@ def get_image(self, url, width = None, height = None): }, api_params) def get_initials(self, name = None, width = None, height = None, background = None): - """Get user initials""" + """Get user initials""" + + api_path = '/avatars/initials' api_params = {} @@ -102,7 +114,9 @@ def get_initials(self, name = None, width = None, height = None, background = No }, api_params) def get_qr(self, text, size = None, margin = None, download = None): - """Get QR code""" + """Get QR code""" + + api_path = '/avatars/qr' api_params = {} if text is None: @@ -117,4 +131,3 @@ def get_qr(self, text, size = None, margin = None, download = None): return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index c39d7ec..aa47e4e 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Databases, self).__init__(client) def list(self, queries = None, search = None): - """List databases""" + """List databases""" + + api_path = '/databases' api_params = {} @@ -19,7 +21,9 @@ def list(self, queries = None, search = None): }, api_params) def create(self, database_id, name, enabled = None): - """Create database""" + """Create database""" + + api_path = '/databases' api_params = {} if database_id is None: @@ -38,7 +42,9 @@ def create(self, database_id, name, enabled = None): }, api_params) def get(self, database_id): - """Get database""" + """Get database""" + + api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -52,7 +58,9 @@ def get(self, database_id): }, api_params) def update(self, database_id, name, enabled = None): - """Update database""" + """Update database""" + + api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -71,7 +79,9 @@ def update(self, database_id, name, enabled = None): }, api_params) def delete(self, database_id): - """Delete database""" + """Delete database""" + + api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -85,7 +95,9 @@ def delete(self, database_id): }, api_params) def list_collections(self, database_id, queries = None, search = None): - """List collections""" + """List collections""" + + api_path = '/databases/{databaseId}/collections' api_params = {} if database_id is None: @@ -101,7 +113,9 @@ def list_collections(self, database_id, queries = None, search = None): }, api_params) def create_collection(self, database_id, collection_id, name, permissions = None, document_security = None, enabled = None): - """Create collection""" + """Create collection""" + + api_path = '/databases/{databaseId}/collections' api_params = {} if database_id is None: @@ -126,7 +140,9 @@ def create_collection(self, database_id, collection_id, name, permissions = None }, api_params) def get_collection(self, database_id, collection_id): - """Get collection""" + """Get collection""" + + api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -144,7 +160,9 @@ def get_collection(self, database_id, collection_id): }, api_params) def update_collection(self, database_id, collection_id, name, permissions = None, document_security = None, enabled = None): - """Update collection""" + """Update collection""" + + api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -169,7 +187,9 @@ def update_collection(self, database_id, collection_id, name, permissions = None }, api_params) def delete_collection(self, database_id, collection_id): - """Delete collection""" + """Delete collection""" + + api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -187,7 +207,9 @@ def delete_collection(self, database_id, collection_id): }, api_params) def list_attributes(self, database_id, collection_id, queries = None): - """List attributes""" + """List attributes""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' api_params = {} if database_id is None: @@ -206,7 +228,9 @@ def list_attributes(self, database_id, collection_id, queries = None): }, api_params) def create_boolean_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create boolean attribute""" + """Create boolean attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean' api_params = {} if database_id is None: @@ -234,7 +258,9 @@ def create_boolean_attribute(self, database_id, collection_id, key, required, de }, api_params) def update_boolean_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update boolean attribute""" + """Update boolean attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}' api_params = {} if database_id is None: @@ -262,7 +288,9 @@ def update_boolean_attribute(self, database_id, collection_id, key, required, de }, api_params) def create_datetime_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create datetime attribute""" + """Create datetime attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime' api_params = {} if database_id is None: @@ -290,7 +318,9 @@ def create_datetime_attribute(self, database_id, collection_id, key, required, d }, api_params) def update_datetime_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update dateTime attribute""" + """Update dateTime attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}' api_params = {} if database_id is None: @@ -318,7 +348,9 @@ def update_datetime_attribute(self, database_id, collection_id, key, required, d }, api_params) def create_email_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create email attribute""" + """Create email attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email' api_params = {} if database_id is None: @@ -346,7 +378,9 @@ def create_email_attribute(self, database_id, collection_id, key, required, defa }, api_params) def update_email_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update email attribute""" + """Update email attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}' api_params = {} if database_id is None: @@ -374,7 +408,9 @@ def update_email_attribute(self, database_id, collection_id, key, required, defa }, api_params) def create_enum_attribute(self, database_id, collection_id, key, elements, required, default = None, array = None): - """Create enum attribute""" + """Create enum attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' api_params = {} if database_id is None: @@ -406,7 +442,9 @@ def create_enum_attribute(self, database_id, collection_id, key, elements, requi }, api_params) def update_enum_attribute(self, database_id, collection_id, key, elements, required, default, new_key = None): - """Update enum attribute""" + """Update enum attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}' api_params = {} if database_id is None: @@ -438,7 +476,9 @@ def update_enum_attribute(self, database_id, collection_id, key, elements, requi }, api_params) def create_float_attribute(self, database_id, collection_id, key, required, min = None, max = None, default = None, array = None): - """Create float attribute""" + """Create float attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float' api_params = {} if database_id is None: @@ -468,7 +508,9 @@ def create_float_attribute(self, database_id, collection_id, key, required, min }, api_params) def update_float_attribute(self, database_id, collection_id, key, required, min, max, default, new_key = None): - """Update float attribute""" + """Update float attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}' api_params = {} if database_id is None: @@ -504,7 +546,9 @@ def update_float_attribute(self, database_id, collection_id, key, required, min, }, api_params) def create_integer_attribute(self, database_id, collection_id, key, required, min = None, max = None, default = None, array = None): - """Create integer attribute""" + """Create integer attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer' api_params = {} if database_id is None: @@ -534,7 +578,9 @@ def create_integer_attribute(self, database_id, collection_id, key, required, mi }, api_params) def update_integer_attribute(self, database_id, collection_id, key, required, min, max, default, new_key = None): - """Update integer attribute""" + """Update integer attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}' api_params = {} if database_id is None: @@ -570,7 +616,9 @@ def update_integer_attribute(self, database_id, collection_id, key, required, mi }, api_params) def create_ip_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create IP address attribute""" + """Create IP address attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip' api_params = {} if database_id is None: @@ -598,7 +646,9 @@ def create_ip_attribute(self, database_id, collection_id, key, required, default }, api_params) def update_ip_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update IP address attribute""" + """Update IP address attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}' api_params = {} if database_id is None: @@ -626,7 +676,9 @@ def update_ip_attribute(self, database_id, collection_id, key, required, default }, api_params) def create_relationship_attribute(self, database_id, collection_id, related_collection_id, type, two_way = None, key = None, two_way_key = None, on_delete = None): - """Create relationship attribute""" + """Create relationship attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship' api_params = {} if database_id is None: @@ -656,7 +708,9 @@ def create_relationship_attribute(self, database_id, collection_id, related_coll }, api_params) def create_string_attribute(self, database_id, collection_id, key, size, required, default = None, array = None, encrypt = None): - """Create string attribute""" + """Create string attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string' api_params = {} if database_id is None: @@ -689,7 +743,9 @@ def create_string_attribute(self, database_id, collection_id, key, size, require }, api_params) def update_string_attribute(self, database_id, collection_id, key, required, default, size = None, new_key = None): - """Update string attribute""" + """Update string attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}' api_params = {} if database_id is None: @@ -718,7 +774,9 @@ def update_string_attribute(self, database_id, collection_id, key, required, def }, api_params) def create_url_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create URL attribute""" + """Create URL attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url' api_params = {} if database_id is None: @@ -746,7 +804,9 @@ def create_url_attribute(self, database_id, collection_id, key, required, defaul }, api_params) def update_url_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update URL attribute""" + """Update URL attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}' api_params = {} if database_id is None: @@ -774,7 +834,9 @@ def update_url_attribute(self, database_id, collection_id, key, required, defaul }, api_params) def get_attribute(self, database_id, collection_id, key): - """Get attribute""" + """Get attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} if database_id is None: @@ -796,7 +858,9 @@ def get_attribute(self, database_id, collection_id, key): }, api_params) def delete_attribute(self, database_id, collection_id, key): - """Delete attribute""" + """Delete attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} if database_id is None: @@ -818,7 +882,9 @@ def delete_attribute(self, database_id, collection_id, key): }, api_params) def update_relationship_attribute(self, database_id, collection_id, key, on_delete = None, new_key = None): - """Update relationship attribute""" + """Update relationship attribute""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship' api_params = {} if database_id is None: @@ -842,7 +908,9 @@ def update_relationship_attribute(self, database_id, collection_id, key, on_dele }, api_params) def list_documents(self, database_id, collection_id, queries = None): - """List documents""" + """List documents""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} if database_id is None: @@ -861,7 +929,9 @@ def list_documents(self, database_id, collection_id, queries = None): }, api_params) def create_document(self, database_id, collection_id, document_id, data, permissions = None): - """Create document""" + """Create document""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} if database_id is None: @@ -888,7 +958,9 @@ def create_document(self, database_id, collection_id, document_id, data, permiss }, api_params) def get_document(self, database_id, collection_id, document_id, queries = None): - """Get document""" + """Get document""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -911,7 +983,9 @@ def get_document(self, database_id, collection_id, document_id, queries = None): }, api_params) def update_document(self, database_id, collection_id, document_id, data = None, permissions = None): - """Update document""" + """Update document""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -935,7 +1009,9 @@ def update_document(self, database_id, collection_id, document_id, data = None, }, api_params) def delete_document(self, database_id, collection_id, document_id): - """Delete document""" + """Delete document""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -957,7 +1033,9 @@ def delete_document(self, database_id, collection_id, document_id): }, api_params) def list_indexes(self, database_id, collection_id, queries = None): - """List indexes""" + """List indexes""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} if database_id is None: @@ -976,7 +1054,9 @@ def list_indexes(self, database_id, collection_id, queries = None): }, api_params) def create_index(self, database_id, collection_id, key, type, attributes, orders = None): - """Create index""" + """Create index""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} if database_id is None: @@ -1007,7 +1087,9 @@ def create_index(self, database_id, collection_id, key, type, attributes, orders }, api_params) def get_index(self, database_id, collection_id, key): - """Get index""" + """Get index""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} if database_id is None: @@ -1029,7 +1111,9 @@ def get_index(self, database_id, collection_id, key): }, api_params) def delete_index(self, database_id, collection_id, key): - """Delete index""" + """Delete index""" + + api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} if database_id is None: @@ -1049,4 +1133,3 @@ def delete_index(self, database_id, collection_id, key): return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index d59e288..34b13a9 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Functions, self).__init__(client) def list(self, queries = None, search = None): - """List functions""" + """List functions""" + + api_path = '/functions' api_params = {} @@ -19,7 +21,9 @@ def list(self, queries = None, search = None): }, api_params) def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None, specification = None): - """Create function""" + """Create function""" + + api_path = '/functions' api_params = {} if function_id is None: @@ -60,7 +64,9 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche }, api_params) def list_runtimes(self): - """List runtimes""" + """List runtimes""" + + api_path = '/functions/runtimes' api_params = {} @@ -69,7 +75,9 @@ def list_runtimes(self): }, api_params) def list_specifications(self): - """List available function runtime specifications""" + """List available function runtime specifications""" + + api_path = '/functions/specifications' api_params = {} @@ -78,7 +86,9 @@ def list_specifications(self): }, api_params) def get(self, function_id): - """Get function""" + """Get function""" + + api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -92,7 +102,9 @@ def get(self, function_id): }, api_params) def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, specification = None): - """Update function""" + """Update function""" + + api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -126,7 +138,9 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non }, api_params) def delete(self, function_id): - """Delete function""" + """Delete function""" + + api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -140,7 +154,9 @@ def delete(self, function_id): }, api_params) def list_deployments(self, function_id, queries = None, search = None): - """List deployments""" + """List deployments""" + + api_path = '/functions/{functionId}/deployments' api_params = {} if function_id is None: @@ -156,7 +172,9 @@ def list_deployments(self, function_id, queries = None, search = None): }, api_params) def create_deployment(self, function_id, code, activate, entrypoint = None, commands = None, on_progress = None): - """Create deployment""" + """Create deployment""" + + api_path = '/functions/{functionId}/deployments' api_params = {} if function_id is None: @@ -176,15 +194,18 @@ def create_deployment(self, function_id, code, activate, entrypoint = None, comm api_params['activate'] = str(activate).lower() if type(activate) is bool else activate param_name = 'code' + + upload_id = '' return self.client.chunked_upload(api_path, { 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_deployment(self, function_id, deployment_id): - """Get deployment""" + """Get deployment""" + + api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -202,7 +223,9 @@ def get_deployment(self, function_id, deployment_id): }, api_params) def update_deployment(self, function_id, deployment_id): - """Update deployment""" + """Update deployment""" + + api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -220,7 +243,9 @@ def update_deployment(self, function_id, deployment_id): }, api_params) def delete_deployment(self, function_id, deployment_id): - """Delete deployment""" + """Delete deployment""" + + api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -238,7 +263,9 @@ def delete_deployment(self, function_id, deployment_id): }, api_params) def create_build(self, function_id, deployment_id, build_id = None): - """Rebuild deployment""" + """Rebuild deployment""" + + api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} if function_id is None: @@ -257,7 +284,9 @@ def create_build(self, function_id, deployment_id, build_id = None): }, api_params) def update_deployment_build(self, function_id, deployment_id): - """Cancel deployment""" + """Cancel deployment""" + + api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} if function_id is None: @@ -275,7 +304,9 @@ def update_deployment_build(self, function_id, deployment_id): }, api_params) def get_deployment_download(self, function_id, deployment_id): - """Download deployment""" + """Download deployment""" + + api_path = '/functions/{functionId}/deployments/{deploymentId}/download' api_params = {} if function_id is None: @@ -293,7 +324,9 @@ def get_deployment_download(self, function_id, deployment_id): }, api_params) def list_executions(self, function_id, queries = None, search = None): - """List executions""" + """List executions""" + + api_path = '/functions/{functionId}/executions' api_params = {} if function_id is None: @@ -308,8 +341,10 @@ def list_executions(self, function_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None, on_progress = None): - """Create execution""" + def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None): + """Create execution""" + + api_path = '/functions/{functionId}/executions' api_params = {} if function_id is None: @@ -317,19 +352,21 @@ def create_execution(self, function_id, body = None, xasync = None, path = None, api_path = api_path.replace('{functionId}', function_id) - api_params['body'] = str(body).lower() if type(body) is bool else body - api_params['async'] = str(xasync).lower() if type(xasync) is bool else xasync + api_params['body'] = body + api_params['async'] = xasync api_params['path'] = path api_params['method'] = method - api_params['headers'] = str(headers).lower() if type(headers) is bool else headers + api_params['headers'] = headers api_params['scheduledAt'] = scheduled_at return self.client.call('post', api_path, { - 'content-type': 'multipart/form-data', + 'content-type': 'application/json', }, api_params) def get_execution(self, function_id, execution_id): - """Get execution""" + """Get execution""" + + api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} if function_id is None: @@ -347,7 +384,9 @@ def get_execution(self, function_id, execution_id): }, api_params) def delete_execution(self, function_id, execution_id): - """Delete execution""" + """Delete execution""" + + api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} if function_id is None: @@ -365,7 +404,9 @@ def delete_execution(self, function_id, execution_id): }, api_params) def list_variables(self, function_id): - """List variables""" + """List variables""" + + api_path = '/functions/{functionId}/variables' api_params = {} if function_id is None: @@ -379,7 +420,9 @@ def list_variables(self, function_id): }, api_params) def create_variable(self, function_id, key, value): - """Create variable""" + """Create variable""" + + api_path = '/functions/{functionId}/variables' api_params = {} if function_id is None: @@ -401,7 +444,9 @@ def create_variable(self, function_id, key, value): }, api_params) def get_variable(self, function_id, variable_id): - """Get variable""" + """Get variable""" + + api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: @@ -419,7 +464,9 @@ def get_variable(self, function_id, variable_id): }, api_params) def update_variable(self, function_id, variable_id, key, value = None): - """Update variable""" + """Update variable""" + + api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: @@ -442,7 +489,9 @@ def update_variable(self, function_id, variable_id, key, value = None): }, api_params) def delete_variable(self, function_id, variable_id): - """Delete variable""" + """Delete variable""" + + api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: @@ -458,4 +507,3 @@ def delete_variable(self, function_id, variable_id): return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index defa60c..58a6e99 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Graphql, self).__init__(client) def query(self, query): - """GraphQL endpoint""" + """GraphQL endpoint""" + + api_path = '/graphql' api_params = {} if query is None: @@ -22,7 +24,9 @@ def query(self, query): }, api_params) def mutation(self, query): - """GraphQL endpoint""" + """GraphQL endpoint""" + + api_path = '/graphql/mutation' api_params = {} if query is None: @@ -35,4 +39,3 @@ def mutation(self, query): 'x-sdk-graphql': 'true', 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/health.py b/appwrite/services/health.py index ea1e6f2..ef4b3cd 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Health, self).__init__(client) def get(self): - """Get HTTP""" + """Get HTTP""" + + api_path = '/health' api_params = {} @@ -16,7 +18,9 @@ def get(self): }, api_params) def get_antivirus(self): - """Get antivirus""" + """Get antivirus""" + + api_path = '/health/anti-virus' api_params = {} @@ -25,7 +29,9 @@ def get_antivirus(self): }, api_params) def get_cache(self): - """Get cache""" + """Get cache""" + + api_path = '/health/cache' api_params = {} @@ -34,7 +40,9 @@ def get_cache(self): }, api_params) def get_certificate(self, domain = None): - """Get the SSL certificate for a domain""" + """Get the SSL certificate for a domain""" + + api_path = '/health/certificate' api_params = {} @@ -45,7 +53,9 @@ def get_certificate(self, domain = None): }, api_params) def get_db(self): - """Get DB""" + """Get DB""" + + api_path = '/health/db' api_params = {} @@ -54,7 +64,9 @@ def get_db(self): }, api_params) def get_pub_sub(self): - """Get pubsub""" + """Get pubsub""" + + api_path = '/health/pubsub' api_params = {} @@ -63,7 +75,9 @@ def get_pub_sub(self): }, api_params) def get_queue(self): - """Get queue""" + """Get queue""" + + api_path = '/health/queue' api_params = {} @@ -72,7 +86,9 @@ def get_queue(self): }, api_params) def get_queue_builds(self, threshold = None): - """Get builds queue""" + """Get builds queue""" + + api_path = '/health/queue/builds' api_params = {} @@ -83,7 +99,9 @@ def get_queue_builds(self, threshold = None): }, api_params) def get_queue_certificates(self, threshold = None): - """Get certificates queue""" + """Get certificates queue""" + + api_path = '/health/queue/certificates' api_params = {} @@ -94,7 +112,9 @@ def get_queue_certificates(self, threshold = None): }, api_params) def get_queue_databases(self, name = None, threshold = None): - """Get databases queue""" + """Get databases queue""" + + api_path = '/health/queue/databases' api_params = {} @@ -106,7 +126,9 @@ def get_queue_databases(self, name = None, threshold = None): }, api_params) def get_queue_deletes(self, threshold = None): - """Get deletes queue""" + """Get deletes queue""" + + api_path = '/health/queue/deletes' api_params = {} @@ -117,7 +139,9 @@ def get_queue_deletes(self, threshold = None): }, api_params) def get_failed_jobs(self, name, threshold = None): - """Get number of failed queue jobs""" + """Get number of failed queue jobs""" + + api_path = '/health/queue/failed/{name}' api_params = {} if name is None: @@ -132,7 +156,9 @@ def get_failed_jobs(self, name, threshold = None): }, api_params) def get_queue_functions(self, threshold = None): - """Get functions queue""" + """Get functions queue""" + + api_path = '/health/queue/functions' api_params = {} @@ -143,7 +169,9 @@ def get_queue_functions(self, threshold = None): }, api_params) def get_queue_logs(self, threshold = None): - """Get logs queue""" + """Get logs queue""" + + api_path = '/health/queue/logs' api_params = {} @@ -154,7 +182,9 @@ def get_queue_logs(self, threshold = None): }, api_params) def get_queue_mails(self, threshold = None): - """Get mails queue""" + """Get mails queue""" + + api_path = '/health/queue/mails' api_params = {} @@ -165,7 +195,9 @@ def get_queue_mails(self, threshold = None): }, api_params) def get_queue_messaging(self, threshold = None): - """Get messaging queue""" + """Get messaging queue""" + + api_path = '/health/queue/messaging' api_params = {} @@ -176,7 +208,9 @@ def get_queue_messaging(self, threshold = None): }, api_params) def get_queue_migrations(self, threshold = None): - """Get migrations queue""" + """Get migrations queue""" + + api_path = '/health/queue/migrations' api_params = {} @@ -187,7 +221,9 @@ def get_queue_migrations(self, threshold = None): }, api_params) def get_queue_usage(self, threshold = None): - """Get usage queue""" + """Get usage queue""" + + api_path = '/health/queue/usage' api_params = {} @@ -198,7 +234,9 @@ def get_queue_usage(self, threshold = None): }, api_params) def get_queue_usage_dump(self, threshold = None): - """Get usage dump queue""" + """Get usage dump queue""" + + api_path = '/health/queue/usage-dump' api_params = {} @@ -209,7 +247,9 @@ def get_queue_usage_dump(self, threshold = None): }, api_params) def get_queue_webhooks(self, threshold = None): - """Get webhooks queue""" + """Get webhooks queue""" + + api_path = '/health/queue/webhooks' api_params = {} @@ -220,7 +260,9 @@ def get_queue_webhooks(self, threshold = None): }, api_params) def get_storage(self): - """Get storage""" + """Get storage""" + + api_path = '/health/storage' api_params = {} @@ -229,7 +271,9 @@ def get_storage(self): }, api_params) def get_storage_local(self): - """Get local storage""" + """Get local storage""" + + api_path = '/health/storage/local' api_params = {} @@ -238,11 +282,12 @@ def get_storage_local(self): }, api_params) def get_time(self): - """Get time""" + """Get time""" + + api_path = '/health/time' api_params = {} return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index 9286502..db38754 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Locale, self).__init__(client) def get(self): - """Get user locale""" + """Get user locale""" + + api_path = '/locale' api_params = {} @@ -16,7 +18,9 @@ def get(self): }, api_params) def list_codes(self): - """List locale codes""" + """List locale codes""" + + api_path = '/locale/codes' api_params = {} @@ -25,7 +29,9 @@ def list_codes(self): }, api_params) def list_continents(self): - """List continents""" + """List continents""" + + api_path = '/locale/continents' api_params = {} @@ -34,7 +40,9 @@ def list_continents(self): }, api_params) def list_countries(self): - """List countries""" + """List countries""" + + api_path = '/locale/countries' api_params = {} @@ -43,7 +51,9 @@ def list_countries(self): }, api_params) def list_countries_eu(self): - """List EU countries""" + """List EU countries""" + + api_path = '/locale/countries/eu' api_params = {} @@ -52,7 +62,9 @@ def list_countries_eu(self): }, api_params) def list_countries_phones(self): - """List countries phone codes""" + """List countries phone codes""" + + api_path = '/locale/countries/phones' api_params = {} @@ -61,7 +73,9 @@ def list_countries_phones(self): }, api_params) def list_currencies(self): - """List currencies""" + """List currencies""" + + api_path = '/locale/currencies' api_params = {} @@ -70,11 +84,12 @@ def list_currencies(self): }, api_params) def list_languages(self): - """List languages""" + """List languages""" + + api_path = '/locale/languages' api_params = {} return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 9a94ad0..11e73be 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Messaging, self).__init__(client) def list_messages(self, queries = None, search = None): - """List messages""" + """List messages""" + + api_path = '/messaging/messages' api_params = {} @@ -19,7 +21,9 @@ def list_messages(self, queries = None, search = None): }, api_params) def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, attachments = None, draft = None, html = None, scheduled_at = None): - """Create email""" + """Create email""" + + api_path = '/messaging/messages/email' api_params = {} if message_id is None: @@ -50,7 +54,9 @@ def create_email(self, message_id, subject, content, topics = None, users = None }, api_params) def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, draft = None, html = None, cc = None, bcc = None, scheduled_at = None, attachments = None): - """Update email""" + """Update email""" + + api_path = '/messaging/messages/email/{messageId}' api_params = {} if message_id is None: @@ -75,7 +81,9 @@ def update_email(self, message_id, topics = None, users = None, targets = None, }, api_params) def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): - """Create push notification""" + """Create push notification""" + + api_path = '/messaging/messages/push' api_params = {} if message_id is None: @@ -110,7 +118,9 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ }, api_params) def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): - """Update push notification""" + """Update push notification""" + + api_path = '/messaging/messages/push/{messageId}' api_params = {} if message_id is None: @@ -139,7 +149,9 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t }, api_params) def create_sms(self, message_id, content, topics = None, users = None, targets = None, draft = None, scheduled_at = None): - """Create SMS""" + """Create SMS""" + + api_path = '/messaging/messages/sms' api_params = {} if message_id is None: @@ -162,7 +174,9 @@ def create_sms(self, message_id, content, topics = None, users = None, targets = }, api_params) def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, draft = None, scheduled_at = None): - """Update SMS""" + """Update SMS""" + + api_path = '/messaging/messages/sms/{messageId}' api_params = {} if message_id is None: @@ -182,7 +196,9 @@ def update_sms(self, message_id, topics = None, users = None, targets = None, co }, api_params) def get_message(self, message_id): - """Get message""" + """Get message""" + + api_path = '/messaging/messages/{messageId}' api_params = {} if message_id is None: @@ -196,7 +212,9 @@ def get_message(self, message_id): }, api_params) def delete(self, message_id): - """Delete message""" + """Delete message""" + + api_path = '/messaging/messages/{messageId}' api_params = {} if message_id is None: @@ -210,7 +228,9 @@ def delete(self, message_id): }, api_params) def list_message_logs(self, message_id, queries = None): - """List message logs""" + """List message logs""" + + api_path = '/messaging/messages/{messageId}/logs' api_params = {} if message_id is None: @@ -225,7 +245,9 @@ def list_message_logs(self, message_id, queries = None): }, api_params) def list_targets(self, message_id, queries = None): - """List message targets""" + """List message targets""" + + api_path = '/messaging/messages/{messageId}/targets' api_params = {} if message_id is None: @@ -240,7 +262,9 @@ def list_targets(self, message_id, queries = None): }, api_params) def list_providers(self, queries = None, search = None): - """List providers""" + """List providers""" + + api_path = '/messaging/providers' api_params = {} @@ -252,7 +276,9 @@ def list_providers(self, queries = None, search = None): }, api_params) def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, sandbox = None, enabled = None): - """Create APNS provider""" + """Create APNS provider""" + + api_path = '/messaging/providers/apns' api_params = {} if provider_id is None: @@ -276,7 +302,9 @@ def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = }, api_params) def update_apns_provider(self, provider_id, name = None, enabled = None, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, sandbox = None): - """Update APNS provider""" + """Update APNS provider""" + + api_path = '/messaging/providers/apns/{providerId}' api_params = {} if provider_id is None: @@ -297,7 +325,9 @@ def update_apns_provider(self, provider_id, name = None, enabled = None, auth_ke }, api_params) def create_fcm_provider(self, provider_id, name, service_account_json = None, enabled = None): - """Create FCM provider""" + """Create FCM provider""" + + api_path = '/messaging/providers/fcm' api_params = {} if provider_id is None: @@ -317,7 +347,9 @@ def create_fcm_provider(self, provider_id, name, service_account_json = None, en }, api_params) def update_fcm_provider(self, provider_id, name = None, enabled = None, service_account_json = None): - """Update FCM provider""" + """Update FCM provider""" + + api_path = '/messaging/providers/fcm/{providerId}' api_params = {} if provider_id is None: @@ -334,7 +366,9 @@ def update_fcm_provider(self, provider_id, name = None, enabled = None, service_ }, api_params) def create_mailgun_provider(self, provider_id, name, api_key = None, domain = None, is_eu_region = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create Mailgun provider""" + """Create Mailgun provider""" + + api_path = '/messaging/providers/mailgun' api_params = {} if provider_id is None: @@ -360,7 +394,9 @@ def create_mailgun_provider(self, provider_id, name, api_key = None, domain = No }, api_params) def update_mailgun_provider(self, provider_id, name = None, api_key = None, domain = None, is_eu_region = None, enabled = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): - """Update Mailgun provider""" + """Update Mailgun provider""" + + api_path = '/messaging/providers/mailgun/{providerId}' api_params = {} if provider_id is None: @@ -383,7 +419,9 @@ def update_mailgun_provider(self, provider_id, name = None, api_key = None, doma }, api_params) def create_msg91_provider(self, provider_id, name, template_id = None, sender_id = None, auth_key = None, enabled = None): - """Create Msg91 provider""" + """Create Msg91 provider""" + + api_path = '/messaging/providers/msg91' api_params = {} if provider_id is None: @@ -405,7 +443,9 @@ def create_msg91_provider(self, provider_id, name, template_id = None, sender_id }, api_params) def update_msg91_provider(self, provider_id, name = None, enabled = None, template_id = None, sender_id = None, auth_key = None): - """Update Msg91 provider""" + """Update Msg91 provider""" + + api_path = '/messaging/providers/msg91/{providerId}' api_params = {} if provider_id is None: @@ -424,7 +464,9 @@ def update_msg91_provider(self, provider_id, name = None, enabled = None, templa }, api_params) def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create Sendgrid provider""" + """Create Sendgrid provider""" + + api_path = '/messaging/providers/sendgrid' api_params = {} if provider_id is None: @@ -448,7 +490,9 @@ def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name }, api_params) def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): - """Update Sendgrid provider""" + """Update Sendgrid provider""" + + api_path = '/messaging/providers/sendgrid/{providerId}' api_params = {} if provider_id is None: @@ -469,7 +513,9 @@ def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api }, api_params) def create_smtp_provider(self, provider_id, name, host, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create SMTP provider""" + """Create SMTP provider""" + + api_path = '/messaging/providers/smtp' api_params = {} if provider_id is None: @@ -502,7 +548,9 @@ def create_smtp_provider(self, provider_id, name, host, port = None, username = }, api_params) def update_smtp_provider(self, provider_id, name = None, host = None, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Update SMTP provider""" + """Update SMTP provider""" + + api_path = '/messaging/providers/smtp/{providerId}' api_params = {} if provider_id is None: @@ -529,7 +577,9 @@ def update_smtp_provider(self, provider_id, name = None, host = None, port = Non }, api_params) def create_telesign_provider(self, provider_id, name, xfrom = None, customer_id = None, api_key = None, enabled = None): - """Create Telesign provider""" + """Create Telesign provider""" + + api_path = '/messaging/providers/telesign' api_params = {} if provider_id is None: @@ -551,7 +601,9 @@ def create_telesign_provider(self, provider_id, name, xfrom = None, customer_id }, api_params) def update_telesign_provider(self, provider_id, name = None, enabled = None, customer_id = None, api_key = None, xfrom = None): - """Update Telesign provider""" + """Update Telesign provider""" + + api_path = '/messaging/providers/telesign/{providerId}' api_params = {} if provider_id is None: @@ -570,7 +622,9 @@ def update_telesign_provider(self, provider_id, name = None, enabled = None, cus }, api_params) def create_textmagic_provider(self, provider_id, name, xfrom = None, username = None, api_key = None, enabled = None): - """Create Textmagic provider""" + """Create Textmagic provider""" + + api_path = '/messaging/providers/textmagic' api_params = {} if provider_id is None: @@ -592,7 +646,9 @@ def create_textmagic_provider(self, provider_id, name, xfrom = None, username = }, api_params) def update_textmagic_provider(self, provider_id, name = None, enabled = None, username = None, api_key = None, xfrom = None): - """Update Textmagic provider""" + """Update Textmagic provider""" + + api_path = '/messaging/providers/textmagic/{providerId}' api_params = {} if provider_id is None: @@ -611,7 +667,9 @@ def update_textmagic_provider(self, provider_id, name = None, enabled = None, us }, api_params) def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = None, auth_token = None, enabled = None): - """Create Twilio provider""" + """Create Twilio provider""" + + api_path = '/messaging/providers/twilio' api_params = {} if provider_id is None: @@ -633,7 +691,9 @@ def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = }, api_params) def update_twilio_provider(self, provider_id, name = None, enabled = None, account_sid = None, auth_token = None, xfrom = None): - """Update Twilio provider""" + """Update Twilio provider""" + + api_path = '/messaging/providers/twilio/{providerId}' api_params = {} if provider_id is None: @@ -652,7 +712,9 @@ def update_twilio_provider(self, provider_id, name = None, enabled = None, accou }, api_params) def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None, api_secret = None, enabled = None): - """Create Vonage provider""" + """Create Vonage provider""" + + api_path = '/messaging/providers/vonage' api_params = {} if provider_id is None: @@ -674,7 +736,9 @@ def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None }, api_params) def update_vonage_provider(self, provider_id, name = None, enabled = None, api_key = None, api_secret = None, xfrom = None): - """Update Vonage provider""" + """Update Vonage provider""" + + api_path = '/messaging/providers/vonage/{providerId}' api_params = {} if provider_id is None: @@ -693,7 +757,9 @@ def update_vonage_provider(self, provider_id, name = None, enabled = None, api_k }, api_params) def get_provider(self, provider_id): - """Get provider""" + """Get provider""" + + api_path = '/messaging/providers/{providerId}' api_params = {} if provider_id is None: @@ -707,7 +773,9 @@ def get_provider(self, provider_id): }, api_params) def delete_provider(self, provider_id): - """Delete provider""" + """Delete provider""" + + api_path = '/messaging/providers/{providerId}' api_params = {} if provider_id is None: @@ -721,7 +789,9 @@ def delete_provider(self, provider_id): }, api_params) def list_provider_logs(self, provider_id, queries = None): - """List provider logs""" + """List provider logs""" + + api_path = '/messaging/providers/{providerId}/logs' api_params = {} if provider_id is None: @@ -736,7 +806,9 @@ def list_provider_logs(self, provider_id, queries = None): }, api_params) def list_subscriber_logs(self, subscriber_id, queries = None): - """List subscriber logs""" + """List subscriber logs""" + + api_path = '/messaging/subscribers/{subscriberId}/logs' api_params = {} if subscriber_id is None: @@ -751,7 +823,9 @@ def list_subscriber_logs(self, subscriber_id, queries = None): }, api_params) def list_topics(self, queries = None, search = None): - """List topics""" + """List topics""" + + api_path = '/messaging/topics' api_params = {} @@ -763,7 +837,9 @@ def list_topics(self, queries = None, search = None): }, api_params) def create_topic(self, topic_id, name, subscribe = None): - """Create topic""" + """Create topic""" + + api_path = '/messaging/topics' api_params = {} if topic_id is None: @@ -782,7 +858,9 @@ def create_topic(self, topic_id, name, subscribe = None): }, api_params) def get_topic(self, topic_id): - """Get topic""" + """Get topic""" + + api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -796,7 +874,9 @@ def get_topic(self, topic_id): }, api_params) def update_topic(self, topic_id, name = None, subscribe = None): - """Update topic""" + """Update topic""" + + api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -812,7 +892,9 @@ def update_topic(self, topic_id, name = None, subscribe = None): }, api_params) def delete_topic(self, topic_id): - """Delete topic""" + """Delete topic""" + + api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -826,7 +908,9 @@ def delete_topic(self, topic_id): }, api_params) def list_topic_logs(self, topic_id, queries = None): - """List topic logs""" + """List topic logs""" + + api_path = '/messaging/topics/{topicId}/logs' api_params = {} if topic_id is None: @@ -841,7 +925,9 @@ def list_topic_logs(self, topic_id, queries = None): }, api_params) def list_subscribers(self, topic_id, queries = None, search = None): - """List subscribers""" + """List subscribers""" + + api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} if topic_id is None: @@ -857,7 +943,9 @@ def list_subscribers(self, topic_id, queries = None, search = None): }, api_params) def create_subscriber(self, topic_id, subscriber_id, target_id): - """Create subscriber""" + """Create subscriber""" + + api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} if topic_id is None: @@ -879,7 +967,9 @@ def create_subscriber(self, topic_id, subscriber_id, target_id): }, api_params) def get_subscriber(self, topic_id, subscriber_id): - """Get subscriber""" + """Get subscriber""" + + api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} if topic_id is None: @@ -897,7 +987,9 @@ def get_subscriber(self, topic_id, subscriber_id): }, api_params) def delete_subscriber(self, topic_id, subscriber_id): - """Delete subscriber""" + """Delete subscriber""" + + api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} if topic_id is None: @@ -913,4 +1005,3 @@ def delete_subscriber(self, topic_id, subscriber_id): return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index f264c80..9acbb3a 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Storage, self).__init__(client) def list_buckets(self, queries = None, search = None): - """List buckets""" + """List buckets""" + + api_path = '/storage/buckets' api_params = {} @@ -19,7 +21,9 @@ def list_buckets(self, queries = None, search = None): }, api_params) def create_bucket(self, bucket_id, name, permissions = None, file_security = None, enabled = None, maximum_file_size = None, allowed_file_extensions = None, compression = None, encryption = None, antivirus = None): - """Create bucket""" + """Create bucket""" + + api_path = '/storage/buckets' api_params = {} if bucket_id is None: @@ -45,7 +49,9 @@ def create_bucket(self, bucket_id, name, permissions = None, file_security = Non }, api_params) def get_bucket(self, bucket_id): - """Get bucket""" + """Get bucket""" + + api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -59,7 +65,9 @@ def get_bucket(self, bucket_id): }, api_params) def update_bucket(self, bucket_id, name, permissions = None, file_security = None, enabled = None, maximum_file_size = None, allowed_file_extensions = None, compression = None, encryption = None, antivirus = None): - """Update bucket""" + """Update bucket""" + + api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -85,7 +93,9 @@ def update_bucket(self, bucket_id, name, permissions = None, file_security = Non }, api_params) def delete_bucket(self, bucket_id): - """Delete bucket""" + """Delete bucket""" + + api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -99,7 +109,9 @@ def delete_bucket(self, bucket_id): }, api_params) def list_files(self, bucket_id, queries = None, search = None): - """List files""" + """List files""" + + api_path = '/storage/buckets/{bucketId}/files' api_params = {} if bucket_id is None: @@ -115,7 +127,9 @@ def list_files(self, bucket_id, queries = None, search = None): }, api_params) def create_file(self, bucket_id, file_id, file, permissions = None, on_progress = None): - """Create file""" + """Create file""" + + api_path = '/storage/buckets/{bucketId}/files' api_params = {} if bucket_id is None: @@ -134,15 +148,19 @@ def create_file(self, bucket_id, file_id, file, permissions = None, on_progress api_params['permissions'] = permissions param_name = 'file' + + upload_id = '' upload_id = file_id + return self.client.chunked_upload(api_path, { 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_file(self, bucket_id, file_id): - """Get file""" + """Get file""" + + api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -160,7 +178,9 @@ def get_file(self, bucket_id, file_id): }, api_params) def update_file(self, bucket_id, file_id, name = None, permissions = None): - """Update file""" + """Update file""" + + api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -180,7 +200,9 @@ def update_file(self, bucket_id, file_id, name = None, permissions = None): }, api_params) def delete_file(self, bucket_id, file_id): - """Delete file""" + """Delete file""" + + api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -198,7 +220,9 @@ def delete_file(self, bucket_id, file_id): }, api_params) def get_file_download(self, bucket_id, file_id): - """Get file for download""" + """Get file for download""" + + api_path = '/storage/buckets/{bucketId}/files/{fileId}/download' api_params = {} if bucket_id is None: @@ -216,7 +240,9 @@ def get_file_download(self, bucket_id, file_id): }, api_params) def get_file_preview(self, bucket_id, file_id, width = None, height = None, gravity = None, quality = None, border_width = None, border_color = None, border_radius = None, opacity = None, rotation = None, background = None, output = None): - """Get file preview""" + """Get file preview""" + + api_path = '/storage/buckets/{bucketId}/files/{fileId}/preview' api_params = {} if bucket_id is None: @@ -245,7 +271,9 @@ def get_file_preview(self, bucket_id, file_id, width = None, height = None, grav }, api_params) def get_file_view(self, bucket_id, file_id): - """Get file for view""" + """Get file for view""" + + api_path = '/storage/buckets/{bucketId}/files/{fileId}/view' api_params = {} if bucket_id is None: @@ -261,4 +289,3 @@ def get_file_view(self, bucket_id, file_id): return self.client.call('get', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 0dd009d..2c387ed 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Teams, self).__init__(client) def list(self, queries = None, search = None): - """List teams""" + """List teams""" + + api_path = '/teams' api_params = {} @@ -19,7 +21,9 @@ def list(self, queries = None, search = None): }, api_params) def create(self, team_id, name, roles = None): - """Create team""" + """Create team""" + + api_path = '/teams' api_params = {} if team_id is None: @@ -38,7 +42,9 @@ def create(self, team_id, name, roles = None): }, api_params) def get(self, team_id): - """Get team""" + """Get team""" + + api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -52,7 +58,9 @@ def get(self, team_id): }, api_params) def update_name(self, team_id, name): - """Update name""" + """Update name""" + + api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -70,7 +78,9 @@ def update_name(self, team_id, name): }, api_params) def delete(self, team_id): - """Delete team""" + """Delete team""" + + api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -84,7 +94,9 @@ def delete(self, team_id): }, api_params) def list_memberships(self, team_id, queries = None, search = None): - """List team memberships""" + """List team memberships""" + + api_path = '/teams/{teamId}/memberships' api_params = {} if team_id is None: @@ -100,7 +112,9 @@ def list_memberships(self, team_id, queries = None, search = None): }, api_params) def create_membership(self, team_id, roles, email = None, user_id = None, phone = None, url = None, name = None): - """Create team membership""" + """Create team membership""" + + api_path = '/teams/{teamId}/memberships' api_params = {} if team_id is None: @@ -123,7 +137,9 @@ def create_membership(self, team_id, roles, email = None, user_id = None, phone }, api_params) def get_membership(self, team_id, membership_id): - """Get team membership""" + """Get team membership""" + + api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -141,7 +157,9 @@ def get_membership(self, team_id, membership_id): }, api_params) def update_membership(self, team_id, membership_id, roles): - """Update membership""" + """Update membership""" + + api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -163,7 +181,9 @@ def update_membership(self, team_id, membership_id, roles): }, api_params) def delete_membership(self, team_id, membership_id): - """Delete team membership""" + """Delete team membership""" + + api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -181,7 +201,9 @@ def delete_membership(self, team_id, membership_id): }, api_params) def update_membership_status(self, team_id, membership_id, user_id, secret): - """Update team membership status""" + """Update team membership status""" + + api_path = '/teams/{teamId}/memberships/{membershipId}/status' api_params = {} if team_id is None: @@ -207,7 +229,9 @@ def update_membership_status(self, team_id, membership_id, user_id, secret): }, api_params) def get_prefs(self, team_id): - """Get team preferences""" + """Get team preferences""" + + api_path = '/teams/{teamId}/prefs' api_params = {} if team_id is None: @@ -221,7 +245,9 @@ def get_prefs(self, team_id): }, api_params) def update_prefs(self, team_id, prefs): - """Update preferences""" + """Update preferences""" + + api_path = '/teams/{teamId}/prefs' api_params = {} if team_id is None: @@ -237,4 +263,3 @@ def update_prefs(self, team_id, prefs): return self.client.call('put', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 0774580..aa04a72 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -7,7 +7,9 @@ def __init__(self, client): super(Users, self).__init__(client) def list(self, queries = None, search = None): - """List users""" + """List users""" + + api_path = '/users' api_params = {} @@ -19,7 +21,9 @@ def list(self, queries = None, search = None): }, api_params) def create(self, user_id, email = None, phone = None, password = None, name = None): - """Create user""" + """Create user""" + + api_path = '/users' api_params = {} if user_id is None: @@ -37,7 +41,9 @@ def create(self, user_id, email = None, phone = None, password = None, name = No }, api_params) def create_argon2_user(self, user_id, email, password, name = None): - """Create user with Argon2 password""" + """Create user with Argon2 password""" + + api_path = '/users/argon2' api_params = {} if user_id is None: @@ -60,7 +66,9 @@ def create_argon2_user(self, user_id, email, password, name = None): }, api_params) def create_bcrypt_user(self, user_id, email, password, name = None): - """Create user with bcrypt password""" + """Create user with bcrypt password""" + + api_path = '/users/bcrypt' api_params = {} if user_id is None: @@ -83,7 +91,9 @@ def create_bcrypt_user(self, user_id, email, password, name = None): }, api_params) def list_identities(self, queries = None, search = None): - """List identities""" + """List identities""" + + api_path = '/users/identities' api_params = {} @@ -95,7 +105,9 @@ def list_identities(self, queries = None, search = None): }, api_params) def delete_identity(self, identity_id): - """Delete identity""" + """Delete identity""" + + api_path = '/users/identities/{identityId}' api_params = {} if identity_id is None: @@ -109,7 +121,9 @@ def delete_identity(self, identity_id): }, api_params) def create_md5_user(self, user_id, email, password, name = None): - """Create user with MD5 password""" + """Create user with MD5 password""" + + api_path = '/users/md5' api_params = {} if user_id is None: @@ -132,7 +146,9 @@ def create_md5_user(self, user_id, email, password, name = None): }, api_params) def create_ph_pass_user(self, user_id, email, password, name = None): - """Create user with PHPass password""" + """Create user with PHPass password""" + + api_path = '/users/phpass' api_params = {} if user_id is None: @@ -155,7 +171,9 @@ def create_ph_pass_user(self, user_id, email, password, name = None): }, api_params) def create_scrypt_user(self, user_id, email, password, password_salt, password_cpu, password_memory, password_parallel, password_length, name = None): - """Create user with Scrypt password""" + """Create user with Scrypt password""" + + api_path = '/users/scrypt' api_params = {} if user_id is None: @@ -198,7 +216,9 @@ def create_scrypt_user(self, user_id, email, password, password_salt, password_c }, api_params) def create_scrypt_modified_user(self, user_id, email, password, password_salt, password_salt_separator, password_signer_key, name = None): - """Create user with Scrypt modified password""" + """Create user with Scrypt modified password""" + + api_path = '/users/scrypt-modified' api_params = {} if user_id is None: @@ -233,7 +253,9 @@ def create_scrypt_modified_user(self, user_id, email, password, password_salt, p }, api_params) def create_sha_user(self, user_id, email, password, password_version = None, name = None): - """Create user with SHA password""" + """Create user with SHA password""" + + api_path = '/users/sha' api_params = {} if user_id is None: @@ -257,7 +279,9 @@ def create_sha_user(self, user_id, email, password, password_version = None, nam }, api_params) def get(self, user_id): - """Get user""" + """Get user""" + + api_path = '/users/{userId}' api_params = {} if user_id is None: @@ -271,7 +295,9 @@ def get(self, user_id): }, api_params) def delete(self, user_id): - """Delete user""" + """Delete user""" + + api_path = '/users/{userId}' api_params = {} if user_id is None: @@ -285,7 +311,9 @@ def delete(self, user_id): }, api_params) def update_email(self, user_id, email): - """Update email""" + """Update email""" + + api_path = '/users/{userId}/email' api_params = {} if user_id is None: @@ -303,7 +331,9 @@ def update_email(self, user_id, email): }, api_params) def create_jwt(self, user_id, session_id = None, duration = None): - """Create user JWT""" + """Create user JWT""" + + api_path = '/users/{userId}/jwts' api_params = {} if user_id is None: @@ -319,7 +349,9 @@ def create_jwt(self, user_id, session_id = None, duration = None): }, api_params) def update_labels(self, user_id, labels): - """Update user labels""" + """Update user labels""" + + api_path = '/users/{userId}/labels' api_params = {} if user_id is None: @@ -337,7 +369,9 @@ def update_labels(self, user_id, labels): }, api_params) def list_logs(self, user_id, queries = None): - """List user logs""" + """List user logs""" + + api_path = '/users/{userId}/logs' api_params = {} if user_id is None: @@ -352,7 +386,9 @@ def list_logs(self, user_id, queries = None): }, api_params) def list_memberships(self, user_id): - """List user memberships""" + """List user memberships""" + + api_path = '/users/{userId}/memberships' api_params = {} if user_id is None: @@ -366,7 +402,9 @@ def list_memberships(self, user_id): }, api_params) def update_mfa(self, user_id, mfa): - """Update MFA""" + """Update MFA""" + + api_path = '/users/{userId}/mfa' api_params = {} if user_id is None: @@ -384,7 +422,9 @@ def update_mfa(self, user_id, mfa): }, api_params) def delete_mfa_authenticator(self, user_id, type): - """Delete authenticator""" + """Delete authenticator""" + + api_path = '/users/{userId}/mfa/authenticators/{type}' api_params = {} if user_id is None: @@ -402,7 +442,9 @@ def delete_mfa_authenticator(self, user_id, type): }, api_params) def list_mfa_factors(self, user_id): - """List factors""" + """List factors""" + + api_path = '/users/{userId}/mfa/factors' api_params = {} if user_id is None: @@ -416,7 +458,9 @@ def list_mfa_factors(self, user_id): }, api_params) def get_mfa_recovery_codes(self, user_id): - """Get MFA recovery codes""" + """Get MFA recovery codes""" + + api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -430,7 +474,9 @@ def get_mfa_recovery_codes(self, user_id): }, api_params) def update_mfa_recovery_codes(self, user_id): - """Regenerate MFA recovery codes""" + """Regenerate MFA recovery codes""" + + api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -444,7 +490,9 @@ def update_mfa_recovery_codes(self, user_id): }, api_params) def create_mfa_recovery_codes(self, user_id): - """Create MFA recovery codes""" + """Create MFA recovery codes""" + + api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -458,7 +506,9 @@ def create_mfa_recovery_codes(self, user_id): }, api_params) def update_name(self, user_id, name): - """Update name""" + """Update name""" + + api_path = '/users/{userId}/name' api_params = {} if user_id is None: @@ -476,7 +526,9 @@ def update_name(self, user_id, name): }, api_params) def update_password(self, user_id, password): - """Update password""" + """Update password""" + + api_path = '/users/{userId}/password' api_params = {} if user_id is None: @@ -494,7 +546,9 @@ def update_password(self, user_id, password): }, api_params) def update_phone(self, user_id, number): - """Update phone""" + """Update phone""" + + api_path = '/users/{userId}/phone' api_params = {} if user_id is None: @@ -512,7 +566,9 @@ def update_phone(self, user_id, number): }, api_params) def get_prefs(self, user_id): - """Get user preferences""" + """Get user preferences""" + + api_path = '/users/{userId}/prefs' api_params = {} if user_id is None: @@ -526,7 +582,9 @@ def get_prefs(self, user_id): }, api_params) def update_prefs(self, user_id, prefs): - """Update user preferences""" + """Update user preferences""" + + api_path = '/users/{userId}/prefs' api_params = {} if user_id is None: @@ -544,7 +602,9 @@ def update_prefs(self, user_id, prefs): }, api_params) def list_sessions(self, user_id): - """List user sessions""" + """List user sessions""" + + api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -558,7 +618,9 @@ def list_sessions(self, user_id): }, api_params) def create_session(self, user_id): - """Create session""" + """Create session""" + + api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -572,7 +634,9 @@ def create_session(self, user_id): }, api_params) def delete_sessions(self, user_id): - """Delete user sessions""" + """Delete user sessions""" + + api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -586,7 +650,9 @@ def delete_sessions(self, user_id): }, api_params) def delete_session(self, user_id, session_id): - """Delete user session""" + """Delete user session""" + + api_path = '/users/{userId}/sessions/{sessionId}' api_params = {} if user_id is None: @@ -604,7 +670,9 @@ def delete_session(self, user_id, session_id): }, api_params) def update_status(self, user_id, status): - """Update user status""" + """Update user status""" + + api_path = '/users/{userId}/status' api_params = {} if user_id is None: @@ -622,7 +690,9 @@ def update_status(self, user_id, status): }, api_params) def list_targets(self, user_id, queries = None): - """List user targets""" + """List user targets""" + + api_path = '/users/{userId}/targets' api_params = {} if user_id is None: @@ -637,7 +707,9 @@ def list_targets(self, user_id, queries = None): }, api_params) def create_target(self, user_id, target_id, provider_type, identifier, provider_id = None, name = None): - """Create user target""" + """Create user target""" + + api_path = '/users/{userId}/targets' api_params = {} if user_id is None: @@ -665,7 +737,9 @@ def create_target(self, user_id, target_id, provider_type, identifier, provider_ }, api_params) def get_target(self, user_id, target_id): - """Get user target""" + """Get user target""" + + api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -683,7 +757,9 @@ def get_target(self, user_id, target_id): }, api_params) def update_target(self, user_id, target_id, identifier = None, provider_id = None, name = None): - """Update user target""" + """Update user target""" + + api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -704,7 +780,9 @@ def update_target(self, user_id, target_id, identifier = None, provider_id = Non }, api_params) def delete_target(self, user_id, target_id): - """Delete user target""" + """Delete user target""" + + api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -722,7 +800,9 @@ def delete_target(self, user_id, target_id): }, api_params) def create_token(self, user_id, length = None, expire = None): - """Create token""" + """Create token""" + + api_path = '/users/{userId}/tokens' api_params = {} if user_id is None: @@ -738,7 +818,9 @@ def create_token(self, user_id, length = None, expire = None): }, api_params) def update_email_verification(self, user_id, email_verification): - """Update email verification""" + """Update email verification""" + + api_path = '/users/{userId}/verification' api_params = {} if user_id is None: @@ -756,7 +838,9 @@ def update_email_verification(self, user_id, email_verification): }, api_params) def update_phone_verification(self, user_id, phone_verification): - """Update phone verification""" + """Update phone verification""" + + api_path = '/users/{userId}/verification/phone' api_params = {} if user_id is None: @@ -772,4 +856,3 @@ def update_phone_verification(self, user_id, phone_verification): return self.client.call('patch', api_path, { 'content-type': 'application/json', }, api_params) - diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index bbe7ddb..ab910d9 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -13,6 +13,6 @@ result = databases.update_string_attribute( key = '', required = False, default = '<DEFAULT>', - size = None, # optional + size = 1, # optional new_key = '' # optional ) diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 9e2b711..da9b559 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.payload import Payload +from appwrite.input_file import InputFile client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint @@ -10,7 +10,7 @@ functions = Functions(client) result = functions.create_deployment( function_id = '<FUNCTION_ID>', - code = Payload.from_file('/path/to/file.png'), + code = InputFile.from_path('file.png'), activate = False, entrypoint = '<ENTRYPOINT>', # optional commands = '<COMMANDS>' # optional diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index aa4a2f5..e1decb9 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -9,7 +9,7 @@ functions = Functions(client) result = functions.create_execution( function_id = '<FUNCTION_ID>', - body = Payload.from_json({"x": "y"}), # optional + body = '<BODY>', # optional async = False, # optional path = '<PATH>', # optional method = ExecutionMethod.GET, # optional diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 2884c26..d275070 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,5 +1,5 @@ from appwrite.client import Client -from appwrite.payload import Payload +from appwrite.input_file import InputFile client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint @@ -11,6 +11,6 @@ storage = Storage(client) result = storage.create_file( bucket_id = '<BUCKET_ID>', file_id = '<FILE_ID>', - file = Payload.from_file('/path/to/file.png'), + file = InputFile.from_path('file.png'), permissions = ["read("any")"] # optional ) From 0543fe94b1ee361878b160fc0b76670c2e6cc689 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:19:09 +0000 Subject: [PATCH 34/60] chore: patch version --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index ba0ed1e..ff48812 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/7.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/7.0.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '7.0.0', + 'x-sdk-version': '7.0.1', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/setup.py b/setup.py index e0d1c11..4e43800 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '7.0.0', + version = '7.0.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/7.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/7.0.1.tar.gz', install_requires=[ 'requests', ], From 362ea5a6b36f50f539b73c2ca122d37f7f4fd56f Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Wed, 11 Dec 2024 00:35:40 +1300 Subject: [PATCH 35/60] Add new push message parameters --- README.md | 2 +- appwrite/client.py | 4 ++-- appwrite/encoders/value_class_encoder.py | 4 ++++ appwrite/enums/message_priority.py | 5 +++++ appwrite/enums/runtime.py | 1 + appwrite/services/messaging.py | 16 ++++++++-------- docs/examples/messaging/create-push.md | 11 +++++++---- docs/examples/messaging/update-push.md | 5 ++++- setup.py | 4 ++-- 9 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 appwrite/enums/message_priority.py diff --git a/README.md b/README.md index eb42d99..466c7ac 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index ff48812..f745945 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/7.0.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/6.2.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '7.0.1', + 'x-sdk-version': '6.2.0', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py index f343add..95b06b7 100644 --- a/appwrite/encoders/value_class_encoder.py +++ b/appwrite/encoders/value_class_encoder.py @@ -11,6 +11,7 @@ from ..enums.runtime import Runtime from ..enums.execution_method import ExecutionMethod from ..enums.name import Name +from ..enums.message_priority import MessagePriority from ..enums.smtp_encryption import SmtpEncryption from ..enums.compression import Compression from ..enums.image_gravity import ImageGravity @@ -56,6 +57,9 @@ def default(self, o): if isinstance(o, Name): return o.value + if isinstance(o, MessagePriority): + return o.value + if isinstance(o, SmtpEncryption): return o.value diff --git a/appwrite/enums/message_priority.py b/appwrite/enums/message_priority.py new file mode 100644 index 0000000..0010a35 --- /dev/null +++ b/appwrite/enums/message_priority.py @@ -0,0 +1,5 @@ +from enum import Enum + +class MessagePriority(Enum): + NORMAL = "normal" + HIGH = "high" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index db428ef..1485f48 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -59,3 +59,4 @@ class Runtime(Enum): BUN_1_1 = "bun-1.1" GO_1_23 = "go-1.23" STATIC_1 = "static-1" + FLUTTER_3_24 = "flutter-3.24" diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 11e73be..f8ce3bf 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -80,7 +80,7 @@ def update_email(self, message_id, topics = None, users = None, targets = None, 'content-type': 'application/json', }, api_params) - def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): + def create_push(self, message_id, title = None, body = None, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None, content_available = None, critical = None, priority = None): """Create push notification""" @@ -89,12 +89,6 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ if message_id is None: raise AppwriteException('Missing required parameter: "message_id"') - if title is None: - raise AppwriteException('Missing required parameter: "title"') - - if body is None: - raise AppwriteException('Missing required parameter: "body"') - api_params['messageId'] = message_id api_params['title'] = title @@ -112,12 +106,15 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ api_params['badge'] = badge api_params['draft'] = draft api_params['scheduledAt'] = scheduled_at + api_params['contentAvailable'] = content_available + api_params['critical'] = critical + api_params['priority'] = priority return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): + def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None, content_available = None, critical = None, priority = None): """Update push notification""" @@ -143,6 +140,9 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t api_params['badge'] = badge api_params['draft'] = draft api_params['scheduledAt'] = scheduled_at + api_params['contentAvailable'] = content_available + api_params['critical'] = critical + api_params['priority'] = priority return self.client.call('patch', api_path, { 'content-type': 'application/json', diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index ffed825..616b945 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -9,8 +9,8 @@ messaging = Messaging(client) result = messaging.create_push( message_id = '<MESSAGE_ID>', - title = '<TITLE>', - body = '<BODY>', + title = '<TITLE>', # optional + body = '<BODY>', # optional topics = [], # optional users = [], # optional targets = [], # optional @@ -21,7 +21,10 @@ result = messaging.create_push( sound = '<SOUND>', # optional color = '<COLOR>', # optional tag = '<TAG>', # optional - badge = '<BADGE>', # optional + badge = None, # optional draft = False, # optional - scheduled_at = '' # optional + scheduled_at = '', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional ) diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 3c3965c..f5bdf15 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -23,5 +23,8 @@ result = messaging.update_push( tag = '<TAG>', # optional badge = None, # optional draft = False, # optional - scheduled_at = '' # optional + scheduled_at = '', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional ) diff --git a/setup.py b/setup.py index 4e43800..6fd72cd 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '7.0.1', + version = '6.2.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/7.0.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/6.2.0.tar.gz', install_requires=[ 'requests', ], From 91d4b3b56747d55db734d31a74300f617582d513 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Wed, 11 Dec 2024 01:05:01 +1300 Subject: [PATCH 36/60] Add new push message parameters --- README.md | 2 +- appwrite/client.py | 4 ++-- appwrite/encoders/value_class_encoder.py | 4 ++++ appwrite/enums/message_priority.py | 5 +++++ appwrite/enums/runtime.py | 1 + appwrite/services/messaging.py | 16 ++++++++-------- docs/examples/messaging/create-push.md | 11 +++++++---- docs/examples/messaging/update-push.md | 5 ++++- setup.py | 4 ++-- 9 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 appwrite/enums/message_priority.py diff --git a/README.md b/README.md index eb42d99..466c7ac 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index ff48812..f745945 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/7.0.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/6.2.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '7.0.1', + 'x-sdk-version': '6.2.0', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py index f343add..95b06b7 100644 --- a/appwrite/encoders/value_class_encoder.py +++ b/appwrite/encoders/value_class_encoder.py @@ -11,6 +11,7 @@ from ..enums.runtime import Runtime from ..enums.execution_method import ExecutionMethod from ..enums.name import Name +from ..enums.message_priority import MessagePriority from ..enums.smtp_encryption import SmtpEncryption from ..enums.compression import Compression from ..enums.image_gravity import ImageGravity @@ -56,6 +57,9 @@ def default(self, o): if isinstance(o, Name): return o.value + if isinstance(o, MessagePriority): + return o.value + if isinstance(o, SmtpEncryption): return o.value diff --git a/appwrite/enums/message_priority.py b/appwrite/enums/message_priority.py new file mode 100644 index 0000000..0010a35 --- /dev/null +++ b/appwrite/enums/message_priority.py @@ -0,0 +1,5 @@ +from enum import Enum + +class MessagePriority(Enum): + NORMAL = "normal" + HIGH = "high" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index db428ef..1485f48 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -59,3 +59,4 @@ class Runtime(Enum): BUN_1_1 = "bun-1.1" GO_1_23 = "go-1.23" STATIC_1 = "static-1" + FLUTTER_3_24 = "flutter-3.24" diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 11e73be..f8ce3bf 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -80,7 +80,7 @@ def update_email(self, message_id, topics = None, users = None, targets = None, 'content-type': 'application/json', }, api_params) - def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): + def create_push(self, message_id, title = None, body = None, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None, content_available = None, critical = None, priority = None): """Create push notification""" @@ -89,12 +89,6 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ if message_id is None: raise AppwriteException('Missing required parameter: "message_id"') - if title is None: - raise AppwriteException('Missing required parameter: "title"') - - if body is None: - raise AppwriteException('Missing required parameter: "body"') - api_params['messageId'] = message_id api_params['title'] = title @@ -112,12 +106,15 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ api_params['badge'] = badge api_params['draft'] = draft api_params['scheduledAt'] = scheduled_at + api_params['contentAvailable'] = content_available + api_params['critical'] = critical + api_params['priority'] = priority return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None): + def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None, content_available = None, critical = None, priority = None): """Update push notification""" @@ -143,6 +140,9 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t api_params['badge'] = badge api_params['draft'] = draft api_params['scheduledAt'] = scheduled_at + api_params['contentAvailable'] = content_available + api_params['critical'] = critical + api_params['priority'] = priority return self.client.call('patch', api_path, { 'content-type': 'application/json', diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index ffed825..616b945 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -9,8 +9,8 @@ messaging = Messaging(client) result = messaging.create_push( message_id = '<MESSAGE_ID>', - title = '<TITLE>', - body = '<BODY>', + title = '<TITLE>', # optional + body = '<BODY>', # optional topics = [], # optional users = [], # optional targets = [], # optional @@ -21,7 +21,10 @@ result = messaging.create_push( sound = '<SOUND>', # optional color = '<COLOR>', # optional tag = '<TAG>', # optional - badge = '<BADGE>', # optional + badge = None, # optional draft = False, # optional - scheduled_at = '' # optional + scheduled_at = '', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional ) diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 3c3965c..f5bdf15 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -23,5 +23,8 @@ result = messaging.update_push( tag = '<TAG>', # optional badge = None, # optional draft = False, # optional - scheduled_at = '' # optional + scheduled_at = '', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional ) diff --git a/setup.py b/setup.py index 4e43800..6fd72cd 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '7.0.1', + version = '6.2.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/7.0.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/6.2.0.tar.gz', install_requires=[ 'requests', ], From 5e6334463865c42de8dc258e91f801cd262b84e8 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Wed, 22 Jan 2025 00:41:26 +1300 Subject: [PATCH 37/60] Fix version --- LICENSE | 2 +- appwrite/client.py | 4 ++-- docs/examples/account/create-anonymous-session.md | 1 + docs/examples/account/create-email-password-session.md | 1 + docs/examples/account/create-email-token.md | 1 + docs/examples/account/create-j-w-t.md | 1 + docs/examples/account/create-magic-u-r-l-token.md | 1 + docs/examples/account/create-mfa-authenticator.md | 1 + docs/examples/account/create-mfa-challenge.md | 1 + docs/examples/account/create-mfa-recovery-codes.md | 1 + docs/examples/account/create-o-auth2token.md | 1 + docs/examples/account/create-phone-token.md | 1 + docs/examples/account/create-phone-verification.md | 1 + docs/examples/account/create-recovery.md | 1 + docs/examples/account/create-session.md | 1 + docs/examples/account/create-verification.md | 1 + docs/examples/account/create.md | 1 + docs/examples/account/delete-identity.md | 1 + docs/examples/account/delete-mfa-authenticator.md | 1 + docs/examples/account/delete-session.md | 1 + docs/examples/account/delete-sessions.md | 1 + docs/examples/account/get-mfa-recovery-codes.md | 1 + docs/examples/account/get-prefs.md | 1 + docs/examples/account/get-session.md | 1 + docs/examples/account/get.md | 1 + docs/examples/account/list-identities.md | 1 + docs/examples/account/list-logs.md | 1 + docs/examples/account/list-mfa-factors.md | 1 + docs/examples/account/list-sessions.md | 1 + docs/examples/account/update-email.md | 1 + docs/examples/account/update-m-f-a.md | 1 + docs/examples/account/update-magic-u-r-l-session.md | 1 + docs/examples/account/update-mfa-authenticator.md | 1 + docs/examples/account/update-mfa-challenge.md | 1 + docs/examples/account/update-mfa-recovery-codes.md | 1 + docs/examples/account/update-name.md | 1 + docs/examples/account/update-password.md | 1 + docs/examples/account/update-phone-session.md | 1 + docs/examples/account/update-phone-verification.md | 1 + docs/examples/account/update-phone.md | 1 + docs/examples/account/update-prefs.md | 1 + docs/examples/account/update-recovery.md | 1 + docs/examples/account/update-session.md | 1 + docs/examples/account/update-status.md | 1 + docs/examples/account/update-verification.md | 1 + docs/examples/avatars/get-browser.md | 1 + docs/examples/avatars/get-credit-card.md | 1 + docs/examples/avatars/get-favicon.md | 1 + docs/examples/avatars/get-flag.md | 1 + docs/examples/avatars/get-image.md | 1 + docs/examples/avatars/get-initials.md | 1 + docs/examples/avatars/get-q-r.md | 1 + docs/examples/databases/create-boolean-attribute.md | 1 + docs/examples/databases/create-collection.md | 1 + docs/examples/databases/create-datetime-attribute.md | 1 + docs/examples/databases/create-document.md | 1 + docs/examples/databases/create-email-attribute.md | 1 + docs/examples/databases/create-enum-attribute.md | 1 + docs/examples/databases/create-float-attribute.md | 1 + docs/examples/databases/create-index.md | 1 + docs/examples/databases/create-integer-attribute.md | 1 + docs/examples/databases/create-ip-attribute.md | 1 + docs/examples/databases/create-relationship-attribute.md | 1 + docs/examples/databases/create-string-attribute.md | 1 + docs/examples/databases/create-url-attribute.md | 1 + docs/examples/databases/create.md | 1 + docs/examples/databases/delete-attribute.md | 1 + docs/examples/databases/delete-collection.md | 1 + docs/examples/databases/delete-document.md | 1 + docs/examples/databases/delete-index.md | 1 + docs/examples/databases/delete.md | 1 + docs/examples/databases/get-attribute.md | 1 + docs/examples/databases/get-collection.md | 1 + docs/examples/databases/get-document.md | 1 + docs/examples/databases/get-index.md | 1 + docs/examples/databases/get.md | 1 + docs/examples/databases/list-attributes.md | 1 + docs/examples/databases/list-collections.md | 1 + docs/examples/databases/list-documents.md | 1 + docs/examples/databases/list-indexes.md | 1 + docs/examples/databases/list.md | 1 + docs/examples/databases/update-boolean-attribute.md | 1 + docs/examples/databases/update-collection.md | 1 + docs/examples/databases/update-datetime-attribute.md | 1 + docs/examples/databases/update-document.md | 1 + docs/examples/databases/update-email-attribute.md | 1 + docs/examples/databases/update-enum-attribute.md | 1 + docs/examples/databases/update-float-attribute.md | 1 + docs/examples/databases/update-integer-attribute.md | 1 + docs/examples/databases/update-ip-attribute.md | 1 + docs/examples/databases/update-relationship-attribute.md | 1 + docs/examples/databases/update-string-attribute.md | 1 + docs/examples/databases/update-url-attribute.md | 1 + docs/examples/databases/update.md | 1 + docs/examples/functions/create-build.md | 1 + docs/examples/functions/create-deployment.md | 1 + docs/examples/functions/create-execution.md | 1 + docs/examples/functions/create-variable.md | 1 + docs/examples/functions/create.md | 1 + docs/examples/functions/delete-deployment.md | 1 + docs/examples/functions/delete-execution.md | 1 + docs/examples/functions/delete-variable.md | 1 + docs/examples/functions/delete.md | 1 + docs/examples/functions/get-deployment-download.md | 1 + docs/examples/functions/get-deployment.md | 1 + docs/examples/functions/get-execution.md | 1 + docs/examples/functions/get-variable.md | 1 + docs/examples/functions/get.md | 1 + docs/examples/functions/list-deployments.md | 1 + docs/examples/functions/list-executions.md | 1 + docs/examples/functions/list-runtimes.md | 1 + docs/examples/functions/list-specifications.md | 1 + docs/examples/functions/list-variables.md | 1 + docs/examples/functions/list.md | 1 + docs/examples/functions/update-deployment-build.md | 1 + docs/examples/functions/update-deployment.md | 1 + docs/examples/functions/update-variable.md | 1 + docs/examples/functions/update.md | 1 + docs/examples/graphql/mutation.md | 1 + docs/examples/graphql/query.md | 1 + docs/examples/health/get-antivirus.md | 1 + docs/examples/health/get-cache.md | 1 + docs/examples/health/get-certificate.md | 1 + docs/examples/health/get-d-b.md | 1 + docs/examples/health/get-failed-jobs.md | 1 + docs/examples/health/get-pub-sub.md | 1 + docs/examples/health/get-queue-builds.md | 1 + docs/examples/health/get-queue-certificates.md | 1 + docs/examples/health/get-queue-databases.md | 1 + docs/examples/health/get-queue-deletes.md | 1 + docs/examples/health/get-queue-functions.md | 1 + docs/examples/health/get-queue-logs.md | 1 + docs/examples/health/get-queue-mails.md | 1 + docs/examples/health/get-queue-messaging.md | 1 + docs/examples/health/get-queue-migrations.md | 1 + docs/examples/health/get-queue-usage-dump.md | 1 + docs/examples/health/get-queue-usage.md | 1 + docs/examples/health/get-queue-webhooks.md | 1 + docs/examples/health/get-queue.md | 1 + docs/examples/health/get-storage-local.md | 1 + docs/examples/health/get-storage.md | 1 + docs/examples/health/get-time.md | 1 + docs/examples/health/get.md | 1 + docs/examples/locale/get.md | 1 + docs/examples/locale/list-codes.md | 1 + docs/examples/locale/list-continents.md | 1 + docs/examples/locale/list-countries-e-u.md | 1 + docs/examples/locale/list-countries-phones.md | 1 + docs/examples/locale/list-countries.md | 1 + docs/examples/locale/list-currencies.md | 1 + docs/examples/locale/list-languages.md | 1 + docs/examples/messaging/create-apns-provider.md | 1 + docs/examples/messaging/create-email.md | 1 + docs/examples/messaging/create-fcm-provider.md | 1 + docs/examples/messaging/create-mailgun-provider.md | 1 + docs/examples/messaging/create-msg91provider.md | 1 + docs/examples/messaging/create-push.md | 1 + docs/examples/messaging/create-sendgrid-provider.md | 1 + docs/examples/messaging/create-sms.md | 1 + docs/examples/messaging/create-smtp-provider.md | 1 + docs/examples/messaging/create-subscriber.md | 1 + docs/examples/messaging/create-telesign-provider.md | 1 + docs/examples/messaging/create-textmagic-provider.md | 1 + docs/examples/messaging/create-topic.md | 1 + docs/examples/messaging/create-twilio-provider.md | 1 + docs/examples/messaging/create-vonage-provider.md | 1 + docs/examples/messaging/delete-provider.md | 1 + docs/examples/messaging/delete-subscriber.md | 1 + docs/examples/messaging/delete-topic.md | 1 + docs/examples/messaging/delete.md | 1 + docs/examples/messaging/get-message.md | 1 + docs/examples/messaging/get-provider.md | 1 + docs/examples/messaging/get-subscriber.md | 1 + docs/examples/messaging/get-topic.md | 1 + docs/examples/messaging/list-message-logs.md | 1 + docs/examples/messaging/list-messages.md | 1 + docs/examples/messaging/list-provider-logs.md | 1 + docs/examples/messaging/list-providers.md | 1 + docs/examples/messaging/list-subscriber-logs.md | 1 + docs/examples/messaging/list-subscribers.md | 1 + docs/examples/messaging/list-targets.md | 1 + docs/examples/messaging/list-topic-logs.md | 1 + docs/examples/messaging/list-topics.md | 1 + docs/examples/messaging/update-apns-provider.md | 1 + docs/examples/messaging/update-email.md | 1 + docs/examples/messaging/update-fcm-provider.md | 1 + docs/examples/messaging/update-mailgun-provider.md | 1 + docs/examples/messaging/update-msg91provider.md | 1 + docs/examples/messaging/update-push.md | 1 + docs/examples/messaging/update-sendgrid-provider.md | 1 + docs/examples/messaging/update-sms.md | 1 + docs/examples/messaging/update-smtp-provider.md | 1 + docs/examples/messaging/update-telesign-provider.md | 1 + docs/examples/messaging/update-textmagic-provider.md | 1 + docs/examples/messaging/update-topic.md | 1 + docs/examples/messaging/update-twilio-provider.md | 1 + docs/examples/messaging/update-vonage-provider.md | 1 + docs/examples/storage/create-bucket.md | 1 + docs/examples/storage/create-file.md | 1 + docs/examples/storage/delete-bucket.md | 1 + docs/examples/storage/delete-file.md | 1 + docs/examples/storage/get-bucket.md | 1 + docs/examples/storage/get-file-download.md | 1 + docs/examples/storage/get-file-preview.md | 1 + docs/examples/storage/get-file-view.md | 1 + docs/examples/storage/get-file.md | 1 + docs/examples/storage/list-buckets.md | 1 + docs/examples/storage/list-files.md | 1 + docs/examples/storage/update-bucket.md | 1 + docs/examples/storage/update-file.md | 1 + docs/examples/teams/create-membership.md | 1 + docs/examples/teams/create.md | 1 + docs/examples/teams/delete-membership.md | 1 + docs/examples/teams/delete.md | 1 + docs/examples/teams/get-membership.md | 1 + docs/examples/teams/get-prefs.md | 1 + docs/examples/teams/get.md | 1 + docs/examples/teams/list-memberships.md | 1 + docs/examples/teams/list.md | 1 + docs/examples/teams/update-membership-status.md | 1 + docs/examples/teams/update-membership.md | 1 + docs/examples/teams/update-name.md | 1 + docs/examples/teams/update-prefs.md | 1 + docs/examples/users/create-argon2user.md | 1 + docs/examples/users/create-bcrypt-user.md | 1 + docs/examples/users/create-j-w-t.md | 1 + docs/examples/users/create-m-d5user.md | 1 + docs/examples/users/create-mfa-recovery-codes.md | 1 + docs/examples/users/create-p-h-pass-user.md | 1 + docs/examples/users/create-s-h-a-user.md | 1 + docs/examples/users/create-scrypt-modified-user.md | 1 + docs/examples/users/create-scrypt-user.md | 1 + docs/examples/users/create-session.md | 1 + docs/examples/users/create-target.md | 1 + docs/examples/users/create-token.md | 1 + docs/examples/users/create.md | 1 + docs/examples/users/delete-identity.md | 1 + docs/examples/users/delete-mfa-authenticator.md | 1 + docs/examples/users/delete-session.md | 1 + docs/examples/users/delete-sessions.md | 1 + docs/examples/users/delete-target.md | 1 + docs/examples/users/delete.md | 1 + docs/examples/users/get-mfa-recovery-codes.md | 1 + docs/examples/users/get-prefs.md | 1 + docs/examples/users/get-target.md | 1 + docs/examples/users/get.md | 1 + docs/examples/users/list-identities.md | 1 + docs/examples/users/list-logs.md | 1 + docs/examples/users/list-memberships.md | 1 + docs/examples/users/list-mfa-factors.md | 1 + docs/examples/users/list-sessions.md | 1 + docs/examples/users/list-targets.md | 1 + docs/examples/users/list.md | 1 + docs/examples/users/update-email-verification.md | 1 + docs/examples/users/update-email.md | 1 + docs/examples/users/update-labels.md | 1 + docs/examples/users/update-mfa-recovery-codes.md | 1 + docs/examples/users/update-mfa.md | 1 + docs/examples/users/update-name.md | 1 + docs/examples/users/update-password.md | 1 + docs/examples/users/update-phone-verification.md | 1 + docs/examples/users/update-phone.md | 1 + docs/examples/users/update-prefs.md | 1 + docs/examples/users/update-status.md | 1 + docs/examples/users/update-target.md | 1 + setup.py | 4 ++-- 266 files changed, 268 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 5479bb8..c1602fc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors. +Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/appwrite/client.py b/appwrite/client.py index f745945..1b908d1 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/6.2.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/7.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '6.2.0', + 'x-sdk-version': '7.1.0', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 36ed47d..ce5a92a 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index b85cc3d..5e869fd 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 4c18324..5cf2bfb 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 2121514..c737f1b 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index c015418..0077817 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 16a8e2e..a6f09eb 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 017fdd2..deb4c9c 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticationFactor client = Client() diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 452b47f..a149cb9 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 0cc89df..fa11d31 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import OAuthProvider client = Client() diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 30c80df..d242d71 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index fd0a262..bb2058e 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e9613cd..3d215a4 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index d129e10..d00e8cb 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 5ff238f..329d19e 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 33b6f3f..39b33c6 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index ef57289..3556122 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 0fbe8c7..939ea71 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index fa0049c..9ddb443 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 6ebe286..751ab9b 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index ec70595..f70b968 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 67d0741..52df645 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index f7ae72d..f38466f 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 9ded8e9..b414047 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index c51da2c..4bf9beb 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 750f977..5d8c27a 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 2220475..ba3796b 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index b3427c0..7473313 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index b0a2a16..004d071 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 561e7cc..2f9321c 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index f6b69b0..ca8e8e5 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 42b91f1..a5a9519 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 5964df4..d28a251 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 4f0b136..38cb41c 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index d0027a8..9b4bf82 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 888349e..ecb4228 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 404d2b4..d29ab28 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 41ceb4b..e64d79f 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index b7414e6..65a6a38 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index f69dc12..c368300 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index a331413..2493dc5 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 3768326..ee3a2f7 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 4f9add8..c8318a4 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 35faf53..63a7f26 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 91dde3b..7ed8318 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import Browser client = Client() diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index cec2f61..aa66b86 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import CreditCard client = Client() diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 4aa0177..2c6a67e 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 6b12dac..435c855 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import Flag client = Client() diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 202955c..ee9e0cb 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 233da1b..edcbbb3 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 1296394..7f6da32 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 183a2b6..2b4209d 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index fd9e3a6..99c44a2 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 7435742..db81c02 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index bd3993f..22f2c07 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index f4b427e..2e28e0b 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index dce6355..b1efdc7 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index a658bd8..b36863b 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 015b762..9885c06 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases from appwrite.enums import IndexType client = Client() diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 9f409e4..8cb140a 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index ab4d357..d4b4ab6 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 76b5db1..4172c27 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases from appwrite.enums import RelationshipType client = Client() diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index d6f7f94..e696871 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 3b105d8..4ad03c4 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index a4ddc92..d5cbb99 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 7f490b2..b317ba9 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index c3083a5..ab274c6 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index c3e296a..69151aa 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index d5a12c1..2ed0165 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 41d5f18..e7e988a 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index e505fe9..a717552 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 7be57ea..f63298e 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 83faade..acdc25d 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 6038868..ca5a995 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 8fe2358..deadf6a 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index a29aefa..245ec60 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 0e61332..ca18267 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index dee130e..41f0380 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 40578a1..bf18bd1 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index aa934b2..11669b3 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 553d94b..c9300ea 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 3432b6b..d929728 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index f9056d2..96c7fb5 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 07bba76..7b9cce9 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 45a8d0d..5b042d4 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index c07f375..caa1b4e 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index fa1767e..8f8a35a 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 0db9707..125cf82 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 135dbd8..a2b8bad 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index bc528f1..0aacc13 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index ab910d9..c85eb25 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 8e3a28d..53da6ae 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 765f28a..da59776 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index c4eb9d0..ce2ffb7 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index da9b559..c86fdf6 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions from appwrite.input_file import InputFile client = Client() diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index e1decb9..cb3fddd 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index cd73e30..101ecdf 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index a65b87d..f10a953 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions from appwrite.enums import client = Client() diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 780ce9d..f98bd60 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 7c3ea09..b723fd6 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 646a0f3..e17afed 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 2950ed0..a34d476 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 490d952..90f029a 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 8846888..0617b04 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index f3dfc0f..0a9a347 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index fd903f3..174c8b2 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index cb765e4..a463fa6 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index f776345..4d8feea 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 0012baf..293bab0 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index edad1a9..b624733 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index a9c7417..5e1ec7f 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 188c17b..ee1a516 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 5b315e1..0b5f18d 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md index a8d93b8..c69cd7c 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-build.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 9fce384..0f4c96e 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 238fc91..bcab368 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 5f2a70b..a728241 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 0ec3d3e..e05f602 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.graphql import Graphql client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 95709fd..c8f3c78 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.graphql import Graphql client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index ff93cea..7bc0475 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index fa2a6da..7e69825 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 2a73583..f6a713e 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 18e3968..a23a073 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index ce33c8c..d0fe64f 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health from appwrite.enums import client = Client() diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index db66c7f..109b288 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 9daed58..b1d4d62 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index a7d35bc..99f52b8 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 50f8943..7d5e5a0 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index b6e6a4d..d677af5 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 5868b3c..3ffc4b8 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 254fe23..0cb6417 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index c6ab409..97a501c 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 1007913..ea93eab 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index db59028..09e35df 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-usage-dump.md index cc31b4f..dabb79a 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-usage-dump.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 67d9e64..dbee75f 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 9188467..1072a20 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 61e5a40..aafe7c7 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 276c305..d3b94b2 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index b2de63b..65af2f9 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 4089305..d63beb9 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index f41e0e3..f5c494e 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index fc048dd..a44f497 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index d516538..12cd12e 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index f6d8495..ea4ac53 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 8bdac2e..7fb6aaa 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 516d822..aafdb3d 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 8fcbe1a..a2f1ec4 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 4708498..39267c6 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 9583cd8..6dec1b9 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 022209d..700e909 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 38005a3..92353e2 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 84c38ea..d13ba02 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index fa94da9..8389971 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 0cffc4e..117c46e 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 616b945..d405185 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 6e9b812..5d20cde 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index c3e7fe7..c7e66d8 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 24108d2..85c5823 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 81b0c5f..cb8f4f7 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index b06033c..b602213 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 6dc1030..03287e8 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index b0184b5..4dd16da 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index c73e941..524348f 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index cfee0ad..68416bd 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 4d2bd6d..2a1840d 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 5d404d1..94085ef 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index b270b2a..1c2f563 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index c62c8c0..aee928a 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 4b4ef39..9e32d80 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index fdf94f0..6bc85f2 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 7f8284f..43185d7 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 57c465b..dea6cbf 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 752e449..1c2ab0b 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 7219f09..8457f99 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 148814c..c8544fa 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 3e89695..258e7cd 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 7efaead..d2049bd 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index fe2442d..ba9e09d 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 0622571..b941ccb 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index de72a76..57ba7f8 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 1379708..cb21567 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 2bfd3ed..3f0205d 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 6cff0ae..b8f9d71 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 7ca9f38..862e579 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index a89338d..aa1d4e9 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 4c61950..2d4efdb 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index f5bdf15..1266353 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 8b67b7a..e528bd5 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index aadbd9a..7cb0087 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 74232e9..2d798d4 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 2649281..91de1f1 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index bbe4a93..c303104 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index ee4d004..160ac26 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 52eed3b..865fcb5 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 7cb1594..8e01128 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index c6e9e33..7e321f1 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index d275070..fa0b117 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage from appwrite.input_file import InputFile client = Client() diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 77d72eb..8cddfb9 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 775065d..08bba5c 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index adb78e8..79f903f 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index b419ea0..1a82b26 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 2e3b2ac..40f32f1 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 9ce04e2..3947c76 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 9f04ef4..0c2d5e3 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 84eab54..88540cd 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 8a2aa6d..e26ac2e 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 4eea2a9..61388b0 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 0137af5..336e8a0 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 4846295..1af9f25 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 544ee3a..7085d39 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 7f0cbd4..adf065c 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index fc84152..762f532 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 6075cc7..17bacff 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index d740e69..035777d 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 6d44b80..985924e 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index f7a072a..885a4c2 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index afb5de1..c92d4c9 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index ee6d211..ae6e524 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 6726150..c50f345 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 693654d..d25c8db 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 4661601..9eca847 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 575aa42..3d65496 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index f6cd2fe..76532a9 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index a758d4e..2e1fdf6 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index cabf875..da9d471 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 606878f..a4477b0 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 0d8f990..363be4f 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index b0ae799..bb78ff7 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index d7d17c4..1cfbcfc 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 507fb1f..2d1e72b 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index a2ba12a..bebd46b 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 9ad8364..c11c7ca 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users from appwrite.enums import MessagingProviderType client = Client() diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index e2ef2f6..00a0e78 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index c3e7fd5..c8dac9f 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 4c78038..85c5b6d 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index c7101d1..b22d391 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index c0fabdb..dda5713 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 328a9ee..268c311 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 5c2d9df..38cc5a9 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index de8b35b..090c20f 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index b37739c..ec9986c 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 23109a9..eb14d3a 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index d494460..f549f08 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index d7dda45..6e018c2 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 7764d74..b10c320 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index d1c6b0a..10d8ae0 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 27db71f..fbb3b4c 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 39aed0c..1f40b1f 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index fd091b9..a9eead0 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index b5b67b9..4766646 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index b191f8a..4b09ca5 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 72ddf7a..4623bc3 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index c977d95..083715b 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 04c3999..24c5b27 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index ca3b96a..d0e4da4 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index e145f9b..efd6730 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index d546b95..6014ef5 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 0c7e7bf..90ac15f 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index b13c4fb..a62e6a8 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index ecb0172..f522730 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index ca6999c..64d9df3 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index ebec495..8943ef5 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index f9bdfb4..8951385 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/setup.py b/setup.py index 6fd72cd..e349204 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '6.2.0', + version = '7.1.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/6.2.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/7.1.0.tar.gz', install_requires=[ 'requests', ], From dd80f677347edc175f8d65c5fca5d11d6a2525ec Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:30:01 +0000 Subject: [PATCH 38/60] fix: pong response & chunked upload --- LICENSE | 2 +- appwrite/client.py | 28 +++++++++---------- appwrite/enums/image_format.py | 1 + .../account/create-anonymous-session.md | 1 + .../account/create-email-password-session.md | 1 + docs/examples/account/create-email-token.md | 1 + docs/examples/account/create-j-w-t.md | 1 + .../account/create-magic-u-r-l-token.md | 1 + .../account/create-mfa-authenticator.md | 1 + docs/examples/account/create-mfa-challenge.md | 1 + .../account/create-mfa-recovery-codes.md | 1 + docs/examples/account/create-o-auth2token.md | 1 + docs/examples/account/create-phone-token.md | 1 + .../account/create-phone-verification.md | 1 + docs/examples/account/create-recovery.md | 1 + docs/examples/account/create-session.md | 1 + docs/examples/account/create-verification.md | 1 + docs/examples/account/create.md | 1 + docs/examples/account/delete-identity.md | 1 + .../account/delete-mfa-authenticator.md | 1 + docs/examples/account/delete-session.md | 1 + docs/examples/account/delete-sessions.md | 1 + .../account/get-mfa-recovery-codes.md | 1 + docs/examples/account/get-prefs.md | 1 + docs/examples/account/get-session.md | 1 + docs/examples/account/get.md | 1 + docs/examples/account/list-identities.md | 1 + docs/examples/account/list-logs.md | 1 + docs/examples/account/list-mfa-factors.md | 1 + docs/examples/account/list-sessions.md | 1 + docs/examples/account/update-email.md | 1 + docs/examples/account/update-m-f-a.md | 1 + .../account/update-magic-u-r-l-session.md | 1 + .../account/update-mfa-authenticator.md | 1 + docs/examples/account/update-mfa-challenge.md | 1 + .../account/update-mfa-recovery-codes.md | 1 + docs/examples/account/update-name.md | 1 + docs/examples/account/update-password.md | 1 + docs/examples/account/update-phone-session.md | 1 + .../account/update-phone-verification.md | 1 + docs/examples/account/update-phone.md | 1 + docs/examples/account/update-prefs.md | 1 + docs/examples/account/update-recovery.md | 1 + docs/examples/account/update-session.md | 1 + docs/examples/account/update-status.md | 1 + docs/examples/account/update-verification.md | 1 + docs/examples/avatars/get-browser.md | 1 + docs/examples/avatars/get-credit-card.md | 1 + docs/examples/avatars/get-favicon.md | 1 + docs/examples/avatars/get-flag.md | 1 + docs/examples/avatars/get-image.md | 1 + docs/examples/avatars/get-initials.md | 1 + docs/examples/avatars/get-q-r.md | 1 + .../databases/create-boolean-attribute.md | 1 + docs/examples/databases/create-collection.md | 1 + .../databases/create-datetime-attribute.md | 1 + docs/examples/databases/create-document.md | 1 + .../databases/create-email-attribute.md | 1 + .../databases/create-enum-attribute.md | 1 + .../databases/create-float-attribute.md | 1 + docs/examples/databases/create-index.md | 1 + .../databases/create-integer-attribute.md | 1 + .../examples/databases/create-ip-attribute.md | 1 + .../create-relationship-attribute.md | 1 + .../databases/create-string-attribute.md | 1 + .../databases/create-url-attribute.md | 1 + docs/examples/databases/create.md | 1 + docs/examples/databases/delete-attribute.md | 1 + docs/examples/databases/delete-collection.md | 1 + docs/examples/databases/delete-document.md | 1 + docs/examples/databases/delete-index.md | 1 + docs/examples/databases/delete.md | 1 + docs/examples/databases/get-attribute.md | 1 + docs/examples/databases/get-collection.md | 1 + docs/examples/databases/get-document.md | 1 + docs/examples/databases/get-index.md | 1 + docs/examples/databases/get.md | 1 + docs/examples/databases/list-attributes.md | 1 + docs/examples/databases/list-collections.md | 1 + docs/examples/databases/list-documents.md | 1 + docs/examples/databases/list-indexes.md | 1 + docs/examples/databases/list.md | 1 + .../databases/update-boolean-attribute.md | 1 + docs/examples/databases/update-collection.md | 1 + .../databases/update-datetime-attribute.md | 1 + docs/examples/databases/update-document.md | 1 + .../databases/update-email-attribute.md | 1 + .../databases/update-enum-attribute.md | 1 + .../databases/update-float-attribute.md | 1 + .../databases/update-integer-attribute.md | 1 + .../examples/databases/update-ip-attribute.md | 1 + .../update-relationship-attribute.md | 1 + .../databases/update-string-attribute.md | 1 + .../databases/update-url-attribute.md | 1 + docs/examples/databases/update.md | 1 + docs/examples/functions/create-build.md | 1 + docs/examples/functions/create-deployment.md | 1 + docs/examples/functions/create-execution.md | 1 + docs/examples/functions/create-variable.md | 1 + docs/examples/functions/create.md | 1 + docs/examples/functions/delete-deployment.md | 1 + docs/examples/functions/delete-execution.md | 1 + docs/examples/functions/delete-variable.md | 1 + docs/examples/functions/delete.md | 1 + .../functions/get-deployment-download.md | 1 + docs/examples/functions/get-deployment.md | 1 + docs/examples/functions/get-execution.md | 1 + docs/examples/functions/get-variable.md | 1 + docs/examples/functions/get.md | 1 + docs/examples/functions/list-deployments.md | 1 + docs/examples/functions/list-executions.md | 1 + docs/examples/functions/list-runtimes.md | 1 + .../examples/functions/list-specifications.md | 1 + docs/examples/functions/list-variables.md | 1 + docs/examples/functions/list.md | 1 + .../functions/update-deployment-build.md | 1 + docs/examples/functions/update-deployment.md | 1 + docs/examples/functions/update-variable.md | 1 + docs/examples/functions/update.md | 1 + docs/examples/graphql/mutation.md | 1 + docs/examples/graphql/query.md | 1 + docs/examples/health/get-antivirus.md | 1 + docs/examples/health/get-cache.md | 1 + docs/examples/health/get-certificate.md | 1 + docs/examples/health/get-d-b.md | 1 + docs/examples/health/get-failed-jobs.md | 1 + docs/examples/health/get-pub-sub.md | 1 + docs/examples/health/get-queue-builds.md | 1 + .../examples/health/get-queue-certificates.md | 1 + docs/examples/health/get-queue-databases.md | 1 + docs/examples/health/get-queue-deletes.md | 1 + docs/examples/health/get-queue-functions.md | 1 + docs/examples/health/get-queue-logs.md | 1 + docs/examples/health/get-queue-mails.md | 1 + docs/examples/health/get-queue-messaging.md | 1 + docs/examples/health/get-queue-migrations.md | 1 + docs/examples/health/get-queue-usage-dump.md | 1 + docs/examples/health/get-queue-usage.md | 1 + docs/examples/health/get-queue-webhooks.md | 1 + docs/examples/health/get-queue.md | 1 + docs/examples/health/get-storage-local.md | 1 + docs/examples/health/get-storage.md | 1 + docs/examples/health/get-time.md | 1 + docs/examples/health/get.md | 1 + docs/examples/locale/get.md | 1 + docs/examples/locale/list-codes.md | 1 + docs/examples/locale/list-continents.md | 1 + docs/examples/locale/list-countries-e-u.md | 1 + docs/examples/locale/list-countries-phones.md | 1 + docs/examples/locale/list-countries.md | 1 + docs/examples/locale/list-currencies.md | 1 + docs/examples/locale/list-languages.md | 1 + .../messaging/create-apns-provider.md | 1 + docs/examples/messaging/create-email.md | 1 + .../examples/messaging/create-fcm-provider.md | 1 + .../messaging/create-mailgun-provider.md | 1 + .../messaging/create-msg91provider.md | 1 + docs/examples/messaging/create-push.md | 1 + .../messaging/create-sendgrid-provider.md | 1 + docs/examples/messaging/create-sms.md | 1 + .../messaging/create-smtp-provider.md | 1 + docs/examples/messaging/create-subscriber.md | 1 + .../messaging/create-telesign-provider.md | 1 + .../messaging/create-textmagic-provider.md | 1 + docs/examples/messaging/create-topic.md | 1 + .../messaging/create-twilio-provider.md | 1 + .../messaging/create-vonage-provider.md | 1 + docs/examples/messaging/delete-provider.md | 1 + docs/examples/messaging/delete-subscriber.md | 1 + docs/examples/messaging/delete-topic.md | 1 + docs/examples/messaging/delete.md | 1 + docs/examples/messaging/get-message.md | 1 + docs/examples/messaging/get-provider.md | 1 + docs/examples/messaging/get-subscriber.md | 1 + docs/examples/messaging/get-topic.md | 1 + docs/examples/messaging/list-message-logs.md | 1 + docs/examples/messaging/list-messages.md | 1 + docs/examples/messaging/list-provider-logs.md | 1 + docs/examples/messaging/list-providers.md | 1 + .../messaging/list-subscriber-logs.md | 1 + docs/examples/messaging/list-subscribers.md | 1 + docs/examples/messaging/list-targets.md | 1 + docs/examples/messaging/list-topic-logs.md | 1 + docs/examples/messaging/list-topics.md | 1 + .../messaging/update-apns-provider.md | 1 + docs/examples/messaging/update-email.md | 1 + .../examples/messaging/update-fcm-provider.md | 1 + .../messaging/update-mailgun-provider.md | 1 + .../messaging/update-msg91provider.md | 1 + docs/examples/messaging/update-push.md | 1 + .../messaging/update-sendgrid-provider.md | 1 + docs/examples/messaging/update-sms.md | 1 + .../messaging/update-smtp-provider.md | 1 + .../messaging/update-telesign-provider.md | 1 + .../messaging/update-textmagic-provider.md | 1 + docs/examples/messaging/update-topic.md | 1 + .../messaging/update-twilio-provider.md | 1 + .../messaging/update-vonage-provider.md | 1 + docs/examples/storage/create-bucket.md | 1 + docs/examples/storage/create-file.md | 1 + docs/examples/storage/delete-bucket.md | 1 + docs/examples/storage/delete-file.md | 1 + docs/examples/storage/get-bucket.md | 1 + docs/examples/storage/get-file-download.md | 1 + docs/examples/storage/get-file-preview.md | 1 + docs/examples/storage/get-file-view.md | 1 + docs/examples/storage/get-file.md | 1 + docs/examples/storage/list-buckets.md | 1 + docs/examples/storage/list-files.md | 1 + docs/examples/storage/update-bucket.md | 1 + docs/examples/storage/update-file.md | 1 + docs/examples/teams/create-membership.md | 1 + docs/examples/teams/create.md | 1 + docs/examples/teams/delete-membership.md | 1 + docs/examples/teams/delete.md | 1 + docs/examples/teams/get-membership.md | 1 + docs/examples/teams/get-prefs.md | 1 + docs/examples/teams/get.md | 1 + docs/examples/teams/list-memberships.md | 1 + docs/examples/teams/list.md | 1 + .../teams/update-membership-status.md | 1 + docs/examples/teams/update-membership.md | 1 + docs/examples/teams/update-name.md | 1 + docs/examples/teams/update-prefs.md | 1 + docs/examples/users/create-argon2user.md | 1 + docs/examples/users/create-bcrypt-user.md | 1 + docs/examples/users/create-j-w-t.md | 1 + docs/examples/users/create-m-d5user.md | 1 + .../users/create-mfa-recovery-codes.md | 1 + docs/examples/users/create-p-h-pass-user.md | 1 + docs/examples/users/create-s-h-a-user.md | 1 + .../users/create-scrypt-modified-user.md | 1 + docs/examples/users/create-scrypt-user.md | 1 + docs/examples/users/create-session.md | 1 + docs/examples/users/create-target.md | 1 + docs/examples/users/create-token.md | 1 + docs/examples/users/create.md | 1 + docs/examples/users/delete-identity.md | 1 + .../users/delete-mfa-authenticator.md | 1 + docs/examples/users/delete-session.md | 1 + docs/examples/users/delete-sessions.md | 1 + docs/examples/users/delete-target.md | 1 + docs/examples/users/delete.md | 1 + docs/examples/users/get-mfa-recovery-codes.md | 1 + docs/examples/users/get-prefs.md | 1 + docs/examples/users/get-target.md | 1 + docs/examples/users/get.md | 1 + docs/examples/users/list-identities.md | 1 + docs/examples/users/list-logs.md | 1 + docs/examples/users/list-memberships.md | 1 + docs/examples/users/list-mfa-factors.md | 1 + docs/examples/users/list-sessions.md | 1 + docs/examples/users/list-targets.md | 1 + docs/examples/users/list.md | 1 + .../users/update-email-verification.md | 1 + docs/examples/users/update-email.md | 1 + docs/examples/users/update-labels.md | 1 + .../users/update-mfa-recovery-codes.md | 1 + docs/examples/users/update-mfa.md | 1 + docs/examples/users/update-name.md | 1 + docs/examples/users/update-password.md | 1 + .../users/update-phone-verification.md | 1 + docs/examples/users/update-phone.md | 1 + docs/examples/users/update-prefs.md | 1 + docs/examples/users/update-status.md | 1 + docs/examples/users/update-target.md | 1 + setup.py | 4 +-- 267 files changed, 280 insertions(+), 18 deletions(-) diff --git a/LICENSE b/LICENSE index 5479bb8..c1602fc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors. +Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/appwrite/client.py b/appwrite/client.py index f745945..b936a9d 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/6.2.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/7.1.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '6.2.0', + 'x-sdk-version': '7.1.1', 'X-Appwrite-Response-Format' : '1.6.0', } @@ -79,7 +79,7 @@ def call(self, method, path='', headers=None, params=None, response_type='json') data = {} files = {} stringify = False - + headers = {**self._global_headers, **headers} if method != 'get': @@ -170,12 +170,11 @@ def chunked_upload( offset = 0 counter = 0 - if upload_id != 'unique()': - try: - result = self.call('get', path + '/' + upload_id, headers) - counter = result['chunksUploaded'] - except: - pass + try: + result = self.call('get', path + '/' + upload_id, headers) + counter = result['chunksUploaded'] + except: + pass if counter > 0: offset = counter * self._chunk_size @@ -188,7 +187,7 @@ def chunked_upload( if offset + self._chunk_size < size: end = offset + self._chunk_size else: - end = size - offset + end = size input_file.data = input[offset:end] params[param_name] = input_file @@ -200,10 +199,10 @@ def chunked_upload( headers, params, ) - + offset = offset + self._chunk_size - - if "$id" in result: + + if "$id" in result: headers["x-appwrite-id"] = result["$id"] if on_progress is not None: @@ -229,7 +228,7 @@ def flatten(self, data, prefix='', stringify=False): finalKey = prefix + '[' + key +']' if prefix else key finalKey = prefix + '[' + str(i) +']' if isinstance(data, list) else finalKey i += 1 - + if isinstance(value, list) or isinstance(value, dict): output = {**output, **self.flatten(value, finalKey, stringify)} else: @@ -239,4 +238,3 @@ def flatten(self, data, prefix='', stringify=False): output[finalKey] = value return output - diff --git a/appwrite/enums/image_format.py b/appwrite/enums/image_format.py index d507d17..ba2f59e 100644 --- a/appwrite/enums/image_format.py +++ b/appwrite/enums/image_format.py @@ -6,4 +6,5 @@ class ImageFormat(Enum): GIF = "gif" PNG = "png" WEBP = "webp" + HEIC = "heic" AVIF = "avif" diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 36ed47d..ce5a92a 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index b85cc3d..5e869fd 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 4c18324..5cf2bfb 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 2121514..c737f1b 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index c015418..0077817 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 16a8e2e..a6f09eb 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 017fdd2..deb4c9c 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticationFactor client = Client() diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 452b47f..a149cb9 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 0cc89df..fa11d31 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import OAuthProvider client = Client() diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 30c80df..d242d71 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index fd0a262..bb2058e 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e9613cd..3d215a4 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index d129e10..d00e8cb 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 5ff238f..329d19e 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 33b6f3f..39b33c6 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index ef57289..3556122 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 0fbe8c7..939ea71 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index fa0049c..9ddb443 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 6ebe286..751ab9b 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index ec70595..f70b968 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 67d0741..52df645 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index f7ae72d..f38466f 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 9ded8e9..b414047 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index c51da2c..4bf9beb 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 750f977..5d8c27a 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 2220475..ba3796b 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index b3427c0..7473313 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index b0a2a16..004d071 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 561e7cc..2f9321c 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index f6b69b0..ca8e8e5 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 42b91f1..a5a9519 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 5964df4..d28a251 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 4f0b136..38cb41c 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index d0027a8..9b4bf82 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 888349e..ecb4228 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 404d2b4..d29ab28 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 41ceb4b..e64d79f 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index b7414e6..65a6a38 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index f69dc12..c368300 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index a331413..2493dc5 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 3768326..ee3a2f7 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 4f9add8..c8318a4 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 35faf53..63a7f26 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 91dde3b..7ed8318 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import Browser client = Client() diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index cec2f61..aa66b86 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import CreditCard client = Client() diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 4aa0177..2c6a67e 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 6b12dac..435c855 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import Flag client = Client() diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 202955c..ee9e0cb 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 233da1b..edcbbb3 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 1296394..7f6da32 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 183a2b6..2b4209d 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index fd9e3a6..99c44a2 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 7435742..db81c02 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index bd3993f..22f2c07 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index f4b427e..2e28e0b 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index dce6355..b1efdc7 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index a658bd8..b36863b 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 015b762..9885c06 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases from appwrite.enums import IndexType client = Client() diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 9f409e4..8cb140a 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index ab4d357..d4b4ab6 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 76b5db1..4172c27 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases from appwrite.enums import RelationshipType client = Client() diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index d6f7f94..e696871 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 3b105d8..4ad03c4 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index a4ddc92..d5cbb99 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 7f490b2..b317ba9 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index c3083a5..ab274c6 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index c3e296a..69151aa 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index d5a12c1..2ed0165 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 41d5f18..e7e988a 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index e505fe9..a717552 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 7be57ea..f63298e 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 83faade..acdc25d 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 6038868..ca5a995 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 8fe2358..deadf6a 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index a29aefa..245ec60 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 0e61332..ca18267 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index dee130e..41f0380 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 40578a1..bf18bd1 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index aa934b2..11669b3 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 553d94b..c9300ea 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 3432b6b..d929728 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index f9056d2..96c7fb5 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 07bba76..7b9cce9 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 45a8d0d..5b042d4 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index c07f375..caa1b4e 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index fa1767e..8f8a35a 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 0db9707..125cf82 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 135dbd8..a2b8bad 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index bc528f1..0aacc13 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index ab910d9..c85eb25 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 8e3a28d..53da6ae 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 765f28a..da59776 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index c4eb9d0..ce2ffb7 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index da9b559..c86fdf6 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions from appwrite.input_file import InputFile client = Client() diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index e1decb9..cb3fddd 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index cd73e30..101ecdf 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index a65b87d..f10a953 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions from appwrite.enums import client = Client() diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 780ce9d..f98bd60 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 7c3ea09..b723fd6 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 646a0f3..e17afed 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 2950ed0..a34d476 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 490d952..90f029a 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 8846888..0617b04 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index f3dfc0f..0a9a347 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index fd903f3..174c8b2 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index cb765e4..a463fa6 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index f776345..4d8feea 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 0012baf..293bab0 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index edad1a9..b624733 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index a9c7417..5e1ec7f 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 188c17b..ee1a516 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 5b315e1..0b5f18d 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md index a8d93b8..c69cd7c 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-build.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 9fce384..0f4c96e 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 238fc91..bcab368 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 5f2a70b..a728241 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 0ec3d3e..e05f602 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.graphql import Graphql client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 95709fd..c8f3c78 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.graphql import Graphql client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index ff93cea..7bc0475 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index fa2a6da..7e69825 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 2a73583..f6a713e 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 18e3968..a23a073 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index ce33c8c..d0fe64f 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health from appwrite.enums import client = Client() diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index db66c7f..109b288 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 9daed58..b1d4d62 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index a7d35bc..99f52b8 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 50f8943..7d5e5a0 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index b6e6a4d..d677af5 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 5868b3c..3ffc4b8 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 254fe23..0cb6417 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index c6ab409..97a501c 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 1007913..ea93eab 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index db59028..09e35df 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-usage-dump.md index cc31b4f..dabb79a 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-usage-dump.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 67d9e64..dbee75f 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 9188467..1072a20 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 61e5a40..aafe7c7 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 276c305..d3b94b2 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index b2de63b..65af2f9 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 4089305..d63beb9 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index f41e0e3..f5c494e 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index fc048dd..a44f497 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index d516538..12cd12e 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index f6d8495..ea4ac53 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 8bdac2e..7fb6aaa 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 516d822..aafdb3d 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 8fcbe1a..a2f1ec4 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 4708498..39267c6 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 9583cd8..6dec1b9 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 022209d..700e909 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 38005a3..92353e2 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 84c38ea..d13ba02 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index fa94da9..8389971 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 0cffc4e..117c46e 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 616b945..d405185 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 6e9b812..5d20cde 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index c3e7fe7..c7e66d8 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 24108d2..85c5823 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 81b0c5f..cb8f4f7 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index b06033c..b602213 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 6dc1030..03287e8 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index b0184b5..4dd16da 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index c73e941..524348f 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index cfee0ad..68416bd 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 4d2bd6d..2a1840d 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 5d404d1..94085ef 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index b270b2a..1c2f563 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index c62c8c0..aee928a 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 4b4ef39..9e32d80 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index fdf94f0..6bc85f2 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 7f8284f..43185d7 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 57c465b..dea6cbf 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 752e449..1c2ab0b 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 7219f09..8457f99 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 148814c..c8544fa 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 3e89695..258e7cd 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 7efaead..d2049bd 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index fe2442d..ba9e09d 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 0622571..b941ccb 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index de72a76..57ba7f8 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 1379708..cb21567 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 2bfd3ed..3f0205d 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 6cff0ae..b8f9d71 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 7ca9f38..862e579 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index a89338d..aa1d4e9 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 4c61950..2d4efdb 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index f5bdf15..1266353 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 8b67b7a..e528bd5 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index aadbd9a..7cb0087 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 74232e9..2d798d4 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 2649281..91de1f1 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index bbe4a93..c303104 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index ee4d004..160ac26 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 52eed3b..865fcb5 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 7cb1594..8e01128 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index c6e9e33..7e321f1 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index d275070..fa0b117 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage from appwrite.input_file import InputFile client = Client() diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 77d72eb..8cddfb9 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 775065d..08bba5c 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index adb78e8..79f903f 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index b419ea0..1a82b26 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 2e3b2ac..40f32f1 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 9ce04e2..3947c76 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 9f04ef4..0c2d5e3 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 84eab54..88540cd 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 8a2aa6d..e26ac2e 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 4eea2a9..61388b0 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 0137af5..336e8a0 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 4846295..1af9f25 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 544ee3a..7085d39 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 7f0cbd4..adf065c 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index fc84152..762f532 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 6075cc7..17bacff 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index d740e69..035777d 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 6d44b80..985924e 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index f7a072a..885a4c2 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index afb5de1..c92d4c9 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index ee6d211..ae6e524 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 6726150..c50f345 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 693654d..d25c8db 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 4661601..9eca847 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 575aa42..3d65496 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index f6cd2fe..76532a9 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index a758d4e..2e1fdf6 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index cabf875..da9d471 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 606878f..a4477b0 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 0d8f990..363be4f 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index b0ae799..bb78ff7 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index d7d17c4..1cfbcfc 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 507fb1f..2d1e72b 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index a2ba12a..bebd46b 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 9ad8364..c11c7ca 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users from appwrite.enums import MessagingProviderType client = Client() diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index e2ef2f6..00a0e78 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index c3e7fd5..c8dac9f 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 4c78038..85c5b6d 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index c7101d1..b22d391 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index c0fabdb..dda5713 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 328a9ee..268c311 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 5c2d9df..38cc5a9 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index de8b35b..090c20f 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index b37739c..ec9986c 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 23109a9..eb14d3a 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index d494460..f549f08 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index d7dda45..6e018c2 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 7764d74..b10c320 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index d1c6b0a..10d8ae0 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 27db71f..fbb3b4c 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 39aed0c..1f40b1f 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index fd091b9..a9eead0 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index b5b67b9..4766646 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index b191f8a..4b09ca5 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 72ddf7a..4623bc3 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index c977d95..083715b 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 04c3999..24c5b27 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index ca3b96a..d0e4da4 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index e145f9b..efd6730 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index d546b95..6014ef5 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 0c7e7bf..90ac15f 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index b13c4fb..a62e6a8 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index ecb0172..f522730 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index ca6999c..64d9df3 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index ebec495..8943ef5 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index f9bdfb4..8951385 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/setup.py b/setup.py index 6fd72cd..e81ec0f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '6.2.0', + version = '7.1.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/6.2.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/7.1.1.tar.gz', install_requires=[ 'requests', ], From 7123fc3a66f77d99325d651ae78f5b49a2405584 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Wed, 29 Jan 2025 08:04:10 +0000 Subject: [PATCH 39/60] chore: bump versions --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index b936a9d..be73fb8 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/7.1.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/8.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '7.1.1', + 'x-sdk-version': '8.0.0', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/setup.py b/setup.py index e81ec0f..489adec 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '7.1.1', + version = '8.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/7.1.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/8.0.0.tar.gz', install_requires=[ 'requests', ], From fdbd19f9940e828f9eba78269ef32adb48a00289 Mon Sep 17 00:00:00 2001 From: Christy Jacob <christyjacob4@gmail.com> Date: Mon, 10 Mar 2025 10:27:51 +0000 Subject: [PATCH 40/60] feat: add types to parameters --- appwrite/client.py | 8 +- appwrite/enums/credit_card.py | 1 + appwrite/enums/name.py | 5 +- appwrite/services/account.py | 151 ++++---------- appwrite/services/avatars.py | 31 +-- appwrite/services/databases.py | 183 +++++------------ appwrite/services/functions.py | 95 +++------ appwrite/services/graphql.py | 8 +- appwrite/services/health.py | 99 +++------- appwrite/services/locale.py | 16 -- appwrite/services/messaging.py | 186 +++++------------- appwrite/services/storage.py | 56 ++---- appwrite/services/teams.py | 52 ++--- appwrite/services/users.py | 171 +++++----------- .../databases/update-float-attribute.md | 4 +- .../databases/update-integer-attribute.md | 4 +- ...e-dump.md => get-queue-stats-resources.md} | 2 +- ...queue.md => get-queue-stats-usage-dump.md} | 4 +- setup.py | 4 +- 19 files changed, 285 insertions(+), 795 deletions(-) rename docs/examples/health/{get-queue-usage-dump.md => get-queue-stats-resources.md} (88%) rename docs/examples/health/{get-queue.md => get-queue-stats-usage-dump.md} (79%) diff --git a/appwrite/client.py b/appwrite/client.py index be73fb8..cd37ff9 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/8.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/9.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '8.0.0', + 'x-sdk-version': '9.0.0', 'X-Appwrite-Response-Format' : '1.6.0', } @@ -131,9 +131,9 @@ def call(self, method, path='', headers=None, params=None, response_type='json') if response != None: content_type = response.headers['Content-Type'] if content_type.startswith('application/json'): - raise AppwriteException(response.json()['message'], response.status_code, response.json().get('type'), response.json()) + raise AppwriteException(response.json()['message'], response.status_code, response.json().get('type'), response.text) else: - raise AppwriteException(response.text, response.status_code) + raise AppwriteException(response.text, response.status_code, None, response.text) else: raise AppwriteException(e) diff --git a/appwrite/enums/credit_card.py b/appwrite/enums/credit_card.py index 097ea64..3f770a3 100644 --- a/appwrite/enums/credit_card.py +++ b/appwrite/enums/credit_card.py @@ -17,3 +17,4 @@ class CreditCard(Enum): VISA = "visa" MIR = "mir" MAESTRO = "maestro" + RUPAY = "rupay" diff --git a/appwrite/enums/name.py b/appwrite/enums/name.py index c5ad74e..0ac227e 100644 --- a/appwrite/enums/name.py +++ b/appwrite/enums/name.py @@ -6,8 +6,9 @@ class Name(Enum): V1_AUDITS = "v1-audits" V1_MAILS = "v1-mails" V1_FUNCTIONS = "v1-functions" - V1_USAGE = "v1-usage" - V1_USAGE_DUMP = "v1-usage-dump" + V1_STATS_RESOURCES = "v1-stats-resources" + V1_STATS_USAGE = "v1-stats-usage" + V1_STATS_USAGE_DUMP = "v1-stats-usage-dump" V1_WEBHOOKS = "v1-webhooks" V1_CERTIFICATES = "v1-certificates" V1_BUILDS = "v1-builds" diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 10255b2..61f1f60 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -1,5 +1,8 @@ from ..service import Service from ..exception import AppwriteException +from ..enums.authenticator_type import AuthenticatorType; +from ..enums.authentication_factor import AuthenticationFactor; +from ..enums.o_auth_provider import OAuthProvider; class Account(Service): @@ -7,9 +10,7 @@ def __init__(self, client): super(Account, self).__init__(client) def get(self): - """Get account""" - api_path = '/account' api_params = {} @@ -17,10 +18,8 @@ def get(self): 'content-type': 'application/json', }, api_params) - def create(self, user_id, email, password, name = None): - """Create account""" + def create(self, user_id: str, email: str, password: str, name: str = None): - api_path = '/account' api_params = {} if user_id is None: @@ -42,10 +41,8 @@ def create(self, user_id, email, password, name = None): 'content-type': 'application/json', }, api_params) - def update_email(self, email, password): - """Update email""" + def update_email(self, email: str, password: str): - api_path = '/account/email' api_params = {} if email is None: @@ -62,10 +59,8 @@ def update_email(self, email, password): 'content-type': 'application/json', }, api_params) - def list_identities(self, queries = None): - """List identities""" + def list_identities(self, queries: list = None): - api_path = '/account/identities' api_params = {} @@ -75,10 +70,8 @@ def list_identities(self, queries = None): 'content-type': 'application/json', }, api_params) - def delete_identity(self, identity_id): - """Delete identity""" + def delete_identity(self, identity_id: str): - api_path = '/account/identities/{identityId}' api_params = {} if identity_id is None: @@ -92,9 +85,7 @@ def delete_identity(self, identity_id): }, api_params) def create_jwt(self): - """Create JWT""" - api_path = '/account/jwts' api_params = {} @@ -102,10 +93,8 @@ def create_jwt(self): 'content-type': 'application/json', }, api_params) - def list_logs(self, queries = None): - """List logs""" + def list_logs(self, queries: list = None): - api_path = '/account/logs' api_params = {} @@ -115,10 +104,8 @@ def list_logs(self, queries = None): 'content-type': 'application/json', }, api_params) - def update_mfa(self, mfa): - """Update MFA""" + def update_mfa(self, mfa: bool): - api_path = '/account/mfa' api_params = {} if mfa is None: @@ -131,10 +118,8 @@ def update_mfa(self, mfa): 'content-type': 'application/json', }, api_params) - def create_mfa_authenticator(self, type): - """Create authenticator""" + def create_mfa_authenticator(self, type: AuthenticatorType): - api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -147,10 +132,8 @@ def create_mfa_authenticator(self, type): 'content-type': 'application/json', }, api_params) - def update_mfa_authenticator(self, type, otp): - """Verify authenticator""" + def update_mfa_authenticator(self, type: AuthenticatorType, otp: str): - api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -167,10 +150,8 @@ def update_mfa_authenticator(self, type, otp): 'content-type': 'application/json', }, api_params) - def delete_mfa_authenticator(self, type): - """Delete authenticator""" + def delete_mfa_authenticator(self, type: AuthenticatorType): - api_path = '/account/mfa/authenticators/{type}' api_params = {} if type is None: @@ -183,10 +164,8 @@ def delete_mfa_authenticator(self, type): 'content-type': 'application/json', }, api_params) - def create_mfa_challenge(self, factor): - """Create MFA challenge""" + def create_mfa_challenge(self, factor: AuthenticationFactor): - api_path = '/account/mfa/challenge' api_params = {} if factor is None: @@ -199,10 +178,8 @@ def create_mfa_challenge(self, factor): 'content-type': 'application/json', }, api_params) - def update_mfa_challenge(self, challenge_id, otp): - """Create MFA challenge (confirmation)""" + def update_mfa_challenge(self, challenge_id: str, otp: str): - api_path = '/account/mfa/challenge' api_params = {} if challenge_id is None: @@ -220,9 +197,7 @@ def update_mfa_challenge(self, challenge_id, otp): }, api_params) def list_mfa_factors(self): - """List factors""" - api_path = '/account/mfa/factors' api_params = {} @@ -231,9 +206,7 @@ def list_mfa_factors(self): }, api_params) def get_mfa_recovery_codes(self): - """Get MFA recovery codes""" - api_path = '/account/mfa/recovery-codes' api_params = {} @@ -242,9 +215,7 @@ def get_mfa_recovery_codes(self): }, api_params) def create_mfa_recovery_codes(self): - """Create MFA recovery codes""" - api_path = '/account/mfa/recovery-codes' api_params = {} @@ -253,9 +224,7 @@ def create_mfa_recovery_codes(self): }, api_params) def update_mfa_recovery_codes(self): - """Regenerate MFA recovery codes""" - api_path = '/account/mfa/recovery-codes' api_params = {} @@ -263,10 +232,8 @@ def update_mfa_recovery_codes(self): 'content-type': 'application/json', }, api_params) - def update_name(self, name): - """Update name""" + def update_name(self, name: str): - api_path = '/account/name' api_params = {} if name is None: @@ -279,10 +246,8 @@ def update_name(self, name): 'content-type': 'application/json', }, api_params) - def update_password(self, password, old_password = None): - """Update password""" + def update_password(self, password: str, old_password: str = None): - api_path = '/account/password' api_params = {} if password is None: @@ -296,10 +261,8 @@ def update_password(self, password, old_password = None): 'content-type': 'application/json', }, api_params) - def update_phone(self, phone, password): - """Update phone""" + def update_phone(self, phone: str, password: str): - api_path = '/account/phone' api_params = {} if phone is None: @@ -317,9 +280,7 @@ def update_phone(self, phone, password): }, api_params) def get_prefs(self): - """Get account preferences""" - api_path = '/account/prefs' api_params = {} @@ -327,10 +288,8 @@ def get_prefs(self): 'content-type': 'application/json', }, api_params) - def update_prefs(self, prefs): - """Update preferences""" + def update_prefs(self, prefs: dict): - api_path = '/account/prefs' api_params = {} if prefs is None: @@ -343,10 +302,8 @@ def update_prefs(self, prefs): 'content-type': 'application/json', }, api_params) - def create_recovery(self, email, url): - """Create password recovery""" + def create_recovery(self, email: str, url: str): - api_path = '/account/recovery' api_params = {} if email is None: @@ -363,10 +320,8 @@ def create_recovery(self, email, url): 'content-type': 'application/json', }, api_params) - def update_recovery(self, user_id, secret, password): - """Create password recovery (confirmation)""" + def update_recovery(self, user_id: str, secret: str, password: str): - api_path = '/account/recovery' api_params = {} if user_id is None: @@ -388,9 +343,7 @@ def update_recovery(self, user_id, secret, password): }, api_params) def list_sessions(self): - """List sessions""" - api_path = '/account/sessions' api_params = {} @@ -399,9 +352,7 @@ def list_sessions(self): }, api_params) def delete_sessions(self): - """Delete sessions""" - api_path = '/account/sessions' api_params = {} @@ -410,9 +361,7 @@ def delete_sessions(self): }, api_params) def create_anonymous_session(self): - """Create anonymous session""" - api_path = '/account/sessions/anonymous' api_params = {} @@ -420,10 +369,8 @@ def create_anonymous_session(self): 'content-type': 'application/json', }, api_params) - def create_email_password_session(self, email, password): - """Create email password session""" + def create_email_password_session(self, email: str, password: str): - api_path = '/account/sessions/email' api_params = {} if email is None: @@ -440,10 +387,8 @@ def create_email_password_session(self, email, password): 'content-type': 'application/json', }, api_params) - def update_magic_url_session(self, user_id, secret): - """Update magic URL session""" + def update_magic_url_session(self, user_id: str, secret: str): - api_path = '/account/sessions/magic-url' api_params = {} if user_id is None: @@ -460,10 +405,8 @@ def update_magic_url_session(self, user_id, secret): 'content-type': 'application/json', }, api_params) - def update_phone_session(self, user_id, secret): - """Update phone session""" + def update_phone_session(self, user_id: str, secret: str): - api_path = '/account/sessions/phone' api_params = {} if user_id is None: @@ -480,10 +423,8 @@ def update_phone_session(self, user_id, secret): 'content-type': 'application/json', }, api_params) - def create_session(self, user_id, secret): - """Create session""" + def create_session(self, user_id: str, secret: str): - api_path = '/account/sessions/token' api_params = {} if user_id is None: @@ -500,10 +441,8 @@ def create_session(self, user_id, secret): 'content-type': 'application/json', }, api_params) - def get_session(self, session_id): - """Get session""" + def get_session(self, session_id: str): - api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -516,10 +455,8 @@ def get_session(self, session_id): 'content-type': 'application/json', }, api_params) - def update_session(self, session_id): - """Update session""" + def update_session(self, session_id: str): - api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -532,10 +469,8 @@ def update_session(self, session_id): 'content-type': 'application/json', }, api_params) - def delete_session(self, session_id): - """Delete session""" + def delete_session(self, session_id: str): - api_path = '/account/sessions/{sessionId}' api_params = {} if session_id is None: @@ -549,9 +484,7 @@ def delete_session(self, session_id): }, api_params) def update_status(self): - """Update status""" - api_path = '/account/status' api_params = {} @@ -559,10 +492,8 @@ def update_status(self): 'content-type': 'application/json', }, api_params) - def create_email_token(self, user_id, email, phrase = None): - """Create email token (OTP)""" + def create_email_token(self, user_id: str, email: str, phrase: bool = None): - api_path = '/account/tokens/email' api_params = {} if user_id is None: @@ -580,10 +511,8 @@ def create_email_token(self, user_id, email, phrase = None): 'content-type': 'application/json', }, api_params) - def create_magic_url_token(self, user_id, email, url = None, phrase = None): - """Create magic URL token""" + def create_magic_url_token(self, user_id: str, email: str, url: str = None, phrase: bool = None): - api_path = '/account/tokens/magic-url' api_params = {} if user_id is None: @@ -602,10 +531,8 @@ def create_magic_url_token(self, user_id, email, url = None, phrase = None): 'content-type': 'application/json', }, api_params) - def create_o_auth2_token(self, provider, success = None, failure = None, scopes = None): - """Create OAuth2 token""" + def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: list = None): - api_path = '/account/tokens/oauth2/{provider}' api_params = {} if provider is None: @@ -621,10 +548,8 @@ def create_o_auth2_token(self, provider, success = None, failure = None, scopes 'content-type': 'application/json', }, api_params, response_type='location') - def create_phone_token(self, user_id, phone): - """Create phone token""" + def create_phone_token(self, user_id: str, phone: str): - api_path = '/account/tokens/phone' api_params = {} if user_id is None: @@ -641,10 +566,8 @@ def create_phone_token(self, user_id, phone): 'content-type': 'application/json', }, api_params) - def create_verification(self, url): - """Create email verification""" + def create_verification(self, url: str): - api_path = '/account/verification' api_params = {} if url is None: @@ -657,10 +580,8 @@ def create_verification(self, url): 'content-type': 'application/json', }, api_params) - def update_verification(self, user_id, secret): - """Create email verification (confirmation)""" + def update_verification(self, user_id: str, secret: str): - api_path = '/account/verification' api_params = {} if user_id is None: @@ -678,9 +599,7 @@ def update_verification(self, user_id, secret): }, api_params) def create_phone_verification(self): - """Create phone verification""" - api_path = '/account/verification/phone' api_params = {} @@ -688,10 +607,8 @@ def create_phone_verification(self): 'content-type': 'application/json', }, api_params) - def update_phone_verification(self, user_id, secret): - """Update phone verification (confirmation)""" + def update_phone_verification(self, user_id: str, secret: str): - api_path = '/account/verification/phone' api_params = {} if user_id is None: diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 0a9b400..e4752a6 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -1,15 +1,16 @@ from ..service import Service from ..exception import AppwriteException +from ..enums.browser import Browser; +from ..enums.credit_card import CreditCard; +from ..enums.flag import Flag; class Avatars(Service): def __init__(self, client): super(Avatars, self).__init__(client) - def get_browser(self, code, width = None, height = None, quality = None): - """Get browser icon""" + def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None): - api_path = '/avatars/browsers/{code}' api_params = {} if code is None: @@ -25,10 +26,8 @@ def get_browser(self, code, width = None, height = None, quality = None): 'content-type': 'application/json', }, api_params) - def get_credit_card(self, code, width = None, height = None, quality = None): - """Get credit card icon""" + def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None): - api_path = '/avatars/credit-cards/{code}' api_params = {} if code is None: @@ -44,10 +43,8 @@ def get_credit_card(self, code, width = None, height = None, quality = None): 'content-type': 'application/json', }, api_params) - def get_favicon(self, url): - """Get favicon""" + def get_favicon(self, url: str): - api_path = '/avatars/favicon' api_params = {} if url is None: @@ -60,10 +57,8 @@ def get_favicon(self, url): 'content-type': 'application/json', }, api_params) - def get_flag(self, code, width = None, height = None, quality = None): - """Get country flag""" + def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None): - api_path = '/avatars/flags/{code}' api_params = {} if code is None: @@ -79,10 +74,8 @@ def get_flag(self, code, width = None, height = None, quality = None): 'content-type': 'application/json', }, api_params) - def get_image(self, url, width = None, height = None): - """Get image from URL""" + def get_image(self, url: str, width: float = None, height: float = None): - api_path = '/avatars/image' api_params = {} if url is None: @@ -97,10 +90,8 @@ def get_image(self, url, width = None, height = None): 'content-type': 'application/json', }, api_params) - def get_initials(self, name = None, width = None, height = None, background = None): - """Get user initials""" + def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None): - api_path = '/avatars/initials' api_params = {} @@ -113,10 +104,8 @@ def get_initials(self, name = None, width = None, height = None, background = No 'content-type': 'application/json', }, api_params) - def get_qr(self, text, size = None, margin = None, download = None): - """Get QR code""" + def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None): - api_path = '/avatars/qr' api_params = {} if text is None: diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index aa47e4e..85b2e86 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -1,15 +1,16 @@ from ..service import Service from ..exception import AppwriteException +from ..enums.relationship_type import RelationshipType; +from ..enums.relation_mutate import RelationMutate; +from ..enums.index_type import IndexType; class Databases(Service): def __init__(self, client): super(Databases, self).__init__(client) - def list(self, queries = None, search = None): - """List databases""" + def list(self, queries: list = None, search: str = None): - api_path = '/databases' api_params = {} @@ -20,10 +21,8 @@ def list(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create(self, database_id, name, enabled = None): - """Create database""" + def create(self, database_id: str, name: str, enabled: bool = None): - api_path = '/databases' api_params = {} if database_id is None: @@ -41,10 +40,8 @@ def create(self, database_id, name, enabled = None): 'content-type': 'application/json', }, api_params) - def get(self, database_id): - """Get database""" + def get(self, database_id: str): - api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -57,10 +54,8 @@ def get(self, database_id): 'content-type': 'application/json', }, api_params) - def update(self, database_id, name, enabled = None): - """Update database""" + def update(self, database_id: str, name: str, enabled: bool = None): - api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -78,10 +73,8 @@ def update(self, database_id, name, enabled = None): 'content-type': 'application/json', }, api_params) - def delete(self, database_id): - """Delete database""" + def delete(self, database_id: str): - api_path = '/databases/{databaseId}' api_params = {} if database_id is None: @@ -94,10 +87,8 @@ def delete(self, database_id): 'content-type': 'application/json', }, api_params) - def list_collections(self, database_id, queries = None, search = None): - """List collections""" + def list_collections(self, database_id: str, queries: list = None, search: str = None): - api_path = '/databases/{databaseId}/collections' api_params = {} if database_id is None: @@ -112,10 +103,8 @@ def list_collections(self, database_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_collection(self, database_id, collection_id, name, permissions = None, document_security = None, enabled = None): - """Create collection""" + def create_collection(self, database_id: str, collection_id: str, name: str, permissions: list = None, document_security: bool = None, enabled: bool = None): - api_path = '/databases/{databaseId}/collections' api_params = {} if database_id is None: @@ -139,10 +128,8 @@ def create_collection(self, database_id, collection_id, name, permissions = None 'content-type': 'application/json', }, api_params) - def get_collection(self, database_id, collection_id): - """Get collection""" + def get_collection(self, database_id: str, collection_id: str): - api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -159,10 +146,8 @@ def get_collection(self, database_id, collection_id): 'content-type': 'application/json', }, api_params) - def update_collection(self, database_id, collection_id, name, permissions = None, document_security = None, enabled = None): - """Update collection""" + def update_collection(self, database_id: str, collection_id: str, name: str, permissions: list = None, document_security: bool = None, enabled: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -186,10 +171,8 @@ def update_collection(self, database_id, collection_id, name, permissions = None 'content-type': 'application/json', }, api_params) - def delete_collection(self, database_id, collection_id): - """Delete collection""" + def delete_collection(self, database_id: str, collection_id: str): - api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} if database_id is None: @@ -206,10 +189,8 @@ def delete_collection(self, database_id, collection_id): 'content-type': 'application/json', }, api_params) - def list_attributes(self, database_id, collection_id, queries = None): - """List attributes""" + def list_attributes(self, database_id: str, collection_id: str, queries: list = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' api_params = {} if database_id is None: @@ -227,10 +208,8 @@ def list_attributes(self, database_id, collection_id, queries = None): 'content-type': 'application/json', }, api_params) - def create_boolean_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create boolean attribute""" + def create_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool = None, array: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean' api_params = {} if database_id is None: @@ -257,10 +236,8 @@ def create_boolean_attribute(self, database_id, collection_id, key, required, de 'content-type': 'application/json', }, api_params) - def update_boolean_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update boolean attribute""" + def update_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}' api_params = {} if database_id is None: @@ -287,10 +264,8 @@ def update_boolean_attribute(self, database_id, collection_id, key, required, de 'content-type': 'application/json', }, api_params) - def create_datetime_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create datetime attribute""" + def create_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime' api_params = {} if database_id is None: @@ -317,10 +292,8 @@ def create_datetime_attribute(self, database_id, collection_id, key, required, d 'content-type': 'application/json', }, api_params) - def update_datetime_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update dateTime attribute""" + def update_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}' api_params = {} if database_id is None: @@ -347,10 +320,8 @@ def update_datetime_attribute(self, database_id, collection_id, key, required, d 'content-type': 'application/json', }, api_params) - def create_email_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create email attribute""" + def create_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email' api_params = {} if database_id is None: @@ -377,10 +348,8 @@ def create_email_attribute(self, database_id, collection_id, key, required, defa 'content-type': 'application/json', }, api_params) - def update_email_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update email attribute""" + def update_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}' api_params = {} if database_id is None: @@ -407,10 +376,8 @@ def update_email_attribute(self, database_id, collection_id, key, required, defa 'content-type': 'application/json', }, api_params) - def create_enum_attribute(self, database_id, collection_id, key, elements, required, default = None, array = None): - """Create enum attribute""" + def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list, required: bool, default: str = None, array: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' api_params = {} if database_id is None: @@ -441,10 +408,8 @@ def create_enum_attribute(self, database_id, collection_id, key, elements, requi 'content-type': 'application/json', }, api_params) - def update_enum_attribute(self, database_id, collection_id, key, elements, required, default, new_key = None): - """Update enum attribute""" + def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list, required: bool, default: str, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}' api_params = {} if database_id is None: @@ -475,10 +440,8 @@ def update_enum_attribute(self, database_id, collection_id, key, elements, requi 'content-type': 'application/json', }, api_params) - def create_float_attribute(self, database_id, collection_id, key, required, min = None, max = None, default = None, array = None): - """Create float attribute""" + def create_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float' api_params = {} if database_id is None: @@ -507,10 +470,8 @@ def create_float_attribute(self, database_id, collection_id, key, required, min 'content-type': 'application/json', }, api_params) - def update_float_attribute(self, database_id, collection_id, key, required, min, max, default, new_key = None): - """Update float attribute""" + def update_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}' api_params = {} if database_id is None: @@ -525,12 +486,6 @@ def update_float_attribute(self, database_id, collection_id, key, required, min, if required is None: raise AppwriteException('Missing required parameter: "required"') - if min is None: - raise AppwriteException('Missing required parameter: "min"') - - if max is None: - raise AppwriteException('Missing required parameter: "max"') - api_path = api_path.replace('{databaseId}', database_id) api_path = api_path.replace('{collectionId}', collection_id) api_path = api_path.replace('{key}', key) @@ -545,10 +500,8 @@ def update_float_attribute(self, database_id, collection_id, key, required, min, 'content-type': 'application/json', }, api_params) - def create_integer_attribute(self, database_id, collection_id, key, required, min = None, max = None, default = None, array = None): - """Create integer attribute""" + def create_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer' api_params = {} if database_id is None: @@ -577,10 +530,8 @@ def create_integer_attribute(self, database_id, collection_id, key, required, mi 'content-type': 'application/json', }, api_params) - def update_integer_attribute(self, database_id, collection_id, key, required, min, max, default, new_key = None): - """Update integer attribute""" + def update_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}' api_params = {} if database_id is None: @@ -595,12 +546,6 @@ def update_integer_attribute(self, database_id, collection_id, key, required, mi if required is None: raise AppwriteException('Missing required parameter: "required"') - if min is None: - raise AppwriteException('Missing required parameter: "min"') - - if max is None: - raise AppwriteException('Missing required parameter: "max"') - api_path = api_path.replace('{databaseId}', database_id) api_path = api_path.replace('{collectionId}', collection_id) api_path = api_path.replace('{key}', key) @@ -615,10 +560,8 @@ def update_integer_attribute(self, database_id, collection_id, key, required, mi 'content-type': 'application/json', }, api_params) - def create_ip_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create IP address attribute""" + def create_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip' api_params = {} if database_id is None: @@ -645,10 +588,8 @@ def create_ip_attribute(self, database_id, collection_id, key, required, default 'content-type': 'application/json', }, api_params) - def update_ip_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update IP address attribute""" + def update_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}' api_params = {} if database_id is None: @@ -675,10 +616,8 @@ def update_ip_attribute(self, database_id, collection_id, key, required, default 'content-type': 'application/json', }, api_params) - def create_relationship_attribute(self, database_id, collection_id, related_collection_id, type, two_way = None, key = None, two_way_key = None, on_delete = None): - """Create relationship attribute""" + def create_relationship_attribute(self, database_id: str, collection_id: str, related_collection_id: str, type: RelationshipType, two_way: bool = None, key: str = None, two_way_key: str = None, on_delete: RelationMutate = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship' api_params = {} if database_id is None: @@ -707,10 +646,8 @@ def create_relationship_attribute(self, database_id, collection_id, related_coll 'content-type': 'application/json', }, api_params) - def create_string_attribute(self, database_id, collection_id, key, size, required, default = None, array = None, encrypt = None): - """Create string attribute""" + def create_string_attribute(self, database_id: str, collection_id: str, key: str, size: float, required: bool, default: str = None, array: bool = None, encrypt: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string' api_params = {} if database_id is None: @@ -742,10 +679,8 @@ def create_string_attribute(self, database_id, collection_id, key, size, require 'content-type': 'application/json', }, api_params) - def update_string_attribute(self, database_id, collection_id, key, required, default, size = None, new_key = None): - """Update string attribute""" + def update_string_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, size: float = None, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}' api_params = {} if database_id is None: @@ -773,10 +708,8 @@ def update_string_attribute(self, database_id, collection_id, key, required, def 'content-type': 'application/json', }, api_params) - def create_url_attribute(self, database_id, collection_id, key, required, default = None, array = None): - """Create URL attribute""" + def create_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url' api_params = {} if database_id is None: @@ -803,10 +736,8 @@ def create_url_attribute(self, database_id, collection_id, key, required, defaul 'content-type': 'application/json', }, api_params) - def update_url_attribute(self, database_id, collection_id, key, required, default, new_key = None): - """Update URL attribute""" + def update_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}' api_params = {} if database_id is None: @@ -833,10 +764,8 @@ def update_url_attribute(self, database_id, collection_id, key, required, defaul 'content-type': 'application/json', }, api_params) - def get_attribute(self, database_id, collection_id, key): - """Get attribute""" + def get_attribute(self, database_id: str, collection_id: str, key: str): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} if database_id is None: @@ -857,10 +786,8 @@ def get_attribute(self, database_id, collection_id, key): 'content-type': 'application/json', }, api_params) - def delete_attribute(self, database_id, collection_id, key): - """Delete attribute""" + def delete_attribute(self, database_id: str, collection_id: str, key: str): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} if database_id is None: @@ -881,10 +808,8 @@ def delete_attribute(self, database_id, collection_id, key): 'content-type': 'application/json', }, api_params) - def update_relationship_attribute(self, database_id, collection_id, key, on_delete = None, new_key = None): - """Update relationship attribute""" + def update_relationship_attribute(self, database_id: str, collection_id: str, key: str, on_delete: RelationMutate = None, new_key: str = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship' api_params = {} if database_id is None: @@ -907,10 +832,8 @@ def update_relationship_attribute(self, database_id, collection_id, key, on_dele 'content-type': 'application/json', }, api_params) - def list_documents(self, database_id, collection_id, queries = None): - """List documents""" + def list_documents(self, database_id: str, collection_id: str, queries: list = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} if database_id is None: @@ -928,10 +851,8 @@ def list_documents(self, database_id, collection_id, queries = None): 'content-type': 'application/json', }, api_params) - def create_document(self, database_id, collection_id, document_id, data, permissions = None): - """Create document""" + def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: list = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} if database_id is None: @@ -957,10 +878,8 @@ def create_document(self, database_id, collection_id, document_id, data, permiss 'content-type': 'application/json', }, api_params) - def get_document(self, database_id, collection_id, document_id, queries = None): - """Get document""" + def get_document(self, database_id: str, collection_id: str, document_id: str, queries: list = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -982,10 +901,8 @@ def get_document(self, database_id, collection_id, document_id, queries = None): 'content-type': 'application/json', }, api_params) - def update_document(self, database_id, collection_id, document_id, data = None, permissions = None): - """Update document""" + def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: list = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -1008,10 +925,8 @@ def update_document(self, database_id, collection_id, document_id, data = None, 'content-type': 'application/json', }, api_params) - def delete_document(self, database_id, collection_id, document_id): - """Delete document""" + def delete_document(self, database_id: str, collection_id: str, document_id: str): - api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} if database_id is None: @@ -1032,10 +947,8 @@ def delete_document(self, database_id, collection_id, document_id): 'content-type': 'application/json', }, api_params) - def list_indexes(self, database_id, collection_id, queries = None): - """List indexes""" + def list_indexes(self, database_id: str, collection_id: str, queries: list = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} if database_id is None: @@ -1053,10 +966,8 @@ def list_indexes(self, database_id, collection_id, queries = None): 'content-type': 'application/json', }, api_params) - def create_index(self, database_id, collection_id, key, type, attributes, orders = None): - """Create index""" + def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: list, orders: list = None): - api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} if database_id is None: @@ -1086,10 +997,8 @@ def create_index(self, database_id, collection_id, key, type, attributes, orders 'content-type': 'application/json', }, api_params) - def get_index(self, database_id, collection_id, key): - """Get index""" + def get_index(self, database_id: str, collection_id: str, key: str): - api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} if database_id is None: @@ -1110,10 +1019,8 @@ def get_index(self, database_id, collection_id, key): 'content-type': 'application/json', }, api_params) - def delete_index(self, database_id, collection_id, key): - """Delete index""" + def delete_index(self, database_id: str, collection_id: str, key: str): - api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} if database_id is None: diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 34b13a9..326171c 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -1,15 +1,16 @@ from ..service import Service from ..exception import AppwriteException +from ..enums.runtime import Runtime; +from ..input_file import InputFile +from ..enums.execution_method import ExecutionMethod; class Functions(Service): def __init__(self, client): super(Functions, self).__init__(client) - def list(self, queries = None, search = None): - """List functions""" + def list(self, queries: list = None, search: str = None): - api_path = '/functions' api_params = {} @@ -20,10 +21,8 @@ def list(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None, specification = None): - """Create function""" + def create(self, function_id: str, name: str, runtime: Runtime, execute: list = None, events: list = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None): - api_path = '/functions' api_params = {} if function_id is None: @@ -64,9 +63,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche }, api_params) def list_runtimes(self): - """List runtimes""" - api_path = '/functions/runtimes' api_params = {} @@ -75,9 +72,7 @@ def list_runtimes(self): }, api_params) def list_specifications(self): - """List available function runtime specifications""" - api_path = '/functions/specifications' api_params = {} @@ -85,10 +80,8 @@ def list_specifications(self): 'content-type': 'application/json', }, api_params) - def get(self, function_id): - """Get function""" + def get(self, function_id: str): - api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -101,10 +94,8 @@ def get(self, function_id): 'content-type': 'application/json', }, api_params) - def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, specification = None): - """Update function""" + def update(self, function_id: str, name: str, runtime: Runtime = None, execute: list = None, events: list = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None): - api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -137,10 +128,8 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non 'content-type': 'application/json', }, api_params) - def delete(self, function_id): - """Delete function""" + def delete(self, function_id: str): - api_path = '/functions/{functionId}' api_params = {} if function_id is None: @@ -153,10 +142,8 @@ def delete(self, function_id): 'content-type': 'application/json', }, api_params) - def list_deployments(self, function_id, queries = None, search = None): - """List deployments""" + def list_deployments(self, function_id: str, queries: list = None, search: str = None): - api_path = '/functions/{functionId}/deployments' api_params = {} if function_id is None: @@ -171,10 +158,8 @@ def list_deployments(self, function_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_deployment(self, function_id, code, activate, entrypoint = None, commands = None, on_progress = None): - """Create deployment""" + def create_deployment(self, function_id: str, code: InputFile, activate: bool, entrypoint: str = None, commands: str = None, on_progress = None): - api_path = '/functions/{functionId}/deployments' api_params = {} if function_id is None: @@ -202,10 +187,8 @@ def create_deployment(self, function_id, code, activate, entrypoint = None, comm 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_deployment(self, function_id, deployment_id): - """Get deployment""" + def get_deployment(self, function_id: str, deployment_id: str): - api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -222,10 +205,8 @@ def get_deployment(self, function_id, deployment_id): 'content-type': 'application/json', }, api_params) - def update_deployment(self, function_id, deployment_id): - """Update deployment""" + def update_deployment(self, function_id: str, deployment_id: str): - api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -242,10 +223,8 @@ def update_deployment(self, function_id, deployment_id): 'content-type': 'application/json', }, api_params) - def delete_deployment(self, function_id, deployment_id): - """Delete deployment""" + def delete_deployment(self, function_id: str, deployment_id: str): - api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: @@ -262,10 +241,8 @@ def delete_deployment(self, function_id, deployment_id): 'content-type': 'application/json', }, api_params) - def create_build(self, function_id, deployment_id, build_id = None): - """Rebuild deployment""" + def create_build(self, function_id: str, deployment_id: str, build_id: str = None): - api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} if function_id is None: @@ -283,10 +260,8 @@ def create_build(self, function_id, deployment_id, build_id = None): 'content-type': 'application/json', }, api_params) - def update_deployment_build(self, function_id, deployment_id): - """Cancel deployment""" + def update_deployment_build(self, function_id: str, deployment_id: str): - api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} if function_id is None: @@ -303,10 +278,8 @@ def update_deployment_build(self, function_id, deployment_id): 'content-type': 'application/json', }, api_params) - def get_deployment_download(self, function_id, deployment_id): - """Download deployment""" + def get_deployment_download(self, function_id: str, deployment_id: str): - api_path = '/functions/{functionId}/deployments/{deploymentId}/download' api_params = {} if function_id is None: @@ -323,10 +296,8 @@ def get_deployment_download(self, function_id, deployment_id): 'content-type': 'application/json', }, api_params) - def list_executions(self, function_id, queries = None, search = None): - """List executions""" + def list_executions(self, function_id: str, queries: list = None, search: str = None): - api_path = '/functions/{functionId}/executions' api_params = {} if function_id is None: @@ -341,10 +312,8 @@ def list_executions(self, function_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None): - """Create execution""" + def create_execution(self, function_id: str, body: str = None, xasync: bool = None, path: str = None, method: ExecutionMethod = None, headers: dict = None, scheduled_at: str = None): - api_path = '/functions/{functionId}/executions' api_params = {} if function_id is None: @@ -363,10 +332,8 @@ def create_execution(self, function_id, body = None, xasync = None, path = None, 'content-type': 'application/json', }, api_params) - def get_execution(self, function_id, execution_id): - """Get execution""" + def get_execution(self, function_id: str, execution_id: str): - api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} if function_id is None: @@ -383,10 +350,8 @@ def get_execution(self, function_id, execution_id): 'content-type': 'application/json', }, api_params) - def delete_execution(self, function_id, execution_id): - """Delete execution""" + def delete_execution(self, function_id: str, execution_id: str): - api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} if function_id is None: @@ -403,10 +368,8 @@ def delete_execution(self, function_id, execution_id): 'content-type': 'application/json', }, api_params) - def list_variables(self, function_id): - """List variables""" + def list_variables(self, function_id: str): - api_path = '/functions/{functionId}/variables' api_params = {} if function_id is None: @@ -419,10 +382,8 @@ def list_variables(self, function_id): 'content-type': 'application/json', }, api_params) - def create_variable(self, function_id, key, value): - """Create variable""" + def create_variable(self, function_id: str, key: str, value: str): - api_path = '/functions/{functionId}/variables' api_params = {} if function_id is None: @@ -443,10 +404,8 @@ def create_variable(self, function_id, key, value): 'content-type': 'application/json', }, api_params) - def get_variable(self, function_id, variable_id): - """Get variable""" + def get_variable(self, function_id: str, variable_id: str): - api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: @@ -463,10 +422,8 @@ def get_variable(self, function_id, variable_id): 'content-type': 'application/json', }, api_params) - def update_variable(self, function_id, variable_id, key, value = None): - """Update variable""" + def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None): - api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: @@ -488,10 +445,8 @@ def update_variable(self, function_id, variable_id, key, value = None): 'content-type': 'application/json', }, api_params) - def delete_variable(self, function_id, variable_id): - """Delete variable""" + def delete_variable(self, function_id: str, variable_id: str): - api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} if function_id is None: diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 58a6e99..7d58b9e 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -6,10 +6,8 @@ class Graphql(Service): def __init__(self, client): super(Graphql, self).__init__(client) - def query(self, query): - """GraphQL endpoint""" + def query(self, query: dict): - api_path = '/graphql' api_params = {} if query is None: @@ -23,10 +21,8 @@ def query(self, query): 'content-type': 'application/json', }, api_params) - def mutation(self, query): - """GraphQL endpoint""" + def mutation(self, query: dict): - api_path = '/graphql/mutation' api_params = {} if query is None: diff --git a/appwrite/services/health.py b/appwrite/services/health.py index ef4b3cd..5be5d32 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -1,5 +1,6 @@ from ..service import Service from ..exception import AppwriteException +from ..enums.name import Name; class Health(Service): @@ -7,9 +8,7 @@ def __init__(self, client): super(Health, self).__init__(client) def get(self): - """Get HTTP""" - api_path = '/health' api_params = {} @@ -18,9 +17,7 @@ def get(self): }, api_params) def get_antivirus(self): - """Get antivirus""" - api_path = '/health/anti-virus' api_params = {} @@ -29,9 +26,7 @@ def get_antivirus(self): }, api_params) def get_cache(self): - """Get cache""" - api_path = '/health/cache' api_params = {} @@ -39,10 +34,8 @@ def get_cache(self): 'content-type': 'application/json', }, api_params) - def get_certificate(self, domain = None): - """Get the SSL certificate for a domain""" + def get_certificate(self, domain: str = None): - api_path = '/health/certificate' api_params = {} @@ -53,9 +46,7 @@ def get_certificate(self, domain = None): }, api_params) def get_db(self): - """Get DB""" - api_path = '/health/db' api_params = {} @@ -64,9 +55,7 @@ def get_db(self): }, api_params) def get_pub_sub(self): - """Get pubsub""" - api_path = '/health/pubsub' api_params = {} @@ -74,21 +63,8 @@ def get_pub_sub(self): 'content-type': 'application/json', }, api_params) - def get_queue(self): - """Get queue""" + def get_queue_builds(self, threshold: float = None): - - api_path = '/health/queue' - api_params = {} - - return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_queue_builds(self, threshold = None): - """Get builds queue""" - - api_path = '/health/queue/builds' api_params = {} @@ -98,10 +74,8 @@ def get_queue_builds(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_certificates(self, threshold = None): - """Get certificates queue""" + def get_queue_certificates(self, threshold: float = None): - api_path = '/health/queue/certificates' api_params = {} @@ -111,10 +85,8 @@ def get_queue_certificates(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_databases(self, name = None, threshold = None): - """Get databases queue""" + def get_queue_databases(self, name: str = None, threshold: float = None): - api_path = '/health/queue/databases' api_params = {} @@ -125,10 +97,8 @@ def get_queue_databases(self, name = None, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_deletes(self, threshold = None): - """Get deletes queue""" + def get_queue_deletes(self, threshold: float = None): - api_path = '/health/queue/deletes' api_params = {} @@ -138,10 +108,8 @@ def get_queue_deletes(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_failed_jobs(self, name, threshold = None): - """Get number of failed queue jobs""" + def get_failed_jobs(self, name: Name, threshold: float = None): - api_path = '/health/queue/failed/{name}' api_params = {} if name is None: @@ -155,10 +123,8 @@ def get_failed_jobs(self, name, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_functions(self, threshold = None): - """Get functions queue""" + def get_queue_functions(self, threshold: float = None): - api_path = '/health/queue/functions' api_params = {} @@ -168,10 +134,8 @@ def get_queue_functions(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_logs(self, threshold = None): - """Get logs queue""" + def get_queue_logs(self, threshold: float = None): - api_path = '/health/queue/logs' api_params = {} @@ -181,10 +145,8 @@ def get_queue_logs(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_mails(self, threshold = None): - """Get mails queue""" + def get_queue_mails(self, threshold: float = None): - api_path = '/health/queue/mails' api_params = {} @@ -194,10 +156,8 @@ def get_queue_mails(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_messaging(self, threshold = None): - """Get messaging queue""" + def get_queue_messaging(self, threshold: float = None): - api_path = '/health/queue/messaging' api_params = {} @@ -207,10 +167,8 @@ def get_queue_messaging(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_migrations(self, threshold = None): - """Get migrations queue""" + def get_queue_migrations(self, threshold: float = None): - api_path = '/health/queue/migrations' api_params = {} @@ -220,11 +178,20 @@ def get_queue_migrations(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_usage(self, threshold = None): - """Get usage queue""" + def get_queue_stats_resources(self, threshold: float = None): + + api_path = '/health/queue/stats-resources' + api_params = {} + + api_params['threshold'] = threshold + + return self.client.call('get', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_queue_usage(self, threshold: float = None): - - api_path = '/health/queue/usage' + api_path = '/health/queue/stats-usage' api_params = {} api_params['threshold'] = threshold @@ -233,11 +200,9 @@ def get_queue_usage(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_usage_dump(self, threshold = None): - """Get usage dump queue""" + def get_queue_stats_usage_dump(self, threshold: float = None): - - api_path = '/health/queue/usage-dump' + api_path = '/health/queue/stats-usage-dump' api_params = {} api_params['threshold'] = threshold @@ -246,10 +211,8 @@ def get_queue_usage_dump(self, threshold = None): 'content-type': 'application/json', }, api_params) - def get_queue_webhooks(self, threshold = None): - """Get webhooks queue""" + def get_queue_webhooks(self, threshold: float = None): - api_path = '/health/queue/webhooks' api_params = {} @@ -260,9 +223,7 @@ def get_queue_webhooks(self, threshold = None): }, api_params) def get_storage(self): - """Get storage""" - api_path = '/health/storage' api_params = {} @@ -271,9 +232,7 @@ def get_storage(self): }, api_params) def get_storage_local(self): - """Get local storage""" - api_path = '/health/storage/local' api_params = {} @@ -282,9 +241,7 @@ def get_storage_local(self): }, api_params) def get_time(self): - """Get time""" - api_path = '/health/time' api_params = {} diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index db38754..e77cd93 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -7,9 +7,7 @@ def __init__(self, client): super(Locale, self).__init__(client) def get(self): - """Get user locale""" - api_path = '/locale' api_params = {} @@ -18,9 +16,7 @@ def get(self): }, api_params) def list_codes(self): - """List locale codes""" - api_path = '/locale/codes' api_params = {} @@ -29,9 +25,7 @@ def list_codes(self): }, api_params) def list_continents(self): - """List continents""" - api_path = '/locale/continents' api_params = {} @@ -40,9 +34,7 @@ def list_continents(self): }, api_params) def list_countries(self): - """List countries""" - api_path = '/locale/countries' api_params = {} @@ -51,9 +43,7 @@ def list_countries(self): }, api_params) def list_countries_eu(self): - """List EU countries""" - api_path = '/locale/countries/eu' api_params = {} @@ -62,9 +52,7 @@ def list_countries_eu(self): }, api_params) def list_countries_phones(self): - """List countries phone codes""" - api_path = '/locale/countries/phones' api_params = {} @@ -73,9 +61,7 @@ def list_countries_phones(self): }, api_params) def list_currencies(self): - """List currencies""" - api_path = '/locale/currencies' api_params = {} @@ -84,9 +70,7 @@ def list_currencies(self): }, api_params) def list_languages(self): - """List languages""" - api_path = '/locale/languages' api_params = {} diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index f8ce3bf..b62a706 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -1,15 +1,15 @@ from ..service import Service from ..exception import AppwriteException +from ..enums.message_priority import MessagePriority; +from ..enums.smtp_encryption import SmtpEncryption; class Messaging(Service): def __init__(self, client): super(Messaging, self).__init__(client) - def list_messages(self, queries = None, search = None): - """List messages""" + def list_messages(self, queries: list = None, search: str = None): - api_path = '/messaging/messages' api_params = {} @@ -20,10 +20,8 @@ def list_messages(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, attachments = None, draft = None, html = None, scheduled_at = None): - """Create email""" + def create_email(self, message_id: str, subject: str, content: str, topics: list = None, users: list = None, targets: list = None, cc: list = None, bcc: list = None, attachments: list = None, draft: bool = None, html: bool = None, scheduled_at: str = None): - api_path = '/messaging/messages/email' api_params = {} if message_id is None: @@ -53,10 +51,8 @@ def create_email(self, message_id, subject, content, topics = None, users = None 'content-type': 'application/json', }, api_params) - def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, draft = None, html = None, cc = None, bcc = None, scheduled_at = None, attachments = None): - """Update email""" + def update_email(self, message_id: str, topics: list = None, users: list = None, targets: list = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: list = None, bcc: list = None, scheduled_at: str = None, attachments: list = None): - api_path = '/messaging/messages/email/{messageId}' api_params = {} if message_id is None: @@ -80,10 +76,8 @@ def update_email(self, message_id, topics = None, users = None, targets = None, 'content-type': 'application/json', }, api_params) - def create_push(self, message_id, title = None, body = None, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None, content_available = None, critical = None, priority = None): - """Create push notification""" + def create_push(self, message_id: str, title: str = None, body: str = None, topics: list = None, users: list = None, targets: list = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): - api_path = '/messaging/messages/push' api_params = {} if message_id is None: @@ -114,10 +108,8 @@ def create_push(self, message_id, title = None, body = None, topics = None, user 'content-type': 'application/json', }, api_params) - def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, draft = None, scheduled_at = None, content_available = None, critical = None, priority = None): - """Update push notification""" + def update_push(self, message_id: str, topics: list = None, users: list = None, targets: list = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): - api_path = '/messaging/messages/push/{messageId}' api_params = {} if message_id is None: @@ -148,10 +140,8 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t 'content-type': 'application/json', }, api_params) - def create_sms(self, message_id, content, topics = None, users = None, targets = None, draft = None, scheduled_at = None): - """Create SMS""" + def create_sms(self, message_id: str, content: str, topics: list = None, users: list = None, targets: list = None, draft: bool = None, scheduled_at: str = None): - api_path = '/messaging/messages/sms' api_params = {} if message_id is None: @@ -173,10 +163,8 @@ def create_sms(self, message_id, content, topics = None, users = None, targets = 'content-type': 'application/json', }, api_params) - def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, draft = None, scheduled_at = None): - """Update SMS""" + def update_sms(self, message_id: str, topics: list = None, users: list = None, targets: list = None, content: str = None, draft: bool = None, scheduled_at: str = None): - api_path = '/messaging/messages/sms/{messageId}' api_params = {} if message_id is None: @@ -195,10 +183,8 @@ def update_sms(self, message_id, topics = None, users = None, targets = None, co 'content-type': 'application/json', }, api_params) - def get_message(self, message_id): - """Get message""" + def get_message(self, message_id: str): - api_path = '/messaging/messages/{messageId}' api_params = {} if message_id is None: @@ -211,10 +197,8 @@ def get_message(self, message_id): 'content-type': 'application/json', }, api_params) - def delete(self, message_id): - """Delete message""" + def delete(self, message_id: str): - api_path = '/messaging/messages/{messageId}' api_params = {} if message_id is None: @@ -227,10 +211,8 @@ def delete(self, message_id): 'content-type': 'application/json', }, api_params) - def list_message_logs(self, message_id, queries = None): - """List message logs""" + def list_message_logs(self, message_id: str, queries: list = None): - api_path = '/messaging/messages/{messageId}/logs' api_params = {} if message_id is None: @@ -244,10 +226,8 @@ def list_message_logs(self, message_id, queries = None): 'content-type': 'application/json', }, api_params) - def list_targets(self, message_id, queries = None): - """List message targets""" + def list_targets(self, message_id: str, queries: list = None): - api_path = '/messaging/messages/{messageId}/targets' api_params = {} if message_id is None: @@ -261,10 +241,8 @@ def list_targets(self, message_id, queries = None): 'content-type': 'application/json', }, api_params) - def list_providers(self, queries = None, search = None): - """List providers""" + def list_providers(self, queries: list = None, search: str = None): - api_path = '/messaging/providers' api_params = {} @@ -275,10 +253,8 @@ def list_providers(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, sandbox = None, enabled = None): - """Create APNS provider""" + def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None, enabled: bool = None): - api_path = '/messaging/providers/apns' api_params = {} if provider_id is None: @@ -301,10 +277,8 @@ def create_apns_provider(self, provider_id, name, auth_key = None, auth_key_id = 'content-type': 'application/json', }, api_params) - def update_apns_provider(self, provider_id, name = None, enabled = None, auth_key = None, auth_key_id = None, team_id = None, bundle_id = None, sandbox = None): - """Update APNS provider""" + def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool = None, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None): - api_path = '/messaging/providers/apns/{providerId}' api_params = {} if provider_id is None: @@ -324,10 +298,8 @@ def update_apns_provider(self, provider_id, name = None, enabled = None, auth_ke 'content-type': 'application/json', }, api_params) - def create_fcm_provider(self, provider_id, name, service_account_json = None, enabled = None): - """Create FCM provider""" + def create_fcm_provider(self, provider_id: str, name: str, service_account_json: dict = None, enabled: bool = None): - api_path = '/messaging/providers/fcm' api_params = {} if provider_id is None: @@ -346,10 +318,8 @@ def create_fcm_provider(self, provider_id, name, service_account_json = None, en 'content-type': 'application/json', }, api_params) - def update_fcm_provider(self, provider_id, name = None, enabled = None, service_account_json = None): - """Update FCM provider""" + def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool = None, service_account_json: dict = None): - api_path = '/messaging/providers/fcm/{providerId}' api_params = {} if provider_id is None: @@ -365,10 +335,8 @@ def update_fcm_provider(self, provider_id, name = None, enabled = None, service_ 'content-type': 'application/json', }, api_params) - def create_mailgun_provider(self, provider_id, name, api_key = None, domain = None, is_eu_region = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create Mailgun provider""" + def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = None, domain: str = None, is_eu_region: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): - api_path = '/messaging/providers/mailgun' api_params = {} if provider_id is None: @@ -393,10 +361,8 @@ def create_mailgun_provider(self, provider_id, name, api_key = None, domain = No 'content-type': 'application/json', }, api_params) - def update_mailgun_provider(self, provider_id, name = None, api_key = None, domain = None, is_eu_region = None, enabled = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): - """Update Mailgun provider""" + def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: str = None, domain: str = None, is_eu_region: bool = None, enabled: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None): - api_path = '/messaging/providers/mailgun/{providerId}' api_params = {} if provider_id is None: @@ -418,10 +384,8 @@ def update_mailgun_provider(self, provider_id, name = None, api_key = None, doma 'content-type': 'application/json', }, api_params) - def create_msg91_provider(self, provider_id, name, template_id = None, sender_id = None, auth_key = None, enabled = None): - """Create Msg91 provider""" + def create_msg91_provider(self, provider_id: str, name: str, template_id: str = None, sender_id: str = None, auth_key: str = None, enabled: bool = None): - api_path = '/messaging/providers/msg91' api_params = {} if provider_id is None: @@ -442,10 +406,8 @@ def create_msg91_provider(self, provider_id, name, template_id = None, sender_id 'content-type': 'application/json', }, api_params) - def update_msg91_provider(self, provider_id, name = None, enabled = None, template_id = None, sender_id = None, auth_key = None): - """Update Msg91 provider""" + def update_msg91_provider(self, provider_id: str, name: str = None, enabled: bool = None, template_id: str = None, sender_id: str = None, auth_key: str = None): - api_path = '/messaging/providers/msg91/{providerId}' api_params = {} if provider_id is None: @@ -463,10 +425,8 @@ def update_msg91_provider(self, provider_id, name = None, enabled = None, templa 'content-type': 'application/json', }, api_params) - def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create Sendgrid provider""" + def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): - api_path = '/messaging/providers/sendgrid' api_params = {} if provider_id is None: @@ -489,10 +449,8 @@ def create_sendgrid_provider(self, provider_id, name, api_key = None, from_name 'content-type': 'application/json', }, api_params) - def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api_key = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None): - """Update Sendgrid provider""" + def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None): - api_path = '/messaging/providers/sendgrid/{providerId}' api_params = {} if provider_id is None: @@ -512,10 +470,8 @@ def update_sendgrid_provider(self, provider_id, name = None, enabled = None, api 'content-type': 'application/json', }, api_params) - def create_smtp_provider(self, provider_id, name, host, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Create SMTP provider""" + def create_smtp_provider(self, provider_id: str, name: str, host: str, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): - api_path = '/messaging/providers/smtp' api_params = {} if provider_id is None: @@ -547,10 +503,8 @@ def create_smtp_provider(self, provider_id, name, host, port = None, username = 'content-type': 'application/json', }, api_params) - def update_smtp_provider(self, provider_id, name = None, host = None, port = None, username = None, password = None, encryption = None, auto_tls = None, mailer = None, from_name = None, from_email = None, reply_to_name = None, reply_to_email = None, enabled = None): - """Update SMTP provider""" + def update_smtp_provider(self, provider_id: str, name: str = None, host: str = None, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): - api_path = '/messaging/providers/smtp/{providerId}' api_params = {} if provider_id is None: @@ -576,10 +530,8 @@ def update_smtp_provider(self, provider_id, name = None, host = None, port = Non 'content-type': 'application/json', }, api_params) - def create_telesign_provider(self, provider_id, name, xfrom = None, customer_id = None, api_key = None, enabled = None): - """Create Telesign provider""" + def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = None, customer_id: str = None, api_key: str = None, enabled: bool = None): - api_path = '/messaging/providers/telesign' api_params = {} if provider_id is None: @@ -600,10 +552,8 @@ def create_telesign_provider(self, provider_id, name, xfrom = None, customer_id 'content-type': 'application/json', }, api_params) - def update_telesign_provider(self, provider_id, name = None, enabled = None, customer_id = None, api_key = None, xfrom = None): - """Update Telesign provider""" + def update_telesign_provider(self, provider_id: str, name: str = None, enabled: bool = None, customer_id: str = None, api_key: str = None, xfrom: str = None): - api_path = '/messaging/providers/telesign/{providerId}' api_params = {} if provider_id is None: @@ -621,10 +571,8 @@ def update_telesign_provider(self, provider_id, name = None, enabled = None, cus 'content-type': 'application/json', }, api_params) - def create_textmagic_provider(self, provider_id, name, xfrom = None, username = None, api_key = None, enabled = None): - """Create Textmagic provider""" + def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = None, username: str = None, api_key: str = None, enabled: bool = None): - api_path = '/messaging/providers/textmagic' api_params = {} if provider_id is None: @@ -645,10 +593,8 @@ def create_textmagic_provider(self, provider_id, name, xfrom = None, username = 'content-type': 'application/json', }, api_params) - def update_textmagic_provider(self, provider_id, name = None, enabled = None, username = None, api_key = None, xfrom = None): - """Update Textmagic provider""" + def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: bool = None, username: str = None, api_key: str = None, xfrom: str = None): - api_path = '/messaging/providers/textmagic/{providerId}' api_params = {} if provider_id is None: @@ -666,10 +612,8 @@ def update_textmagic_provider(self, provider_id, name = None, enabled = None, us 'content-type': 'application/json', }, api_params) - def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = None, auth_token = None, enabled = None): - """Create Twilio provider""" + def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, account_sid: str = None, auth_token: str = None, enabled: bool = None): - api_path = '/messaging/providers/twilio' api_params = {} if provider_id is None: @@ -690,10 +634,8 @@ def create_twilio_provider(self, provider_id, name, xfrom = None, account_sid = 'content-type': 'application/json', }, api_params) - def update_twilio_provider(self, provider_id, name = None, enabled = None, account_sid = None, auth_token = None, xfrom = None): - """Update Twilio provider""" + def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bool = None, account_sid: str = None, auth_token: str = None, xfrom: str = None): - api_path = '/messaging/providers/twilio/{providerId}' api_params = {} if provider_id is None: @@ -711,10 +653,8 @@ def update_twilio_provider(self, provider_id, name = None, enabled = None, accou 'content-type': 'application/json', }, api_params) - def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None, api_secret = None, enabled = None): - """Create Vonage provider""" + def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, api_key: str = None, api_secret: str = None, enabled: bool = None): - api_path = '/messaging/providers/vonage' api_params = {} if provider_id is None: @@ -735,10 +675,8 @@ def create_vonage_provider(self, provider_id, name, xfrom = None, api_key = None 'content-type': 'application/json', }, api_params) - def update_vonage_provider(self, provider_id, name = None, enabled = None, api_key = None, api_secret = None, xfrom = None): - """Update Vonage provider""" + def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, api_secret: str = None, xfrom: str = None): - api_path = '/messaging/providers/vonage/{providerId}' api_params = {} if provider_id is None: @@ -756,10 +694,8 @@ def update_vonage_provider(self, provider_id, name = None, enabled = None, api_k 'content-type': 'application/json', }, api_params) - def get_provider(self, provider_id): - """Get provider""" + def get_provider(self, provider_id: str): - api_path = '/messaging/providers/{providerId}' api_params = {} if provider_id is None: @@ -772,10 +708,8 @@ def get_provider(self, provider_id): 'content-type': 'application/json', }, api_params) - def delete_provider(self, provider_id): - """Delete provider""" + def delete_provider(self, provider_id: str): - api_path = '/messaging/providers/{providerId}' api_params = {} if provider_id is None: @@ -788,10 +722,8 @@ def delete_provider(self, provider_id): 'content-type': 'application/json', }, api_params) - def list_provider_logs(self, provider_id, queries = None): - """List provider logs""" + def list_provider_logs(self, provider_id: str, queries: list = None): - api_path = '/messaging/providers/{providerId}/logs' api_params = {} if provider_id is None: @@ -805,10 +737,8 @@ def list_provider_logs(self, provider_id, queries = None): 'content-type': 'application/json', }, api_params) - def list_subscriber_logs(self, subscriber_id, queries = None): - """List subscriber logs""" + def list_subscriber_logs(self, subscriber_id: str, queries: list = None): - api_path = '/messaging/subscribers/{subscriberId}/logs' api_params = {} if subscriber_id is None: @@ -822,10 +752,8 @@ def list_subscriber_logs(self, subscriber_id, queries = None): 'content-type': 'application/json', }, api_params) - def list_topics(self, queries = None, search = None): - """List topics""" + def list_topics(self, queries: list = None, search: str = None): - api_path = '/messaging/topics' api_params = {} @@ -836,10 +764,8 @@ def list_topics(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_topic(self, topic_id, name, subscribe = None): - """Create topic""" + def create_topic(self, topic_id: str, name: str, subscribe: list = None): - api_path = '/messaging/topics' api_params = {} if topic_id is None: @@ -857,10 +783,8 @@ def create_topic(self, topic_id, name, subscribe = None): 'content-type': 'application/json', }, api_params) - def get_topic(self, topic_id): - """Get topic""" + def get_topic(self, topic_id: str): - api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -873,10 +797,8 @@ def get_topic(self, topic_id): 'content-type': 'application/json', }, api_params) - def update_topic(self, topic_id, name = None, subscribe = None): - """Update topic""" + def update_topic(self, topic_id: str, name: str = None, subscribe: list = None): - api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -891,10 +813,8 @@ def update_topic(self, topic_id, name = None, subscribe = None): 'content-type': 'application/json', }, api_params) - def delete_topic(self, topic_id): - """Delete topic""" + def delete_topic(self, topic_id: str): - api_path = '/messaging/topics/{topicId}' api_params = {} if topic_id is None: @@ -907,10 +827,8 @@ def delete_topic(self, topic_id): 'content-type': 'application/json', }, api_params) - def list_topic_logs(self, topic_id, queries = None): - """List topic logs""" + def list_topic_logs(self, topic_id: str, queries: list = None): - api_path = '/messaging/topics/{topicId}/logs' api_params = {} if topic_id is None: @@ -924,10 +842,8 @@ def list_topic_logs(self, topic_id, queries = None): 'content-type': 'application/json', }, api_params) - def list_subscribers(self, topic_id, queries = None, search = None): - """List subscribers""" + def list_subscribers(self, topic_id: str, queries: list = None, search: str = None): - api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} if topic_id is None: @@ -942,10 +858,8 @@ def list_subscribers(self, topic_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_subscriber(self, topic_id, subscriber_id, target_id): - """Create subscriber""" + def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str): - api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} if topic_id is None: @@ -966,10 +880,8 @@ def create_subscriber(self, topic_id, subscriber_id, target_id): 'content-type': 'application/json', }, api_params) - def get_subscriber(self, topic_id, subscriber_id): - """Get subscriber""" + def get_subscriber(self, topic_id: str, subscriber_id: str): - api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} if topic_id is None: @@ -986,10 +898,8 @@ def get_subscriber(self, topic_id, subscriber_id): 'content-type': 'application/json', }, api_params) - def delete_subscriber(self, topic_id, subscriber_id): - """Delete subscriber""" + def delete_subscriber(self, topic_id: str, subscriber_id: str): - api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} if topic_id is None: diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 9acbb3a..0e57cfe 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -1,15 +1,17 @@ from ..service import Service from ..exception import AppwriteException +from ..enums.compression import Compression; +from ..input_file import InputFile +from ..enums.image_gravity import ImageGravity; +from ..enums.image_format import ImageFormat; class Storage(Service): def __init__(self, client): super(Storage, self).__init__(client) - def list_buckets(self, queries = None, search = None): - """List buckets""" + def list_buckets(self, queries: list = None, search: str = None): - api_path = '/storage/buckets' api_params = {} @@ -20,10 +22,8 @@ def list_buckets(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_bucket(self, bucket_id, name, permissions = None, file_security = None, enabled = None, maximum_file_size = None, allowed_file_extensions = None, compression = None, encryption = None, antivirus = None): - """Create bucket""" + def create_bucket(self, bucket_id: str, name: str, permissions: list = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): - api_path = '/storage/buckets' api_params = {} if bucket_id is None: @@ -48,10 +48,8 @@ def create_bucket(self, bucket_id, name, permissions = None, file_security = Non 'content-type': 'application/json', }, api_params) - def get_bucket(self, bucket_id): - """Get bucket""" + def get_bucket(self, bucket_id: str): - api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -64,10 +62,8 @@ def get_bucket(self, bucket_id): 'content-type': 'application/json', }, api_params) - def update_bucket(self, bucket_id, name, permissions = None, file_security = None, enabled = None, maximum_file_size = None, allowed_file_extensions = None, compression = None, encryption = None, antivirus = None): - """Update bucket""" + def update_bucket(self, bucket_id: str, name: str, permissions: list = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): - api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -92,10 +88,8 @@ def update_bucket(self, bucket_id, name, permissions = None, file_security = Non 'content-type': 'application/json', }, api_params) - def delete_bucket(self, bucket_id): - """Delete bucket""" + def delete_bucket(self, bucket_id: str): - api_path = '/storage/buckets/{bucketId}' api_params = {} if bucket_id is None: @@ -108,10 +102,8 @@ def delete_bucket(self, bucket_id): 'content-type': 'application/json', }, api_params) - def list_files(self, bucket_id, queries = None, search = None): - """List files""" + def list_files(self, bucket_id: str, queries: list = None, search: str = None): - api_path = '/storage/buckets/{bucketId}/files' api_params = {} if bucket_id is None: @@ -126,10 +118,8 @@ def list_files(self, bucket_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_file(self, bucket_id, file_id, file, permissions = None, on_progress = None): - """Create file""" + def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: list = None, on_progress = None): - api_path = '/storage/buckets/{bucketId}/files' api_params = {} if bucket_id is None: @@ -157,10 +147,8 @@ def create_file(self, bucket_id, file_id, file, permissions = None, on_progress 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_file(self, bucket_id, file_id): - """Get file""" + def get_file(self, bucket_id: str, file_id: str): - api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -177,10 +165,8 @@ def get_file(self, bucket_id, file_id): 'content-type': 'application/json', }, api_params) - def update_file(self, bucket_id, file_id, name = None, permissions = None): - """Update file""" + def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: list = None): - api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -199,10 +185,8 @@ def update_file(self, bucket_id, file_id, name = None, permissions = None): 'content-type': 'application/json', }, api_params) - def delete_file(self, bucket_id, file_id): - """Delete file""" + def delete_file(self, bucket_id: str, file_id: str): - api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} if bucket_id is None: @@ -219,10 +203,8 @@ def delete_file(self, bucket_id, file_id): 'content-type': 'application/json', }, api_params) - def get_file_download(self, bucket_id, file_id): - """Get file for download""" + def get_file_download(self, bucket_id: str, file_id: str): - api_path = '/storage/buckets/{bucketId}/files/{fileId}/download' api_params = {} if bucket_id is None: @@ -239,10 +221,8 @@ def get_file_download(self, bucket_id, file_id): 'content-type': 'application/json', }, api_params) - def get_file_preview(self, bucket_id, file_id, width = None, height = None, gravity = None, quality = None, border_width = None, border_color = None, border_radius = None, opacity = None, rotation = None, background = None, output = None): - """Get file preview""" + def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None): - api_path = '/storage/buckets/{bucketId}/files/{fileId}/preview' api_params = {} if bucket_id is None: @@ -270,10 +250,8 @@ def get_file_preview(self, bucket_id, file_id, width = None, height = None, grav 'content-type': 'application/json', }, api_params) - def get_file_view(self, bucket_id, file_id): - """Get file for view""" + def get_file_view(self, bucket_id: str, file_id: str): - api_path = '/storage/buckets/{bucketId}/files/{fileId}/view' api_params = {} if bucket_id is None: diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 2c387ed..988bf3c 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -6,10 +6,8 @@ class Teams(Service): def __init__(self, client): super(Teams, self).__init__(client) - def list(self, queries = None, search = None): - """List teams""" + def list(self, queries: list = None, search: str = None): - api_path = '/teams' api_params = {} @@ -20,10 +18,8 @@ def list(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create(self, team_id, name, roles = None): - """Create team""" + def create(self, team_id: str, name: str, roles: list = None): - api_path = '/teams' api_params = {} if team_id is None: @@ -41,10 +37,8 @@ def create(self, team_id, name, roles = None): 'content-type': 'application/json', }, api_params) - def get(self, team_id): - """Get team""" + def get(self, team_id: str): - api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -57,10 +51,8 @@ def get(self, team_id): 'content-type': 'application/json', }, api_params) - def update_name(self, team_id, name): - """Update name""" + def update_name(self, team_id: str, name: str): - api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -77,10 +69,8 @@ def update_name(self, team_id, name): 'content-type': 'application/json', }, api_params) - def delete(self, team_id): - """Delete team""" + def delete(self, team_id: str): - api_path = '/teams/{teamId}' api_params = {} if team_id is None: @@ -93,10 +83,8 @@ def delete(self, team_id): 'content-type': 'application/json', }, api_params) - def list_memberships(self, team_id, queries = None, search = None): - """List team memberships""" + def list_memberships(self, team_id: str, queries: list = None, search: str = None): - api_path = '/teams/{teamId}/memberships' api_params = {} if team_id is None: @@ -111,10 +99,8 @@ def list_memberships(self, team_id, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create_membership(self, team_id, roles, email = None, user_id = None, phone = None, url = None, name = None): - """Create team membership""" + def create_membership(self, team_id: str, roles: list, email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None): - api_path = '/teams/{teamId}/memberships' api_params = {} if team_id is None: @@ -136,10 +122,8 @@ def create_membership(self, team_id, roles, email = None, user_id = None, phone 'content-type': 'application/json', }, api_params) - def get_membership(self, team_id, membership_id): - """Get team membership""" + def get_membership(self, team_id: str, membership_id: str): - api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -156,10 +140,8 @@ def get_membership(self, team_id, membership_id): 'content-type': 'application/json', }, api_params) - def update_membership(self, team_id, membership_id, roles): - """Update membership""" + def update_membership(self, team_id: str, membership_id: str, roles: list): - api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -180,10 +162,8 @@ def update_membership(self, team_id, membership_id, roles): 'content-type': 'application/json', }, api_params) - def delete_membership(self, team_id, membership_id): - """Delete team membership""" + def delete_membership(self, team_id: str, membership_id: str): - api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} if team_id is None: @@ -200,10 +180,8 @@ def delete_membership(self, team_id, membership_id): 'content-type': 'application/json', }, api_params) - def update_membership_status(self, team_id, membership_id, user_id, secret): - """Update team membership status""" + def update_membership_status(self, team_id: str, membership_id: str, user_id: str, secret: str): - api_path = '/teams/{teamId}/memberships/{membershipId}/status' api_params = {} if team_id is None: @@ -228,10 +206,8 @@ def update_membership_status(self, team_id, membership_id, user_id, secret): 'content-type': 'application/json', }, api_params) - def get_prefs(self, team_id): - """Get team preferences""" + def get_prefs(self, team_id: str): - api_path = '/teams/{teamId}/prefs' api_params = {} if team_id is None: @@ -244,10 +220,8 @@ def get_prefs(self, team_id): 'content-type': 'application/json', }, api_params) - def update_prefs(self, team_id, prefs): - """Update preferences""" + def update_prefs(self, team_id: str, prefs: dict): - api_path = '/teams/{teamId}/prefs' api_params = {} if team_id is None: diff --git a/appwrite/services/users.py b/appwrite/services/users.py index aa04a72..1a141db 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -1,15 +1,16 @@ from ..service import Service from ..exception import AppwriteException +from ..enums.password_hash import PasswordHash; +from ..enums.authenticator_type import AuthenticatorType; +from ..enums.messaging_provider_type import MessagingProviderType; class Users(Service): def __init__(self, client): super(Users, self).__init__(client) - def list(self, queries = None, search = None): - """List users""" + def list(self, queries: list = None, search: str = None): - api_path = '/users' api_params = {} @@ -20,10 +21,8 @@ def list(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def create(self, user_id, email = None, phone = None, password = None, name = None): - """Create user""" + def create(self, user_id: str, email: str = None, phone: str = None, password: str = None, name: str = None): - api_path = '/users' api_params = {} if user_id is None: @@ -40,10 +39,8 @@ def create(self, user_id, email = None, phone = None, password = None, name = No 'content-type': 'application/json', }, api_params) - def create_argon2_user(self, user_id, email, password, name = None): - """Create user with Argon2 password""" + def create_argon2_user(self, user_id: str, email: str, password: str, name: str = None): - api_path = '/users/argon2' api_params = {} if user_id is None: @@ -65,10 +62,8 @@ def create_argon2_user(self, user_id, email, password, name = None): 'content-type': 'application/json', }, api_params) - def create_bcrypt_user(self, user_id, email, password, name = None): - """Create user with bcrypt password""" + def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str = None): - api_path = '/users/bcrypt' api_params = {} if user_id is None: @@ -90,10 +85,8 @@ def create_bcrypt_user(self, user_id, email, password, name = None): 'content-type': 'application/json', }, api_params) - def list_identities(self, queries = None, search = None): - """List identities""" + def list_identities(self, queries: list = None, search: str = None): - api_path = '/users/identities' api_params = {} @@ -104,10 +97,8 @@ def list_identities(self, queries = None, search = None): 'content-type': 'application/json', }, api_params) - def delete_identity(self, identity_id): - """Delete identity""" + def delete_identity(self, identity_id: str): - api_path = '/users/identities/{identityId}' api_params = {} if identity_id is None: @@ -120,10 +111,8 @@ def delete_identity(self, identity_id): 'content-type': 'application/json', }, api_params) - def create_md5_user(self, user_id, email, password, name = None): - """Create user with MD5 password""" + def create_md5_user(self, user_id: str, email: str, password: str, name: str = None): - api_path = '/users/md5' api_params = {} if user_id is None: @@ -145,10 +134,8 @@ def create_md5_user(self, user_id, email, password, name = None): 'content-type': 'application/json', }, api_params) - def create_ph_pass_user(self, user_id, email, password, name = None): - """Create user with PHPass password""" + def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str = None): - api_path = '/users/phpass' api_params = {} if user_id is None: @@ -170,10 +157,8 @@ def create_ph_pass_user(self, user_id, email, password, name = None): 'content-type': 'application/json', }, api_params) - def create_scrypt_user(self, user_id, email, password, password_salt, password_cpu, password_memory, password_parallel, password_length, name = None): - """Create user with Scrypt password""" + def create_scrypt_user(self, user_id: str, email: str, password: str, password_salt: str, password_cpu: float, password_memory: float, password_parallel: float, password_length: float, name: str = None): - api_path = '/users/scrypt' api_params = {} if user_id is None: @@ -215,10 +200,8 @@ def create_scrypt_user(self, user_id, email, password, password_salt, password_c 'content-type': 'application/json', }, api_params) - def create_scrypt_modified_user(self, user_id, email, password, password_salt, password_salt_separator, password_signer_key, name = None): - """Create user with Scrypt modified password""" + def create_scrypt_modified_user(self, user_id: str, email: str, password: str, password_salt: str, password_salt_separator: str, password_signer_key: str, name: str = None): - api_path = '/users/scrypt-modified' api_params = {} if user_id is None: @@ -252,10 +235,8 @@ def create_scrypt_modified_user(self, user_id, email, password, password_salt, p 'content-type': 'application/json', }, api_params) - def create_sha_user(self, user_id, email, password, password_version = None, name = None): - """Create user with SHA password""" + def create_sha_user(self, user_id: str, email: str, password: str, password_version: PasswordHash = None, name: str = None): - api_path = '/users/sha' api_params = {} if user_id is None: @@ -278,10 +259,8 @@ def create_sha_user(self, user_id, email, password, password_version = None, nam 'content-type': 'application/json', }, api_params) - def get(self, user_id): - """Get user""" + def get(self, user_id: str): - api_path = '/users/{userId}' api_params = {} if user_id is None: @@ -294,10 +273,8 @@ def get(self, user_id): 'content-type': 'application/json', }, api_params) - def delete(self, user_id): - """Delete user""" + def delete(self, user_id: str): - api_path = '/users/{userId}' api_params = {} if user_id is None: @@ -310,10 +287,8 @@ def delete(self, user_id): 'content-type': 'application/json', }, api_params) - def update_email(self, user_id, email): - """Update email""" + def update_email(self, user_id: str, email: str): - api_path = '/users/{userId}/email' api_params = {} if user_id is None: @@ -330,10 +305,8 @@ def update_email(self, user_id, email): 'content-type': 'application/json', }, api_params) - def create_jwt(self, user_id, session_id = None, duration = None): - """Create user JWT""" + def create_jwt(self, user_id: str, session_id: str = None, duration: float = None): - api_path = '/users/{userId}/jwts' api_params = {} if user_id is None: @@ -348,10 +321,8 @@ def create_jwt(self, user_id, session_id = None, duration = None): 'content-type': 'application/json', }, api_params) - def update_labels(self, user_id, labels): - """Update user labels""" + def update_labels(self, user_id: str, labels: list): - api_path = '/users/{userId}/labels' api_params = {} if user_id is None: @@ -368,10 +339,8 @@ def update_labels(self, user_id, labels): 'content-type': 'application/json', }, api_params) - def list_logs(self, user_id, queries = None): - """List user logs""" + def list_logs(self, user_id: str, queries: list = None): - api_path = '/users/{userId}/logs' api_params = {} if user_id is None: @@ -385,10 +354,8 @@ def list_logs(self, user_id, queries = None): 'content-type': 'application/json', }, api_params) - def list_memberships(self, user_id): - """List user memberships""" + def list_memberships(self, user_id: str): - api_path = '/users/{userId}/memberships' api_params = {} if user_id is None: @@ -401,10 +368,8 @@ def list_memberships(self, user_id): 'content-type': 'application/json', }, api_params) - def update_mfa(self, user_id, mfa): - """Update MFA""" + def update_mfa(self, user_id: str, mfa: bool): - api_path = '/users/{userId}/mfa' api_params = {} if user_id is None: @@ -421,10 +386,8 @@ def update_mfa(self, user_id, mfa): 'content-type': 'application/json', }, api_params) - def delete_mfa_authenticator(self, user_id, type): - """Delete authenticator""" + def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType): - api_path = '/users/{userId}/mfa/authenticators/{type}' api_params = {} if user_id is None: @@ -441,10 +404,8 @@ def delete_mfa_authenticator(self, user_id, type): 'content-type': 'application/json', }, api_params) - def list_mfa_factors(self, user_id): - """List factors""" + def list_mfa_factors(self, user_id: str): - api_path = '/users/{userId}/mfa/factors' api_params = {} if user_id is None: @@ -457,10 +418,8 @@ def list_mfa_factors(self, user_id): 'content-type': 'application/json', }, api_params) - def get_mfa_recovery_codes(self, user_id): - """Get MFA recovery codes""" + def get_mfa_recovery_codes(self, user_id: str): - api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -473,10 +432,8 @@ def get_mfa_recovery_codes(self, user_id): 'content-type': 'application/json', }, api_params) - def update_mfa_recovery_codes(self, user_id): - """Regenerate MFA recovery codes""" + def update_mfa_recovery_codes(self, user_id: str): - api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -489,10 +446,8 @@ def update_mfa_recovery_codes(self, user_id): 'content-type': 'application/json', }, api_params) - def create_mfa_recovery_codes(self, user_id): - """Create MFA recovery codes""" + def create_mfa_recovery_codes(self, user_id: str): - api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} if user_id is None: @@ -505,10 +460,8 @@ def create_mfa_recovery_codes(self, user_id): 'content-type': 'application/json', }, api_params) - def update_name(self, user_id, name): - """Update name""" + def update_name(self, user_id: str, name: str): - api_path = '/users/{userId}/name' api_params = {} if user_id is None: @@ -525,10 +478,8 @@ def update_name(self, user_id, name): 'content-type': 'application/json', }, api_params) - def update_password(self, user_id, password): - """Update password""" + def update_password(self, user_id: str, password: str): - api_path = '/users/{userId}/password' api_params = {} if user_id is None: @@ -545,10 +496,8 @@ def update_password(self, user_id, password): 'content-type': 'application/json', }, api_params) - def update_phone(self, user_id, number): - """Update phone""" + def update_phone(self, user_id: str, number: str): - api_path = '/users/{userId}/phone' api_params = {} if user_id is None: @@ -565,10 +514,8 @@ def update_phone(self, user_id, number): 'content-type': 'application/json', }, api_params) - def get_prefs(self, user_id): - """Get user preferences""" + def get_prefs(self, user_id: str): - api_path = '/users/{userId}/prefs' api_params = {} if user_id is None: @@ -581,10 +528,8 @@ def get_prefs(self, user_id): 'content-type': 'application/json', }, api_params) - def update_prefs(self, user_id, prefs): - """Update user preferences""" + def update_prefs(self, user_id: str, prefs: dict): - api_path = '/users/{userId}/prefs' api_params = {} if user_id is None: @@ -601,10 +546,8 @@ def update_prefs(self, user_id, prefs): 'content-type': 'application/json', }, api_params) - def list_sessions(self, user_id): - """List user sessions""" + def list_sessions(self, user_id: str): - api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -617,10 +560,8 @@ def list_sessions(self, user_id): 'content-type': 'application/json', }, api_params) - def create_session(self, user_id): - """Create session""" + def create_session(self, user_id: str): - api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -633,10 +574,8 @@ def create_session(self, user_id): 'content-type': 'application/json', }, api_params) - def delete_sessions(self, user_id): - """Delete user sessions""" + def delete_sessions(self, user_id: str): - api_path = '/users/{userId}/sessions' api_params = {} if user_id is None: @@ -649,10 +588,8 @@ def delete_sessions(self, user_id): 'content-type': 'application/json', }, api_params) - def delete_session(self, user_id, session_id): - """Delete user session""" + def delete_session(self, user_id: str, session_id: str): - api_path = '/users/{userId}/sessions/{sessionId}' api_params = {} if user_id is None: @@ -669,10 +606,8 @@ def delete_session(self, user_id, session_id): 'content-type': 'application/json', }, api_params) - def update_status(self, user_id, status): - """Update user status""" + def update_status(self, user_id: str, status: bool): - api_path = '/users/{userId}/status' api_params = {} if user_id is None: @@ -689,10 +624,8 @@ def update_status(self, user_id, status): 'content-type': 'application/json', }, api_params) - def list_targets(self, user_id, queries = None): - """List user targets""" + def list_targets(self, user_id: str, queries: list = None): - api_path = '/users/{userId}/targets' api_params = {} if user_id is None: @@ -706,10 +639,8 @@ def list_targets(self, user_id, queries = None): 'content-type': 'application/json', }, api_params) - def create_target(self, user_id, target_id, provider_type, identifier, provider_id = None, name = None): - """Create user target""" + def create_target(self, user_id: str, target_id: str, provider_type: MessagingProviderType, identifier: str, provider_id: str = None, name: str = None): - api_path = '/users/{userId}/targets' api_params = {} if user_id is None: @@ -736,10 +667,8 @@ def create_target(self, user_id, target_id, provider_type, identifier, provider_ 'content-type': 'application/json', }, api_params) - def get_target(self, user_id, target_id): - """Get user target""" + def get_target(self, user_id: str, target_id: str): - api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -756,10 +685,8 @@ def get_target(self, user_id, target_id): 'content-type': 'application/json', }, api_params) - def update_target(self, user_id, target_id, identifier = None, provider_id = None, name = None): - """Update user target""" + def update_target(self, user_id: str, target_id: str, identifier: str = None, provider_id: str = None, name: str = None): - api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -779,10 +706,8 @@ def update_target(self, user_id, target_id, identifier = None, provider_id = Non 'content-type': 'application/json', }, api_params) - def delete_target(self, user_id, target_id): - """Delete user target""" + def delete_target(self, user_id: str, target_id: str): - api_path = '/users/{userId}/targets/{targetId}' api_params = {} if user_id is None: @@ -799,10 +724,8 @@ def delete_target(self, user_id, target_id): 'content-type': 'application/json', }, api_params) - def create_token(self, user_id, length = None, expire = None): - """Create token""" + def create_token(self, user_id: str, length: float = None, expire: float = None): - api_path = '/users/{userId}/tokens' api_params = {} if user_id is None: @@ -817,10 +740,8 @@ def create_token(self, user_id, length = None, expire = None): 'content-type': 'application/json', }, api_params) - def update_email_verification(self, user_id, email_verification): - """Update email verification""" + def update_email_verification(self, user_id: str, email_verification: bool): - api_path = '/users/{userId}/verification' api_params = {} if user_id is None: @@ -837,10 +758,8 @@ def update_email_verification(self, user_id, email_verification): 'content-type': 'application/json', }, api_params) - def update_phone_verification(self, user_id, phone_verification): - """Update phone verification""" + def update_phone_verification(self, user_id: str, phone_verification: bool): - api_path = '/users/{userId}/verification/phone' api_params = {} if user_id is None: diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 8f8a35a..d16b9bb 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -13,8 +13,8 @@ result = databases.update_float_attribute( collection_id = '<COLLECTION_ID>', key = '', required = False, - min = None, - max = None, default = None, + min = None, # optional + max = None, # optional new_key = '' # optional ) diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 125cf82..ab0ccd6 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -13,8 +13,8 @@ result = databases.update_integer_attribute( collection_id = '<COLLECTION_ID>', key = '', required = False, - min = None, - max = None, default = None, + min = None, # optional + max = None, # optional new_key = '' # optional ) diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-stats-resources.md similarity index 88% rename from docs/examples/health/get-queue-usage-dump.md rename to docs/examples/health/get-queue-stats-resources.md index dabb79a..3b09342 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -8,6 +8,6 @@ client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) -result = health.get_queue_usage_dump( +result = health.get_queue_stats_resources( threshold = None # optional ) diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue-stats-usage-dump.md similarity index 79% rename from docs/examples/health/get-queue.md rename to docs/examples/health/get-queue-stats-usage-dump.md index aafe7c7..c58059e 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue-stats-usage-dump.md @@ -8,4 +8,6 @@ client.set_key('<YOUR_API_KEY>') # Your secret API key health = Health(client) -result = health.get_queue() +result = health.get_queue_stats_usage_dump( + threshold = None # optional +) diff --git a/setup.py b/setup.py index 558311d..40bc73f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '8.0.0' + version = '9.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/8.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.0.tar.gz', install_requires=[ 'requests', ], From 8e39f054b3e27cb9b792a0eb2fc347fdfb2f6d80 Mon Sep 17 00:00:00 2001 From: Christy Jacob <christyjacob4@gmail.com> Date: Mon, 10 Mar 2025 11:07:16 +0000 Subject: [PATCH 41/60] fix: missing types for lists, and missing doc blocks --- appwrite/client.py | 2 +- appwrite/services/account.py | 49 +++++++++++++++++++-- appwrite/services/avatars.py | 7 +++ appwrite/services/databases.py | 68 +++++++++++++++++++++++------ appwrite/services/functions.py | 34 ++++++++++++--- appwrite/services/graphql.py | 2 + appwrite/services/health.py | 23 ++++++++++ appwrite/services/locale.py | 8 ++++ appwrite/services/messaging.py | 80 ++++++++++++++++++++++++++-------- appwrite/services/storage.py | 25 ++++++++--- appwrite/services/teams.py | 23 +++++++--- appwrite/services/users.py | 52 +++++++++++++++++++--- 12 files changed, 318 insertions(+), 55 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index cd37ff9..4e04484 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,7 +13,7 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/9.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/9.0.0 ({os.uname().sysname}; {os.uname().version}; {os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 61f1f60..7c248f3 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -10,6 +10,7 @@ def __init__(self, client): super(Account, self).__init__(client) def get(self): + """Get account""" api_path = '/account' api_params = {} @@ -19,6 +20,7 @@ def get(self): }, api_params) def create(self, user_id: str, email: str, password: str, name: str = None): + """Create account""" api_path = '/account' api_params = {} @@ -42,6 +44,7 @@ def create(self, user_id: str, email: str, password: str, name: str = None): }, api_params) def update_email(self, email: str, password: str): + """Update email""" api_path = '/account/email' api_params = {} @@ -59,7 +62,8 @@ def update_email(self, email: str, password: str): 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: list = None): + def list_identities(self, queries: list[str] = None): + """List identities""" api_path = '/account/identities' api_params = {} @@ -71,6 +75,7 @@ def list_identities(self, queries: list = None): }, api_params) def delete_identity(self, identity_id: str): + """Delete identity""" api_path = '/account/identities/{identityId}' api_params = {} @@ -85,6 +90,7 @@ def delete_identity(self, identity_id: str): }, api_params) def create_jwt(self): + """Create JWT""" api_path = '/account/jwts' api_params = {} @@ -93,7 +99,8 @@ def create_jwt(self): 'content-type': 'application/json', }, api_params) - def list_logs(self, queries: list = None): + def list_logs(self, queries: list[str] = None): + """List logs""" api_path = '/account/logs' api_params = {} @@ -105,6 +112,7 @@ def list_logs(self, queries: list = None): }, api_params) def update_mfa(self, mfa: bool): + """Update MFA""" api_path = '/account/mfa' api_params = {} @@ -119,6 +127,7 @@ def update_mfa(self, mfa: bool): }, api_params) def create_mfa_authenticator(self, type: AuthenticatorType): + """Create authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} @@ -133,6 +142,7 @@ def create_mfa_authenticator(self, type: AuthenticatorType): }, api_params) def update_mfa_authenticator(self, type: AuthenticatorType, otp: str): + """Verify authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} @@ -151,6 +161,7 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str): }, api_params) def delete_mfa_authenticator(self, type: AuthenticatorType): + """Delete authenticator""" api_path = '/account/mfa/authenticators/{type}' api_params = {} @@ -165,6 +176,7 @@ def delete_mfa_authenticator(self, type: AuthenticatorType): }, api_params) def create_mfa_challenge(self, factor: AuthenticationFactor): + """Create MFA challenge""" api_path = '/account/mfa/challenge' api_params = {} @@ -179,6 +191,7 @@ def create_mfa_challenge(self, factor: AuthenticationFactor): }, api_params) def update_mfa_challenge(self, challenge_id: str, otp: str): + """Create MFA challenge (confirmation)""" api_path = '/account/mfa/challenge' api_params = {} @@ -197,6 +210,7 @@ def update_mfa_challenge(self, challenge_id: str, otp: str): }, api_params) def list_mfa_factors(self): + """List factors""" api_path = '/account/mfa/factors' api_params = {} @@ -206,6 +220,7 @@ def list_mfa_factors(self): }, api_params) def get_mfa_recovery_codes(self): + """Get MFA recovery codes""" api_path = '/account/mfa/recovery-codes' api_params = {} @@ -215,6 +230,7 @@ def get_mfa_recovery_codes(self): }, api_params) def create_mfa_recovery_codes(self): + """Create MFA recovery codes""" api_path = '/account/mfa/recovery-codes' api_params = {} @@ -224,6 +240,7 @@ def create_mfa_recovery_codes(self): }, api_params) def update_mfa_recovery_codes(self): + """Regenerate MFA recovery codes""" api_path = '/account/mfa/recovery-codes' api_params = {} @@ -233,6 +250,7 @@ def update_mfa_recovery_codes(self): }, api_params) def update_name(self, name: str): + """Update name""" api_path = '/account/name' api_params = {} @@ -247,6 +265,7 @@ def update_name(self, name: str): }, api_params) def update_password(self, password: str, old_password: str = None): + """Update password""" api_path = '/account/password' api_params = {} @@ -262,6 +281,7 @@ def update_password(self, password: str, old_password: str = None): }, api_params) def update_phone(self, phone: str, password: str): + """Update phone""" api_path = '/account/phone' api_params = {} @@ -280,6 +300,7 @@ def update_phone(self, phone: str, password: str): }, api_params) def get_prefs(self): + """Get account preferences""" api_path = '/account/prefs' api_params = {} @@ -289,6 +310,7 @@ def get_prefs(self): }, api_params) def update_prefs(self, prefs: dict): + """Update preferences""" api_path = '/account/prefs' api_params = {} @@ -303,6 +325,7 @@ def update_prefs(self, prefs: dict): }, api_params) def create_recovery(self, email: str, url: str): + """Create password recovery""" api_path = '/account/recovery' api_params = {} @@ -321,6 +344,7 @@ def create_recovery(self, email: str, url: str): }, api_params) def update_recovery(self, user_id: str, secret: str, password: str): + """Create password recovery (confirmation)""" api_path = '/account/recovery' api_params = {} @@ -343,6 +367,7 @@ def update_recovery(self, user_id: str, secret: str, password: str): }, api_params) def list_sessions(self): + """List sessions""" api_path = '/account/sessions' api_params = {} @@ -352,6 +377,7 @@ def list_sessions(self): }, api_params) def delete_sessions(self): + """Delete sessions""" api_path = '/account/sessions' api_params = {} @@ -361,6 +387,7 @@ def delete_sessions(self): }, api_params) def create_anonymous_session(self): + """Create anonymous session""" api_path = '/account/sessions/anonymous' api_params = {} @@ -370,6 +397,7 @@ def create_anonymous_session(self): }, api_params) def create_email_password_session(self, email: str, password: str): + """Create email password session""" api_path = '/account/sessions/email' api_params = {} @@ -388,6 +416,7 @@ def create_email_password_session(self, email: str, password: str): }, api_params) def update_magic_url_session(self, user_id: str, secret: str): + """Update magic URL session""" api_path = '/account/sessions/magic-url' api_params = {} @@ -406,6 +435,7 @@ def update_magic_url_session(self, user_id: str, secret: str): }, api_params) def update_phone_session(self, user_id: str, secret: str): + """Update phone session""" api_path = '/account/sessions/phone' api_params = {} @@ -424,6 +454,7 @@ def update_phone_session(self, user_id: str, secret: str): }, api_params) def create_session(self, user_id: str, secret: str): + """Create session""" api_path = '/account/sessions/token' api_params = {} @@ -442,6 +473,7 @@ def create_session(self, user_id: str, secret: str): }, api_params) def get_session(self, session_id: str): + """Get session""" api_path = '/account/sessions/{sessionId}' api_params = {} @@ -456,6 +488,7 @@ def get_session(self, session_id: str): }, api_params) def update_session(self, session_id: str): + """Update session""" api_path = '/account/sessions/{sessionId}' api_params = {} @@ -470,6 +503,7 @@ def update_session(self, session_id: str): }, api_params) def delete_session(self, session_id: str): + """Delete session""" api_path = '/account/sessions/{sessionId}' api_params = {} @@ -484,6 +518,7 @@ def delete_session(self, session_id: str): }, api_params) def update_status(self): + """Update status""" api_path = '/account/status' api_params = {} @@ -493,6 +528,7 @@ def update_status(self): }, api_params) def create_email_token(self, user_id: str, email: str, phrase: bool = None): + """Create email token (OTP)""" api_path = '/account/tokens/email' api_params = {} @@ -512,6 +548,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None): }, api_params) def create_magic_url_token(self, user_id: str, email: str, url: str = None, phrase: bool = None): + """Create magic URL token""" api_path = '/account/tokens/magic-url' api_params = {} @@ -531,7 +568,8 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra 'content-type': 'application/json', }, api_params) - def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: list = None): + def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: list[str] = None): + """Create OAuth2 token""" api_path = '/account/tokens/oauth2/{provider}' api_params = {} @@ -549,6 +587,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai }, api_params, response_type='location') def create_phone_token(self, user_id: str, phone: str): + """Create phone token""" api_path = '/account/tokens/phone' api_params = {} @@ -567,6 +606,7 @@ def create_phone_token(self, user_id: str, phone: str): }, api_params) def create_verification(self, url: str): + """Create email verification""" api_path = '/account/verification' api_params = {} @@ -581,6 +621,7 @@ def create_verification(self, url: str): }, api_params) def update_verification(self, user_id: str, secret: str): + """Create email verification (confirmation)""" api_path = '/account/verification' api_params = {} @@ -599,6 +640,7 @@ def update_verification(self, user_id: str, secret: str): }, api_params) def create_phone_verification(self): + """Create phone verification""" api_path = '/account/verification/phone' api_params = {} @@ -608,6 +650,7 @@ def create_phone_verification(self): }, api_params) def update_phone_verification(self, user_id: str, secret: str): + """Update phone verification (confirmation)""" api_path = '/account/verification/phone' api_params = {} diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index e4752a6..40a0abb 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -10,6 +10,7 @@ def __init__(self, client): super(Avatars, self).__init__(client) def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None): + """Get browser icon""" api_path = '/avatars/browsers/{code}' api_params = {} @@ -27,6 +28,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, }, api_params) def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None): + """Get credit card icon""" api_path = '/avatars/credit-cards/{code}' api_params = {} @@ -44,6 +46,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = }, api_params) def get_favicon(self, url: str): + """Get favicon""" api_path = '/avatars/favicon' api_params = {} @@ -58,6 +61,7 @@ def get_favicon(self, url: str): }, api_params) def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None): + """Get country flag""" api_path = '/avatars/flags/{code}' api_params = {} @@ -75,6 +79,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit }, api_params) def get_image(self, url: str, width: float = None, height: float = None): + """Get image from URL""" api_path = '/avatars/image' api_params = {} @@ -91,6 +96,7 @@ def get_image(self, url: str, width: float = None, height: float = None): }, api_params) def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None): + """Get user initials""" api_path = '/avatars/initials' api_params = {} @@ -105,6 +111,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No }, api_params) def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None): + """Get QR code""" api_path = '/avatars/qr' api_params = {} diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 85b2e86..e1c63b2 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -9,7 +9,8 @@ class Databases(Service): def __init__(self, client): super(Databases, self).__init__(client) - def list(self, queries: list = None, search: str = None): + def list(self, queries: list[str] = None, search: str = None): + """List databases""" api_path = '/databases' api_params = {} @@ -22,6 +23,7 @@ def list(self, queries: list = None, search: str = None): }, api_params) def create(self, database_id: str, name: str, enabled: bool = None): + """Create database""" api_path = '/databases' api_params = {} @@ -41,6 +43,7 @@ def create(self, database_id: str, name: str, enabled: bool = None): }, api_params) def get(self, database_id: str): + """Get database""" api_path = '/databases/{databaseId}' api_params = {} @@ -55,6 +58,7 @@ def get(self, database_id: str): }, api_params) def update(self, database_id: str, name: str, enabled: bool = None): + """Update database""" api_path = '/databases/{databaseId}' api_params = {} @@ -74,6 +78,7 @@ def update(self, database_id: str, name: str, enabled: bool = None): }, api_params) def delete(self, database_id: str): + """Delete database""" api_path = '/databases/{databaseId}' api_params = {} @@ -87,7 +92,8 @@ def delete(self, database_id: str): 'content-type': 'application/json', }, api_params) - def list_collections(self, database_id: str, queries: list = None, search: str = None): + def list_collections(self, database_id: str, queries: list[str] = None, search: str = None): + """List collections""" api_path = '/databases/{databaseId}/collections' api_params = {} @@ -103,7 +109,8 @@ def list_collections(self, database_id: str, queries: list = None, search: str = 'content-type': 'application/json', }, api_params) - def create_collection(self, database_id: str, collection_id: str, name: str, permissions: list = None, document_security: bool = None, enabled: bool = None): + def create_collection(self, database_id: str, collection_id: str, name: str, permissions: list[str] = None, document_security: bool = None, enabled: bool = None): + """Create collection""" api_path = '/databases/{databaseId}/collections' api_params = {} @@ -129,6 +136,7 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per }, api_params) def get_collection(self, database_id: str, collection_id: str): + """Get collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} @@ -146,7 +154,8 @@ def get_collection(self, database_id: str, collection_id: str): 'content-type': 'application/json', }, api_params) - def update_collection(self, database_id: str, collection_id: str, name: str, permissions: list = None, document_security: bool = None, enabled: bool = None): + def update_collection(self, database_id: str, collection_id: str, name: str, permissions: list[str] = None, document_security: bool = None, enabled: bool = None): + """Update collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} @@ -172,6 +181,7 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per }, api_params) def delete_collection(self, database_id: str, collection_id: str): + """Delete collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} @@ -189,7 +199,8 @@ def delete_collection(self, database_id: str, collection_id: str): 'content-type': 'application/json', }, api_params) - def list_attributes(self, database_id: str, collection_id: str, queries: list = None): + def list_attributes(self, database_id: str, collection_id: str, queries: list[str] = None): + """List attributes""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' api_params = {} @@ -209,6 +220,7 @@ def list_attributes(self, database_id: str, collection_id: str, queries: list = }, api_params) def create_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool = None, array: bool = None): + """Create boolean attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean' api_params = {} @@ -237,6 +249,7 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st }, api_params) def update_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool, new_key: str = None): + """Update boolean attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}' api_params = {} @@ -265,6 +278,7 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st }, api_params) def create_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): + """Create datetime attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime' api_params = {} @@ -293,6 +307,7 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s }, api_params) def update_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): + """Update dateTime attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}' api_params = {} @@ -321,6 +336,7 @@ def update_datetime_attribute(self, database_id: str, collection_id: str, key: s }, api_params) def create_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): + """Create email attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email' api_params = {} @@ -349,6 +365,7 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, }, api_params) def update_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): + """Update email attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}' api_params = {} @@ -376,7 +393,8 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list, required: bool, default: str = None, array: bool = None): + def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list[str], required: bool, default: str = None, array: bool = None): + """Create enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' api_params = {} @@ -408,7 +426,8 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list, required: bool, default: str, new_key: str = None): + def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list[str], required: bool, default: str, new_key: str = None): + """Update enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}' api_params = {} @@ -441,6 +460,7 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, }, api_params) def create_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None): + """Create float attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float' api_params = {} @@ -471,6 +491,7 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, }, api_params) def update_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None): + """Update float attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}' api_params = {} @@ -501,6 +522,7 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, }, api_params) def create_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None): + """Create integer attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer' api_params = {} @@ -531,6 +553,7 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st }, api_params) def update_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None): + """Update integer attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}' api_params = {} @@ -561,6 +584,7 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st }, api_params) def create_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): + """Create IP address attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip' api_params = {} @@ -589,6 +613,7 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re }, api_params) def update_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): + """Update IP address attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}' api_params = {} @@ -617,6 +642,7 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re }, api_params) def create_relationship_attribute(self, database_id: str, collection_id: str, related_collection_id: str, type: RelationshipType, two_way: bool = None, key: str = None, two_way_key: str = None, on_delete: RelationMutate = None): + """Create relationship attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship' api_params = {} @@ -647,6 +673,7 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re }, api_params) def create_string_attribute(self, database_id: str, collection_id: str, key: str, size: float, required: bool, default: str = None, array: bool = None, encrypt: bool = None): + """Create string attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string' api_params = {} @@ -680,6 +707,7 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str }, api_params) def update_string_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, size: float = None, new_key: str = None): + """Update string attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}' api_params = {} @@ -709,6 +737,7 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str }, api_params) def create_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): + """Create URL attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url' api_params = {} @@ -737,6 +766,7 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r }, api_params) def update_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): + """Update URL attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}' api_params = {} @@ -765,6 +795,7 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r }, api_params) def get_attribute(self, database_id: str, collection_id: str, key: str): + """Get attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} @@ -787,6 +818,7 @@ def get_attribute(self, database_id: str, collection_id: str, key: str): }, api_params) def delete_attribute(self, database_id: str, collection_id: str, key: str): + """Delete attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} @@ -809,6 +841,7 @@ def delete_attribute(self, database_id: str, collection_id: str, key: str): }, api_params) def update_relationship_attribute(self, database_id: str, collection_id: str, key: str, on_delete: RelationMutate = None, new_key: str = None): + """Update relationship attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship' api_params = {} @@ -832,7 +865,8 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke 'content-type': 'application/json', }, api_params) - def list_documents(self, database_id: str, collection_id: str, queries: list = None): + def list_documents(self, database_id: str, collection_id: str, queries: list[str] = None): + """List documents""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} @@ -851,7 +885,8 @@ def list_documents(self, database_id: str, collection_id: str, queries: list = N 'content-type': 'application/json', }, api_params) - def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: list = None): + def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: list[str] = None): + """Create document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} @@ -878,7 +913,8 @@ def create_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def get_document(self, database_id: str, collection_id: str, document_id: str, queries: list = None): + def get_document(self, database_id: str, collection_id: str, document_id: str, queries: list[str] = None): + """Get document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} @@ -901,7 +937,8 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q 'content-type': 'application/json', }, api_params) - def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: list = None): + def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: list[str] = None): + """Update document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} @@ -926,6 +963,7 @@ def update_document(self, database_id: str, collection_id: str, document_id: str }, api_params) def delete_document(self, database_id: str, collection_id: str, document_id: str): + """Delete document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} @@ -947,7 +985,8 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def list_indexes(self, database_id: str, collection_id: str, queries: list = None): + def list_indexes(self, database_id: str, collection_id: str, queries: list[str] = None): + """List indexes""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} @@ -966,7 +1005,8 @@ def list_indexes(self, database_id: str, collection_id: str, queries: list = Non 'content-type': 'application/json', }, api_params) - def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: list, orders: list = None): + def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: list[str], orders: list[str] = None): + """Create index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} @@ -998,6 +1038,7 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind }, api_params) def get_index(self, database_id: str, collection_id: str, key: str): + """Get index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} @@ -1020,6 +1061,7 @@ def get_index(self, database_id: str, collection_id: str, key: str): }, api_params) def delete_index(self, database_id: str, collection_id: str, key: str): + """Delete index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 326171c..6eb8bad 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -9,7 +9,8 @@ class Functions(Service): def __init__(self, client): super(Functions, self).__init__(client) - def list(self, queries: list = None, search: str = None): + def list(self, queries: list[str] = None, search: str = None): + """List functions""" api_path = '/functions' api_params = {} @@ -21,7 +22,8 @@ def list(self, queries: list = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id: str, name: str, runtime: Runtime, execute: list = None, events: list = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None): + def create(self, function_id: str, name: str, runtime: Runtime, execute: list[str] = None, events: list[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None): + """Create function""" api_path = '/functions' api_params = {} @@ -63,6 +65,7 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: list = }, api_params) def list_runtimes(self): + """List runtimes""" api_path = '/functions/runtimes' api_params = {} @@ -72,6 +75,7 @@ def list_runtimes(self): }, api_params) def list_specifications(self): + """List available function runtime specifications""" api_path = '/functions/specifications' api_params = {} @@ -81,6 +85,7 @@ def list_specifications(self): }, api_params) def get(self, function_id: str): + """Get function""" api_path = '/functions/{functionId}' api_params = {} @@ -94,7 +99,8 @@ def get(self, function_id: str): 'content-type': 'application/json', }, api_params) - def update(self, function_id: str, name: str, runtime: Runtime = None, execute: list = None, events: list = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None): + def update(self, function_id: str, name: str, runtime: Runtime = None, execute: list[str] = None, events: list[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None): + """Update function""" api_path = '/functions/{functionId}' api_params = {} @@ -129,6 +135,7 @@ def update(self, function_id: str, name: str, runtime: Runtime = None, execute: }, api_params) def delete(self, function_id: str): + """Delete function""" api_path = '/functions/{functionId}' api_params = {} @@ -142,7 +149,8 @@ def delete(self, function_id: str): 'content-type': 'application/json', }, api_params) - def list_deployments(self, function_id: str, queries: list = None, search: str = None): + def list_deployments(self, function_id: str, queries: list[str] = None, search: str = None): + """List deployments""" api_path = '/functions/{functionId}/deployments' api_params = {} @@ -159,6 +167,7 @@ def list_deployments(self, function_id: str, queries: list = None, search: str = }, api_params) def create_deployment(self, function_id: str, code: InputFile, activate: bool, entrypoint: str = None, commands: str = None, on_progress = None): + """Create deployment""" api_path = '/functions/{functionId}/deployments' api_params = {} @@ -188,6 +197,7 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e }, api_params, param_name, on_progress, upload_id) def get_deployment(self, function_id: str, deployment_id: str): + """Get deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} @@ -206,6 +216,7 @@ def get_deployment(self, function_id: str, deployment_id: str): }, api_params) def update_deployment(self, function_id: str, deployment_id: str): + """Update deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} @@ -224,6 +235,7 @@ def update_deployment(self, function_id: str, deployment_id: str): }, api_params) def delete_deployment(self, function_id: str, deployment_id: str): + """Delete deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} @@ -242,6 +254,7 @@ def delete_deployment(self, function_id: str, deployment_id: str): }, api_params) def create_build(self, function_id: str, deployment_id: str, build_id: str = None): + """Rebuild deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} @@ -261,6 +274,7 @@ def create_build(self, function_id: str, deployment_id: str, build_id: str = Non }, api_params) def update_deployment_build(self, function_id: str, deployment_id: str): + """Cancel deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} @@ -279,6 +293,7 @@ def update_deployment_build(self, function_id: str, deployment_id: str): }, api_params) def get_deployment_download(self, function_id: str, deployment_id: str): + """Download deployment""" api_path = '/functions/{functionId}/deployments/{deploymentId}/download' api_params = {} @@ -296,7 +311,8 @@ def get_deployment_download(self, function_id: str, deployment_id: str): 'content-type': 'application/json', }, api_params) - def list_executions(self, function_id: str, queries: list = None, search: str = None): + def list_executions(self, function_id: str, queries: list[str] = None, search: str = None): + """List executions""" api_path = '/functions/{functionId}/executions' api_params = {} @@ -313,6 +329,7 @@ def list_executions(self, function_id: str, queries: list = None, search: str = }, api_params) def create_execution(self, function_id: str, body: str = None, xasync: bool = None, path: str = None, method: ExecutionMethod = None, headers: dict = None, scheduled_at: str = None): + """Create execution""" api_path = '/functions/{functionId}/executions' api_params = {} @@ -333,6 +350,7 @@ def create_execution(self, function_id: str, body: str = None, xasync: bool = No }, api_params) def get_execution(self, function_id: str, execution_id: str): + """Get execution""" api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} @@ -351,6 +369,7 @@ def get_execution(self, function_id: str, execution_id: str): }, api_params) def delete_execution(self, function_id: str, execution_id: str): + """Delete execution""" api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} @@ -369,6 +388,7 @@ def delete_execution(self, function_id: str, execution_id: str): }, api_params) def list_variables(self, function_id: str): + """List variables""" api_path = '/functions/{functionId}/variables' api_params = {} @@ -383,6 +403,7 @@ def list_variables(self, function_id: str): }, api_params) def create_variable(self, function_id: str, key: str, value: str): + """Create variable""" api_path = '/functions/{functionId}/variables' api_params = {} @@ -405,6 +426,7 @@ def create_variable(self, function_id: str, key: str, value: str): }, api_params) def get_variable(self, function_id: str, variable_id: str): + """Get variable""" api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} @@ -423,6 +445,7 @@ def get_variable(self, function_id: str, variable_id: str): }, api_params) def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None): + """Update variable""" api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} @@ -446,6 +469,7 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s }, api_params) def delete_variable(self, function_id: str, variable_id: str): + """Delete variable""" api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 7d58b9e..41421bb 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -7,6 +7,7 @@ def __init__(self, client): super(Graphql, self).__init__(client) def query(self, query: dict): + """GraphQL endpoint""" api_path = '/graphql' api_params = {} @@ -22,6 +23,7 @@ def query(self, query: dict): }, api_params) def mutation(self, query: dict): + """GraphQL endpoint""" api_path = '/graphql/mutation' api_params = {} diff --git a/appwrite/services/health.py b/appwrite/services/health.py index 5be5d32..d87dc57 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -8,6 +8,7 @@ def __init__(self, client): super(Health, self).__init__(client) def get(self): + """Get HTTP""" api_path = '/health' api_params = {} @@ -17,6 +18,7 @@ def get(self): }, api_params) def get_antivirus(self): + """Get antivirus""" api_path = '/health/anti-virus' api_params = {} @@ -26,6 +28,7 @@ def get_antivirus(self): }, api_params) def get_cache(self): + """Get cache""" api_path = '/health/cache' api_params = {} @@ -35,6 +38,7 @@ def get_cache(self): }, api_params) def get_certificate(self, domain: str = None): + """Get the SSL certificate for a domain""" api_path = '/health/certificate' api_params = {} @@ -46,6 +50,7 @@ def get_certificate(self, domain: str = None): }, api_params) def get_db(self): + """Get DB""" api_path = '/health/db' api_params = {} @@ -55,6 +60,7 @@ def get_db(self): }, api_params) def get_pub_sub(self): + """Get pubsub""" api_path = '/health/pubsub' api_params = {} @@ -64,6 +70,7 @@ def get_pub_sub(self): }, api_params) def get_queue_builds(self, threshold: float = None): + """Get builds queue""" api_path = '/health/queue/builds' api_params = {} @@ -75,6 +82,7 @@ def get_queue_builds(self, threshold: float = None): }, api_params) def get_queue_certificates(self, threshold: float = None): + """Get certificates queue""" api_path = '/health/queue/certificates' api_params = {} @@ -86,6 +94,7 @@ def get_queue_certificates(self, threshold: float = None): }, api_params) def get_queue_databases(self, name: str = None, threshold: float = None): + """Get databases queue""" api_path = '/health/queue/databases' api_params = {} @@ -98,6 +107,7 @@ def get_queue_databases(self, name: str = None, threshold: float = None): }, api_params) def get_queue_deletes(self, threshold: float = None): + """Get deletes queue""" api_path = '/health/queue/deletes' api_params = {} @@ -109,6 +119,7 @@ def get_queue_deletes(self, threshold: float = None): }, api_params) def get_failed_jobs(self, name: Name, threshold: float = None): + """Get number of failed queue jobs""" api_path = '/health/queue/failed/{name}' api_params = {} @@ -124,6 +135,7 @@ def get_failed_jobs(self, name: Name, threshold: float = None): }, api_params) def get_queue_functions(self, threshold: float = None): + """Get functions queue""" api_path = '/health/queue/functions' api_params = {} @@ -135,6 +147,7 @@ def get_queue_functions(self, threshold: float = None): }, api_params) def get_queue_logs(self, threshold: float = None): + """Get logs queue""" api_path = '/health/queue/logs' api_params = {} @@ -146,6 +159,7 @@ def get_queue_logs(self, threshold: float = None): }, api_params) def get_queue_mails(self, threshold: float = None): + """Get mails queue""" api_path = '/health/queue/mails' api_params = {} @@ -157,6 +171,7 @@ def get_queue_mails(self, threshold: float = None): }, api_params) def get_queue_messaging(self, threshold: float = None): + """Get messaging queue""" api_path = '/health/queue/messaging' api_params = {} @@ -168,6 +183,7 @@ def get_queue_messaging(self, threshold: float = None): }, api_params) def get_queue_migrations(self, threshold: float = None): + """Get migrations queue""" api_path = '/health/queue/migrations' api_params = {} @@ -179,6 +195,7 @@ def get_queue_migrations(self, threshold: float = None): }, api_params) def get_queue_stats_resources(self, threshold: float = None): + """Get stats resources queue""" api_path = '/health/queue/stats-resources' api_params = {} @@ -190,6 +207,7 @@ def get_queue_stats_resources(self, threshold: float = None): }, api_params) def get_queue_usage(self, threshold: float = None): + """Get stats usage queue""" api_path = '/health/queue/stats-usage' api_params = {} @@ -201,6 +219,7 @@ def get_queue_usage(self, threshold: float = None): }, api_params) def get_queue_stats_usage_dump(self, threshold: float = None): + """Get usage dump queue""" api_path = '/health/queue/stats-usage-dump' api_params = {} @@ -212,6 +231,7 @@ def get_queue_stats_usage_dump(self, threshold: float = None): }, api_params) def get_queue_webhooks(self, threshold: float = None): + """Get webhooks queue""" api_path = '/health/queue/webhooks' api_params = {} @@ -223,6 +243,7 @@ def get_queue_webhooks(self, threshold: float = None): }, api_params) def get_storage(self): + """Get storage""" api_path = '/health/storage' api_params = {} @@ -232,6 +253,7 @@ def get_storage(self): }, api_params) def get_storage_local(self): + """Get local storage""" api_path = '/health/storage/local' api_params = {} @@ -241,6 +263,7 @@ def get_storage_local(self): }, api_params) def get_time(self): + """Get time""" api_path = '/health/time' api_params = {} diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index e77cd93..6a8f007 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -7,6 +7,7 @@ def __init__(self, client): super(Locale, self).__init__(client) def get(self): + """Get user locale""" api_path = '/locale' api_params = {} @@ -16,6 +17,7 @@ def get(self): }, api_params) def list_codes(self): + """List locale codes""" api_path = '/locale/codes' api_params = {} @@ -25,6 +27,7 @@ def list_codes(self): }, api_params) def list_continents(self): + """List continents""" api_path = '/locale/continents' api_params = {} @@ -34,6 +37,7 @@ def list_continents(self): }, api_params) def list_countries(self): + """List countries""" api_path = '/locale/countries' api_params = {} @@ -43,6 +47,7 @@ def list_countries(self): }, api_params) def list_countries_eu(self): + """List EU countries""" api_path = '/locale/countries/eu' api_params = {} @@ -52,6 +57,7 @@ def list_countries_eu(self): }, api_params) def list_countries_phones(self): + """List countries phone codes""" api_path = '/locale/countries/phones' api_params = {} @@ -61,6 +67,7 @@ def list_countries_phones(self): }, api_params) def list_currencies(self): + """List currencies""" api_path = '/locale/currencies' api_params = {} @@ -70,6 +77,7 @@ def list_currencies(self): }, api_params) def list_languages(self): + """List languages""" api_path = '/locale/languages' api_params = {} diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index b62a706..f344b9f 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -8,7 +8,8 @@ class Messaging(Service): def __init__(self, client): super(Messaging, self).__init__(client) - def list_messages(self, queries: list = None, search: str = None): + def list_messages(self, queries: list[str] = None, search: str = None): + """List messages""" api_path = '/messaging/messages' api_params = {} @@ -20,7 +21,8 @@ def list_messages(self, queries: list = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_email(self, message_id: str, subject: str, content: str, topics: list = None, users: list = None, targets: list = None, cc: list = None, bcc: list = None, attachments: list = None, draft: bool = None, html: bool = None, scheduled_at: str = None): + def create_email(self, message_id: str, subject: str, content: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, cc: list[str] = None, bcc: list[str] = None, attachments: list[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None): + """Create email""" api_path = '/messaging/messages/email' api_params = {} @@ -51,7 +53,8 @@ def create_email(self, message_id: str, subject: str, content: str, topics: list 'content-type': 'application/json', }, api_params) - def update_email(self, message_id: str, topics: list = None, users: list = None, targets: list = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: list = None, bcc: list = None, scheduled_at: str = None, attachments: list = None): + def update_email(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: list[str] = None, bcc: list[str] = None, scheduled_at: str = None, attachments: list[str] = None): + """Update email""" api_path = '/messaging/messages/email/{messageId}' api_params = {} @@ -76,7 +79,8 @@ def update_email(self, message_id: str, topics: list = None, users: list = None, 'content-type': 'application/json', }, api_params) - def create_push(self, message_id: str, title: str = None, body: str = None, topics: list = None, users: list = None, targets: list = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): + def create_push(self, message_id: str, title: str = None, body: str = None, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): + """Create push notification""" api_path = '/messaging/messages/push' api_params = {} @@ -108,7 +112,8 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi 'content-type': 'application/json', }, api_params) - def update_push(self, message_id: str, topics: list = None, users: list = None, targets: list = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): + def update_push(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): + """Update push notification""" api_path = '/messaging/messages/push/{messageId}' api_params = {} @@ -140,7 +145,8 @@ def update_push(self, message_id: str, topics: list = None, users: list = None, 'content-type': 'application/json', }, api_params) - def create_sms(self, message_id: str, content: str, topics: list = None, users: list = None, targets: list = None, draft: bool = None, scheduled_at: str = None): + def create_sms(self, message_id: str, content: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, draft: bool = None, scheduled_at: str = None): + """Create SMS""" api_path = '/messaging/messages/sms' api_params = {} @@ -163,7 +169,8 @@ def create_sms(self, message_id: str, content: str, topics: list = None, users: 'content-type': 'application/json', }, api_params) - def update_sms(self, message_id: str, topics: list = None, users: list = None, targets: list = None, content: str = None, draft: bool = None, scheduled_at: str = None): + def update_sms(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, content: str = None, draft: bool = None, scheduled_at: str = None): + """Update SMS""" api_path = '/messaging/messages/sms/{messageId}' api_params = {} @@ -184,6 +191,7 @@ def update_sms(self, message_id: str, topics: list = None, users: list = None, t }, api_params) def get_message(self, message_id: str): + """Get message""" api_path = '/messaging/messages/{messageId}' api_params = {} @@ -198,6 +206,7 @@ def get_message(self, message_id: str): }, api_params) def delete(self, message_id: str): + """Delete message""" api_path = '/messaging/messages/{messageId}' api_params = {} @@ -211,7 +220,8 @@ def delete(self, message_id: str): 'content-type': 'application/json', }, api_params) - def list_message_logs(self, message_id: str, queries: list = None): + def list_message_logs(self, message_id: str, queries: list[str] = None): + """List message logs""" api_path = '/messaging/messages/{messageId}/logs' api_params = {} @@ -226,7 +236,8 @@ def list_message_logs(self, message_id: str, queries: list = None): 'content-type': 'application/json', }, api_params) - def list_targets(self, message_id: str, queries: list = None): + def list_targets(self, message_id: str, queries: list[str] = None): + """List message targets""" api_path = '/messaging/messages/{messageId}/targets' api_params = {} @@ -241,7 +252,8 @@ def list_targets(self, message_id: str, queries: list = None): 'content-type': 'application/json', }, api_params) - def list_providers(self, queries: list = None, search: str = None): + def list_providers(self, queries: list[str] = None, search: str = None): + """List providers""" api_path = '/messaging/providers' api_params = {} @@ -254,6 +266,7 @@ def list_providers(self, queries: list = None, search: str = None): }, api_params) def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None, enabled: bool = None): + """Create APNS provider""" api_path = '/messaging/providers/apns' api_params = {} @@ -278,6 +291,7 @@ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None }, api_params) def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool = None, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None): + """Update APNS provider""" api_path = '/messaging/providers/apns/{providerId}' api_params = {} @@ -299,6 +313,7 @@ def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool }, api_params) def create_fcm_provider(self, provider_id: str, name: str, service_account_json: dict = None, enabled: bool = None): + """Create FCM provider""" api_path = '/messaging/providers/fcm' api_params = {} @@ -319,6 +334,7 @@ def create_fcm_provider(self, provider_id: str, name: str, service_account_json: }, api_params) def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool = None, service_account_json: dict = None): + """Update FCM provider""" api_path = '/messaging/providers/fcm/{providerId}' api_params = {} @@ -336,6 +352,7 @@ def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool }, api_params) def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = None, domain: str = None, is_eu_region: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): + """Create Mailgun provider""" api_path = '/messaging/providers/mailgun' api_params = {} @@ -362,6 +379,7 @@ def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = No }, api_params) def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: str = None, domain: str = None, is_eu_region: bool = None, enabled: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None): + """Update Mailgun provider""" api_path = '/messaging/providers/mailgun/{providerId}' api_params = {} @@ -385,6 +403,7 @@ def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: s }, api_params) def create_msg91_provider(self, provider_id: str, name: str, template_id: str = None, sender_id: str = None, auth_key: str = None, enabled: bool = None): + """Create Msg91 provider""" api_path = '/messaging/providers/msg91' api_params = {} @@ -407,6 +426,7 @@ def create_msg91_provider(self, provider_id: str, name: str, template_id: str = }, api_params) def update_msg91_provider(self, provider_id: str, name: str = None, enabled: bool = None, template_id: str = None, sender_id: str = None, auth_key: str = None): + """Update Msg91 provider""" api_path = '/messaging/providers/msg91/{providerId}' api_params = {} @@ -426,6 +446,7 @@ def update_msg91_provider(self, provider_id: str, name: str = None, enabled: boo }, api_params) def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): + """Create Sendgrid provider""" api_path = '/messaging/providers/sendgrid' api_params = {} @@ -450,6 +471,7 @@ def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = N }, api_params) def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None): + """Update Sendgrid provider""" api_path = '/messaging/providers/sendgrid/{providerId}' api_params = {} @@ -471,6 +493,7 @@ def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: }, api_params) def create_smtp_provider(self, provider_id: str, name: str, host: str, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): + """Create SMTP provider""" api_path = '/messaging/providers/smtp' api_params = {} @@ -504,6 +527,7 @@ def create_smtp_provider(self, provider_id: str, name: str, host: str, port: flo }, api_params) def update_smtp_provider(self, provider_id: str, name: str = None, host: str = None, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): + """Update SMTP provider""" api_path = '/messaging/providers/smtp/{providerId}' api_params = {} @@ -531,6 +555,7 @@ def update_smtp_provider(self, provider_id: str, name: str = None, host: str = N }, api_params) def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = None, customer_id: str = None, api_key: str = None, enabled: bool = None): + """Create Telesign provider""" api_path = '/messaging/providers/telesign' api_params = {} @@ -553,6 +578,7 @@ def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = Non }, api_params) def update_telesign_provider(self, provider_id: str, name: str = None, enabled: bool = None, customer_id: str = None, api_key: str = None, xfrom: str = None): + """Update Telesign provider""" api_path = '/messaging/providers/telesign/{providerId}' api_params = {} @@ -572,6 +598,7 @@ def update_telesign_provider(self, provider_id: str, name: str = None, enabled: }, api_params) def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = None, username: str = None, api_key: str = None, enabled: bool = None): + """Create Textmagic provider""" api_path = '/messaging/providers/textmagic' api_params = {} @@ -594,6 +621,7 @@ def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = No }, api_params) def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: bool = None, username: str = None, api_key: str = None, xfrom: str = None): + """Update Textmagic provider""" api_path = '/messaging/providers/textmagic/{providerId}' api_params = {} @@ -613,6 +641,7 @@ def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: }, api_params) def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, account_sid: str = None, auth_token: str = None, enabled: bool = None): + """Create Twilio provider""" api_path = '/messaging/providers/twilio' api_params = {} @@ -635,6 +664,7 @@ def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, }, api_params) def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bool = None, account_sid: str = None, auth_token: str = None, xfrom: str = None): + """Update Twilio provider""" api_path = '/messaging/providers/twilio/{providerId}' api_params = {} @@ -654,6 +684,7 @@ def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bo }, api_params) def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, api_key: str = None, api_secret: str = None, enabled: bool = None): + """Create Vonage provider""" api_path = '/messaging/providers/vonage' api_params = {} @@ -676,6 +707,7 @@ def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, }, api_params) def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, api_secret: str = None, xfrom: str = None): + """Update Vonage provider""" api_path = '/messaging/providers/vonage/{providerId}' api_params = {} @@ -695,6 +727,7 @@ def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bo }, api_params) def get_provider(self, provider_id: str): + """Get provider""" api_path = '/messaging/providers/{providerId}' api_params = {} @@ -709,6 +742,7 @@ def get_provider(self, provider_id: str): }, api_params) def delete_provider(self, provider_id: str): + """Delete provider""" api_path = '/messaging/providers/{providerId}' api_params = {} @@ -722,7 +756,8 @@ def delete_provider(self, provider_id: str): 'content-type': 'application/json', }, api_params) - def list_provider_logs(self, provider_id: str, queries: list = None): + def list_provider_logs(self, provider_id: str, queries: list[str] = None): + """List provider logs""" api_path = '/messaging/providers/{providerId}/logs' api_params = {} @@ -737,7 +772,8 @@ def list_provider_logs(self, provider_id: str, queries: list = None): 'content-type': 'application/json', }, api_params) - def list_subscriber_logs(self, subscriber_id: str, queries: list = None): + def list_subscriber_logs(self, subscriber_id: str, queries: list[str] = None): + """List subscriber logs""" api_path = '/messaging/subscribers/{subscriberId}/logs' api_params = {} @@ -752,7 +788,8 @@ def list_subscriber_logs(self, subscriber_id: str, queries: list = None): 'content-type': 'application/json', }, api_params) - def list_topics(self, queries: list = None, search: str = None): + def list_topics(self, queries: list[str] = None, search: str = None): + """List topics""" api_path = '/messaging/topics' api_params = {} @@ -764,7 +801,8 @@ def list_topics(self, queries: list = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_topic(self, topic_id: str, name: str, subscribe: list = None): + def create_topic(self, topic_id: str, name: str, subscribe: list[str] = None): + """Create topic""" api_path = '/messaging/topics' api_params = {} @@ -784,6 +822,7 @@ def create_topic(self, topic_id: str, name: str, subscribe: list = None): }, api_params) def get_topic(self, topic_id: str): + """Get topic""" api_path = '/messaging/topics/{topicId}' api_params = {} @@ -797,7 +836,8 @@ def get_topic(self, topic_id: str): 'content-type': 'application/json', }, api_params) - def update_topic(self, topic_id: str, name: str = None, subscribe: list = None): + def update_topic(self, topic_id: str, name: str = None, subscribe: list[str] = None): + """Update topic""" api_path = '/messaging/topics/{topicId}' api_params = {} @@ -814,6 +854,7 @@ def update_topic(self, topic_id: str, name: str = None, subscribe: list = None): }, api_params) def delete_topic(self, topic_id: str): + """Delete topic""" api_path = '/messaging/topics/{topicId}' api_params = {} @@ -827,7 +868,8 @@ def delete_topic(self, topic_id: str): 'content-type': 'application/json', }, api_params) - def list_topic_logs(self, topic_id: str, queries: list = None): + def list_topic_logs(self, topic_id: str, queries: list[str] = None): + """List topic logs""" api_path = '/messaging/topics/{topicId}/logs' api_params = {} @@ -842,7 +884,8 @@ def list_topic_logs(self, topic_id: str, queries: list = None): 'content-type': 'application/json', }, api_params) - def list_subscribers(self, topic_id: str, queries: list = None, search: str = None): + def list_subscribers(self, topic_id: str, queries: list[str] = None, search: str = None): + """List subscribers""" api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} @@ -859,6 +902,7 @@ def list_subscribers(self, topic_id: str, queries: list = None, search: str = No }, api_params) def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str): + """Create subscriber""" api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} @@ -881,6 +925,7 @@ def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str): }, api_params) def get_subscriber(self, topic_id: str, subscriber_id: str): + """Get subscriber""" api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} @@ -899,6 +944,7 @@ def get_subscriber(self, topic_id: str, subscriber_id: str): }, api_params) def delete_subscriber(self, topic_id: str, subscriber_id: str): + """Delete subscriber""" api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 0e57cfe..dc30df5 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -10,7 +10,8 @@ class Storage(Service): def __init__(self, client): super(Storage, self).__init__(client) - def list_buckets(self, queries: list = None, search: str = None): + def list_buckets(self, queries: list[str] = None, search: str = None): + """List buckets""" api_path = '/storage/buckets' api_params = {} @@ -22,7 +23,8 @@ def list_buckets(self, queries: list = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_bucket(self, bucket_id: str, name: str, permissions: list = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): + def create_bucket(self, bucket_id: str, name: str, permissions: list[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): + """Create bucket""" api_path = '/storage/buckets' api_params = {} @@ -49,6 +51,7 @@ def create_bucket(self, bucket_id: str, name: str, permissions: list = None, fil }, api_params) def get_bucket(self, bucket_id: str): + """Get bucket""" api_path = '/storage/buckets/{bucketId}' api_params = {} @@ -62,7 +65,8 @@ def get_bucket(self, bucket_id: str): 'content-type': 'application/json', }, api_params) - def update_bucket(self, bucket_id: str, name: str, permissions: list = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): + def update_bucket(self, bucket_id: str, name: str, permissions: list[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): + """Update bucket""" api_path = '/storage/buckets/{bucketId}' api_params = {} @@ -89,6 +93,7 @@ def update_bucket(self, bucket_id: str, name: str, permissions: list = None, fil }, api_params) def delete_bucket(self, bucket_id: str): + """Delete bucket""" api_path = '/storage/buckets/{bucketId}' api_params = {} @@ -102,7 +107,8 @@ def delete_bucket(self, bucket_id: str): 'content-type': 'application/json', }, api_params) - def list_files(self, bucket_id: str, queries: list = None, search: str = None): + def list_files(self, bucket_id: str, queries: list[str] = None, search: str = None): + """List files""" api_path = '/storage/buckets/{bucketId}/files' api_params = {} @@ -118,7 +124,8 @@ def list_files(self, bucket_id: str, queries: list = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: list = None, on_progress = None): + def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: list[str] = None, on_progress = None): + """Create file""" api_path = '/storage/buckets/{bucketId}/files' api_params = {} @@ -148,6 +155,7 @@ def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions }, api_params, param_name, on_progress, upload_id) def get_file(self, bucket_id: str, file_id: str): + """Get file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} @@ -165,7 +173,8 @@ def get_file(self, bucket_id: str, file_id: str): 'content-type': 'application/json', }, api_params) - def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: list = None): + def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: list[str] = None): + """Update file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} @@ -186,6 +195,7 @@ def update_file(self, bucket_id: str, file_id: str, name: str = None, permission }, api_params) def delete_file(self, bucket_id: str, file_id: str): + """Delete file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} @@ -204,6 +214,7 @@ def delete_file(self, bucket_id: str, file_id: str): }, api_params) def get_file_download(self, bucket_id: str, file_id: str): + """Get file for download""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/download' api_params = {} @@ -222,6 +233,7 @@ def get_file_download(self, bucket_id: str, file_id: str): }, api_params) def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None): + """Get file preview""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/preview' api_params = {} @@ -251,6 +263,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he }, api_params) def get_file_view(self, bucket_id: str, file_id: str): + """Get file for view""" api_path = '/storage/buckets/{bucketId}/files/{fileId}/view' api_params = {} diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 988bf3c..f157768 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -6,7 +6,8 @@ class Teams(Service): def __init__(self, client): super(Teams, self).__init__(client) - def list(self, queries: list = None, search: str = None): + def list(self, queries: list[str] = None, search: str = None): + """List teams""" api_path = '/teams' api_params = {} @@ -18,7 +19,8 @@ def list(self, queries: list = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, team_id: str, name: str, roles: list = None): + def create(self, team_id: str, name: str, roles: list[str] = None): + """Create team""" api_path = '/teams' api_params = {} @@ -38,6 +40,7 @@ def create(self, team_id: str, name: str, roles: list = None): }, api_params) def get(self, team_id: str): + """Get team""" api_path = '/teams/{teamId}' api_params = {} @@ -52,6 +55,7 @@ def get(self, team_id: str): }, api_params) def update_name(self, team_id: str, name: str): + """Update name""" api_path = '/teams/{teamId}' api_params = {} @@ -70,6 +74,7 @@ def update_name(self, team_id: str, name: str): }, api_params) def delete(self, team_id: str): + """Delete team""" api_path = '/teams/{teamId}' api_params = {} @@ -83,7 +88,8 @@ def delete(self, team_id: str): 'content-type': 'application/json', }, api_params) - def list_memberships(self, team_id: str, queries: list = None, search: str = None): + def list_memberships(self, team_id: str, queries: list[str] = None, search: str = None): + """List team memberships""" api_path = '/teams/{teamId}/memberships' api_params = {} @@ -99,7 +105,8 @@ def list_memberships(self, team_id: str, queries: list = None, search: str = Non 'content-type': 'application/json', }, api_params) - def create_membership(self, team_id: str, roles: list, email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None): + def create_membership(self, team_id: str, roles: list[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None): + """Create team membership""" api_path = '/teams/{teamId}/memberships' api_params = {} @@ -123,6 +130,7 @@ def create_membership(self, team_id: str, roles: list, email: str = None, user_i }, api_params) def get_membership(self, team_id: str, membership_id: str): + """Get team membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} @@ -140,7 +148,8 @@ def get_membership(self, team_id: str, membership_id: str): 'content-type': 'application/json', }, api_params) - def update_membership(self, team_id: str, membership_id: str, roles: list): + def update_membership(self, team_id: str, membership_id: str, roles: list[str]): + """Update membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} @@ -163,6 +172,7 @@ def update_membership(self, team_id: str, membership_id: str, roles: list): }, api_params) def delete_membership(self, team_id: str, membership_id: str): + """Delete team membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} @@ -181,6 +191,7 @@ def delete_membership(self, team_id: str, membership_id: str): }, api_params) def update_membership_status(self, team_id: str, membership_id: str, user_id: str, secret: str): + """Update team membership status""" api_path = '/teams/{teamId}/memberships/{membershipId}/status' api_params = {} @@ -207,6 +218,7 @@ def update_membership_status(self, team_id: str, membership_id: str, user_id: st }, api_params) def get_prefs(self, team_id: str): + """Get team preferences""" api_path = '/teams/{teamId}/prefs' api_params = {} @@ -221,6 +233,7 @@ def get_prefs(self, team_id: str): }, api_params) def update_prefs(self, team_id: str, prefs: dict): + """Update preferences""" api_path = '/teams/{teamId}/prefs' api_params = {} diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 1a141db..6ed17ee 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -9,7 +9,8 @@ class Users(Service): def __init__(self, client): super(Users, self).__init__(client) - def list(self, queries: list = None, search: str = None): + def list(self, queries: list[str] = None, search: str = None): + """List users""" api_path = '/users' api_params = {} @@ -22,6 +23,7 @@ def list(self, queries: list = None, search: str = None): }, api_params) def create(self, user_id: str, email: str = None, phone: str = None, password: str = None, name: str = None): + """Create user""" api_path = '/users' api_params = {} @@ -40,6 +42,7 @@ def create(self, user_id: str, email: str = None, phone: str = None, password: s }, api_params) def create_argon2_user(self, user_id: str, email: str, password: str, name: str = None): + """Create user with Argon2 password""" api_path = '/users/argon2' api_params = {} @@ -63,6 +66,7 @@ def create_argon2_user(self, user_id: str, email: str, password: str, name: str }, api_params) def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str = None): + """Create user with bcrypt password""" api_path = '/users/bcrypt' api_params = {} @@ -85,7 +89,8 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: list = None, search: str = None): + def list_identities(self, queries: list[str] = None, search: str = None): + """List identities""" api_path = '/users/identities' api_params = {} @@ -98,6 +103,7 @@ def list_identities(self, queries: list = None, search: str = None): }, api_params) def delete_identity(self, identity_id: str): + """Delete identity""" api_path = '/users/identities/{identityId}' api_params = {} @@ -112,6 +118,7 @@ def delete_identity(self, identity_id: str): }, api_params) def create_md5_user(self, user_id: str, email: str, password: str, name: str = None): + """Create user with MD5 password""" api_path = '/users/md5' api_params = {} @@ -135,6 +142,7 @@ def create_md5_user(self, user_id: str, email: str, password: str, name: str = N }, api_params) def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str = None): + """Create user with PHPass password""" api_path = '/users/phpass' api_params = {} @@ -158,6 +166,7 @@ def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str }, api_params) def create_scrypt_user(self, user_id: str, email: str, password: str, password_salt: str, password_cpu: float, password_memory: float, password_parallel: float, password_length: float, name: str = None): + """Create user with Scrypt password""" api_path = '/users/scrypt' api_params = {} @@ -201,6 +210,7 @@ def create_scrypt_user(self, user_id: str, email: str, password: str, password_s }, api_params) def create_scrypt_modified_user(self, user_id: str, email: str, password: str, password_salt: str, password_salt_separator: str, password_signer_key: str, name: str = None): + """Create user with Scrypt modified password""" api_path = '/users/scrypt-modified' api_params = {} @@ -236,6 +246,7 @@ def create_scrypt_modified_user(self, user_id: str, email: str, password: str, p }, api_params) def create_sha_user(self, user_id: str, email: str, password: str, password_version: PasswordHash = None, name: str = None): + """Create user with SHA password""" api_path = '/users/sha' api_params = {} @@ -260,6 +271,7 @@ def create_sha_user(self, user_id: str, email: str, password: str, password_vers }, api_params) def get(self, user_id: str): + """Get user""" api_path = '/users/{userId}' api_params = {} @@ -274,6 +286,7 @@ def get(self, user_id: str): }, api_params) def delete(self, user_id: str): + """Delete user""" api_path = '/users/{userId}' api_params = {} @@ -288,6 +301,7 @@ def delete(self, user_id: str): }, api_params) def update_email(self, user_id: str, email: str): + """Update email""" api_path = '/users/{userId}/email' api_params = {} @@ -306,6 +320,7 @@ def update_email(self, user_id: str, email: str): }, api_params) def create_jwt(self, user_id: str, session_id: str = None, duration: float = None): + """Create user JWT""" api_path = '/users/{userId}/jwts' api_params = {} @@ -321,7 +336,8 @@ def create_jwt(self, user_id: str, session_id: str = None, duration: float = Non 'content-type': 'application/json', }, api_params) - def update_labels(self, user_id: str, labels: list): + def update_labels(self, user_id: str, labels: list[str]): + """Update user labels""" api_path = '/users/{userId}/labels' api_params = {} @@ -339,7 +355,8 @@ def update_labels(self, user_id: str, labels: list): 'content-type': 'application/json', }, api_params) - def list_logs(self, user_id: str, queries: list = None): + def list_logs(self, user_id: str, queries: list[str] = None): + """List user logs""" api_path = '/users/{userId}/logs' api_params = {} @@ -355,6 +372,7 @@ def list_logs(self, user_id: str, queries: list = None): }, api_params) def list_memberships(self, user_id: str): + """List user memberships""" api_path = '/users/{userId}/memberships' api_params = {} @@ -369,6 +387,7 @@ def list_memberships(self, user_id: str): }, api_params) def update_mfa(self, user_id: str, mfa: bool): + """Update MFA""" api_path = '/users/{userId}/mfa' api_params = {} @@ -387,6 +406,7 @@ def update_mfa(self, user_id: str, mfa: bool): }, api_params) def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType): + """Delete authenticator""" api_path = '/users/{userId}/mfa/authenticators/{type}' api_params = {} @@ -405,6 +425,7 @@ def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType): }, api_params) def list_mfa_factors(self, user_id: str): + """List factors""" api_path = '/users/{userId}/mfa/factors' api_params = {} @@ -419,6 +440,7 @@ def list_mfa_factors(self, user_id: str): }, api_params) def get_mfa_recovery_codes(self, user_id: str): + """Get MFA recovery codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} @@ -433,6 +455,7 @@ def get_mfa_recovery_codes(self, user_id: str): }, api_params) def update_mfa_recovery_codes(self, user_id: str): + """Regenerate MFA recovery codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} @@ -447,6 +470,7 @@ def update_mfa_recovery_codes(self, user_id: str): }, api_params) def create_mfa_recovery_codes(self, user_id: str): + """Create MFA recovery codes""" api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} @@ -461,6 +485,7 @@ def create_mfa_recovery_codes(self, user_id: str): }, api_params) def update_name(self, user_id: str, name: str): + """Update name""" api_path = '/users/{userId}/name' api_params = {} @@ -479,6 +504,7 @@ def update_name(self, user_id: str, name: str): }, api_params) def update_password(self, user_id: str, password: str): + """Update password""" api_path = '/users/{userId}/password' api_params = {} @@ -497,6 +523,7 @@ def update_password(self, user_id: str, password: str): }, api_params) def update_phone(self, user_id: str, number: str): + """Update phone""" api_path = '/users/{userId}/phone' api_params = {} @@ -515,6 +542,7 @@ def update_phone(self, user_id: str, number: str): }, api_params) def get_prefs(self, user_id: str): + """Get user preferences""" api_path = '/users/{userId}/prefs' api_params = {} @@ -529,6 +557,7 @@ def get_prefs(self, user_id: str): }, api_params) def update_prefs(self, user_id: str, prefs: dict): + """Update user preferences""" api_path = '/users/{userId}/prefs' api_params = {} @@ -547,6 +576,7 @@ def update_prefs(self, user_id: str, prefs: dict): }, api_params) def list_sessions(self, user_id: str): + """List user sessions""" api_path = '/users/{userId}/sessions' api_params = {} @@ -561,6 +591,7 @@ def list_sessions(self, user_id: str): }, api_params) def create_session(self, user_id: str): + """Create session""" api_path = '/users/{userId}/sessions' api_params = {} @@ -575,6 +606,7 @@ def create_session(self, user_id: str): }, api_params) def delete_sessions(self, user_id: str): + """Delete user sessions""" api_path = '/users/{userId}/sessions' api_params = {} @@ -589,6 +621,7 @@ def delete_sessions(self, user_id: str): }, api_params) def delete_session(self, user_id: str, session_id: str): + """Delete user session""" api_path = '/users/{userId}/sessions/{sessionId}' api_params = {} @@ -607,6 +640,7 @@ def delete_session(self, user_id: str, session_id: str): }, api_params) def update_status(self, user_id: str, status: bool): + """Update user status""" api_path = '/users/{userId}/status' api_params = {} @@ -624,7 +658,8 @@ def update_status(self, user_id: str, status: bool): 'content-type': 'application/json', }, api_params) - def list_targets(self, user_id: str, queries: list = None): + def list_targets(self, user_id: str, queries: list[str] = None): + """List user targets""" api_path = '/users/{userId}/targets' api_params = {} @@ -640,6 +675,7 @@ def list_targets(self, user_id: str, queries: list = None): }, api_params) def create_target(self, user_id: str, target_id: str, provider_type: MessagingProviderType, identifier: str, provider_id: str = None, name: str = None): + """Create user target""" api_path = '/users/{userId}/targets' api_params = {} @@ -668,6 +704,7 @@ def create_target(self, user_id: str, target_id: str, provider_type: MessagingPr }, api_params) def get_target(self, user_id: str, target_id: str): + """Get user target""" api_path = '/users/{userId}/targets/{targetId}' api_params = {} @@ -686,6 +723,7 @@ def get_target(self, user_id: str, target_id: str): }, api_params) def update_target(self, user_id: str, target_id: str, identifier: str = None, provider_id: str = None, name: str = None): + """Update user target""" api_path = '/users/{userId}/targets/{targetId}' api_params = {} @@ -707,6 +745,7 @@ def update_target(self, user_id: str, target_id: str, identifier: str = None, pr }, api_params) def delete_target(self, user_id: str, target_id: str): + """Delete user target""" api_path = '/users/{userId}/targets/{targetId}' api_params = {} @@ -725,6 +764,7 @@ def delete_target(self, user_id: str, target_id: str): }, api_params) def create_token(self, user_id: str, length: float = None, expire: float = None): + """Create token""" api_path = '/users/{userId}/tokens' api_params = {} @@ -741,6 +781,7 @@ def create_token(self, user_id: str, length: float = None, expire: float = None) }, api_params) def update_email_verification(self, user_id: str, email_verification: bool): + """Update email verification""" api_path = '/users/{userId}/verification' api_params = {} @@ -759,6 +800,7 @@ def update_email_verification(self, user_id: str, email_verification: bool): }, api_params) def update_phone_verification(self, user_id: str, phone_verification: bool): + """Update phone verification""" api_path = '/users/{userId}/verification/phone' api_params = {} From 8bfb04dcefe37a1d3e2bef42f35fd72a80e0d15c Mon Sep 17 00:00:00 2001 From: Christy Jacob <christyjacob4@gmail.com> Date: Mon, 10 Mar 2025 12:50:09 +0000 Subject: [PATCH 42/60] fix: errors in typing for Python 3.13 --- .github/workflows/publish.yml | 2 +- appwrite/services/account.py | 7 ++++--- appwrite/services/avatars.py | 1 + appwrite/services/databases.py | 27 +++++++++++++------------- appwrite/services/functions.py | 11 ++++++----- appwrite/services/graphql.py | 1 + appwrite/services/health.py | 1 + appwrite/services/locale.py | 1 + appwrite/services/messaging.py | 35 +++++++++++++++++----------------- appwrite/services/storage.py | 13 +++++++------ appwrite/services/teams.py | 11 ++++++----- appwrite/services/users.py | 11 ++++++----- 12 files changed, 66 insertions(+), 55 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e8eca7b..d84d143 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.9' - name: Build package run: | diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 7c248f3..8344161 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.authenticator_type import AuthenticatorType; from ..enums.authentication_factor import AuthenticationFactor; @@ -62,7 +63,7 @@ def update_email(self, email: str, password: str): 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: list[str] = None): + def list_identities(self, queries: List[str] = None): """List identities""" api_path = '/account/identities' @@ -99,7 +100,7 @@ def create_jwt(self): 'content-type': 'application/json', }, api_params) - def list_logs(self, queries: list[str] = None): + def list_logs(self, queries: List[str] = None): """List logs""" api_path = '/account/logs' @@ -568,7 +569,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra 'content-type': 'application/json', }, api_params) - def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: list[str] = None): + def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: List[str] = None): """Create OAuth2 token""" api_path = '/account/tokens/oauth2/{provider}' diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 40a0abb..4220f35 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.browser import Browser; from ..enums.credit_card import CreditCard; diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index e1c63b2..08e8edf 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.relationship_type import RelationshipType; from ..enums.relation_mutate import RelationMutate; @@ -9,7 +10,7 @@ class Databases(Service): def __init__(self, client): super(Databases, self).__init__(client) - def list(self, queries: list[str] = None, search: str = None): + def list(self, queries: List[str] = None, search: str = None): """List databases""" api_path = '/databases' @@ -92,7 +93,7 @@ def delete(self, database_id: str): 'content-type': 'application/json', }, api_params) - def list_collections(self, database_id: str, queries: list[str] = None, search: str = None): + def list_collections(self, database_id: str, queries: List[str] = None, search: str = None): """List collections""" api_path = '/databases/{databaseId}/collections' @@ -109,7 +110,7 @@ def list_collections(self, database_id: str, queries: list[str] = None, search: 'content-type': 'application/json', }, api_params) - def create_collection(self, database_id: str, collection_id: str, name: str, permissions: list[str] = None, document_security: bool = None, enabled: bool = None): + def create_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None): """Create collection""" api_path = '/databases/{databaseId}/collections' @@ -154,7 +155,7 @@ def get_collection(self, database_id: str, collection_id: str): 'content-type': 'application/json', }, api_params) - def update_collection(self, database_id: str, collection_id: str, name: str, permissions: list[str] = None, document_security: bool = None, enabled: bool = None): + def update_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None): """Update collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' @@ -199,7 +200,7 @@ def delete_collection(self, database_id: str, collection_id: str): 'content-type': 'application/json', }, api_params) - def list_attributes(self, database_id: str, collection_id: str, queries: list[str] = None): + def list_attributes(self, database_id: str, collection_id: str, queries: List[str] = None): """List attributes""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' @@ -393,7 +394,7 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list[str], required: bool, default: str = None, array: bool = None): + def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None): """Create enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' @@ -426,7 +427,7 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list[str], required: bool, default: str, new_key: str = None): + def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str, new_key: str = None): """Update enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}' @@ -865,7 +866,7 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke 'content-type': 'application/json', }, api_params) - def list_documents(self, database_id: str, collection_id: str, queries: list[str] = None): + def list_documents(self, database_id: str, collection_id: str, queries: List[str] = None): """List documents""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' @@ -885,7 +886,7 @@ def list_documents(self, database_id: str, collection_id: str, queries: list[str 'content-type': 'application/json', }, api_params) - def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: list[str] = None): + def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None): """Create document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' @@ -913,7 +914,7 @@ def create_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def get_document(self, database_id: str, collection_id: str, document_id: str, queries: list[str] = None): + def get_document(self, database_id: str, collection_id: str, document_id: str, queries: List[str] = None): """Get document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' @@ -937,7 +938,7 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q 'content-type': 'application/json', }, api_params) - def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: list[str] = None): + def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: List[str] = None): """Update document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' @@ -985,7 +986,7 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def list_indexes(self, database_id: str, collection_id: str, queries: list[str] = None): + def list_indexes(self, database_id: str, collection_id: str, queries: List[str] = None): """List indexes""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' @@ -1005,7 +1006,7 @@ def list_indexes(self, database_id: str, collection_id: str, queries: list[str] 'content-type': 'application/json', }, api_params) - def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: list[str], orders: list[str] = None): + def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: List[str] = None): """Create index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 6eb8bad..0c990bd 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.runtime import Runtime; from ..input_file import InputFile @@ -9,7 +10,7 @@ class Functions(Service): def __init__(self, client): super(Functions, self).__init__(client) - def list(self, queries: list[str] = None, search: str = None): + def list(self, queries: List[str] = None, search: str = None): """List functions""" api_path = '/functions' @@ -22,7 +23,7 @@ def list(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id: str, name: str, runtime: Runtime, execute: list[str] = None, events: list[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None): + def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None): """Create function""" api_path = '/functions' @@ -99,7 +100,7 @@ def get(self, function_id: str): 'content-type': 'application/json', }, api_params) - def update(self, function_id: str, name: str, runtime: Runtime = None, execute: list[str] = None, events: list[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None): + def update(self, function_id: str, name: str, runtime: Runtime = None, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None): """Update function""" api_path = '/functions/{functionId}' @@ -149,7 +150,7 @@ def delete(self, function_id: str): 'content-type': 'application/json', }, api_params) - def list_deployments(self, function_id: str, queries: list[str] = None, search: str = None): + def list_deployments(self, function_id: str, queries: List[str] = None, search: str = None): """List deployments""" api_path = '/functions/{functionId}/deployments' @@ -311,7 +312,7 @@ def get_deployment_download(self, function_id: str, deployment_id: str): 'content-type': 'application/json', }, api_params) - def list_executions(self, function_id: str, queries: list[str] = None, search: str = None): + def list_executions(self, function_id: str, queries: List[str] = None, search: str = None): """List executions""" api_path = '/functions/{functionId}/executions' diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 41421bb..4a0fd36 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException class Graphql(Service): diff --git a/appwrite/services/health.py b/appwrite/services/health.py index d87dc57..014b536 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.name import Name; diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index 6a8f007..6c14eaf 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException class Locale(Service): diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index f344b9f..9b41d18 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.message_priority import MessagePriority; from ..enums.smtp_encryption import SmtpEncryption; @@ -8,7 +9,7 @@ class Messaging(Service): def __init__(self, client): super(Messaging, self).__init__(client) - def list_messages(self, queries: list[str] = None, search: str = None): + def list_messages(self, queries: List[str] = None, search: str = None): """List messages""" api_path = '/messaging/messages' @@ -21,7 +22,7 @@ def list_messages(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_email(self, message_id: str, subject: str, content: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, cc: list[str] = None, bcc: list[str] = None, attachments: list[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None): + def create_email(self, message_id: str, subject: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, cc: List[str] = None, bcc: List[str] = None, attachments: List[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None): """Create email""" api_path = '/messaging/messages/email' @@ -53,7 +54,7 @@ def create_email(self, message_id: str, subject: str, content: str, topics: list 'content-type': 'application/json', }, api_params) - def update_email(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: list[str] = None, bcc: list[str] = None, scheduled_at: str = None, attachments: list[str] = None): + def update_email(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: List[str] = None, bcc: List[str] = None, scheduled_at: str = None, attachments: List[str] = None): """Update email""" api_path = '/messaging/messages/email/{messageId}' @@ -79,7 +80,7 @@ def update_email(self, message_id: str, topics: list[str] = None, users: list[st 'content-type': 'application/json', }, api_params) - def create_push(self, message_id: str, title: str = None, body: str = None, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): + def create_push(self, message_id: str, title: str = None, body: str = None, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): """Create push notification""" api_path = '/messaging/messages/push' @@ -112,7 +113,7 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi 'content-type': 'application/json', }, api_params) - def update_push(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): + def update_push(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): """Update push notification""" api_path = '/messaging/messages/push/{messageId}' @@ -145,7 +146,7 @@ def update_push(self, message_id: str, topics: list[str] = None, users: list[str 'content-type': 'application/json', }, api_params) - def create_sms(self, message_id: str, content: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, draft: bool = None, scheduled_at: str = None): + def create_sms(self, message_id: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, draft: bool = None, scheduled_at: str = None): """Create SMS""" api_path = '/messaging/messages/sms' @@ -169,7 +170,7 @@ def create_sms(self, message_id: str, content: str, topics: list[str] = None, us 'content-type': 'application/json', }, api_params) - def update_sms(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, content: str = None, draft: bool = None, scheduled_at: str = None): + def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, content: str = None, draft: bool = None, scheduled_at: str = None): """Update SMS""" api_path = '/messaging/messages/sms/{messageId}' @@ -220,7 +221,7 @@ def delete(self, message_id: str): 'content-type': 'application/json', }, api_params) - def list_message_logs(self, message_id: str, queries: list[str] = None): + def list_message_logs(self, message_id: str, queries: List[str] = None): """List message logs""" api_path = '/messaging/messages/{messageId}/logs' @@ -236,7 +237,7 @@ def list_message_logs(self, message_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_targets(self, message_id: str, queries: list[str] = None): + def list_targets(self, message_id: str, queries: List[str] = None): """List message targets""" api_path = '/messaging/messages/{messageId}/targets' @@ -252,7 +253,7 @@ def list_targets(self, message_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_providers(self, queries: list[str] = None, search: str = None): + def list_providers(self, queries: List[str] = None, search: str = None): """List providers""" api_path = '/messaging/providers' @@ -756,7 +757,7 @@ def delete_provider(self, provider_id: str): 'content-type': 'application/json', }, api_params) - def list_provider_logs(self, provider_id: str, queries: list[str] = None): + def list_provider_logs(self, provider_id: str, queries: List[str] = None): """List provider logs""" api_path = '/messaging/providers/{providerId}/logs' @@ -772,7 +773,7 @@ def list_provider_logs(self, provider_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_subscriber_logs(self, subscriber_id: str, queries: list[str] = None): + def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None): """List subscriber logs""" api_path = '/messaging/subscribers/{subscriberId}/logs' @@ -788,7 +789,7 @@ def list_subscriber_logs(self, subscriber_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_topics(self, queries: list[str] = None, search: str = None): + def list_topics(self, queries: List[str] = None, search: str = None): """List topics""" api_path = '/messaging/topics' @@ -801,7 +802,7 @@ def list_topics(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_topic(self, topic_id: str, name: str, subscribe: list[str] = None): + def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None): """Create topic""" api_path = '/messaging/topics' @@ -836,7 +837,7 @@ def get_topic(self, topic_id: str): 'content-type': 'application/json', }, api_params) - def update_topic(self, topic_id: str, name: str = None, subscribe: list[str] = None): + def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = None): """Update topic""" api_path = '/messaging/topics/{topicId}' @@ -868,7 +869,7 @@ def delete_topic(self, topic_id: str): 'content-type': 'application/json', }, api_params) - def list_topic_logs(self, topic_id: str, queries: list[str] = None): + def list_topic_logs(self, topic_id: str, queries: List[str] = None): """List topic logs""" api_path = '/messaging/topics/{topicId}/logs' @@ -884,7 +885,7 @@ def list_topic_logs(self, topic_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_subscribers(self, topic_id: str, queries: list[str] = None, search: str = None): + def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str = None): """List subscribers""" api_path = '/messaging/topics/{topicId}/subscribers' diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index dc30df5..ac73261 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.compression import Compression; from ..input_file import InputFile @@ -10,7 +11,7 @@ class Storage(Service): def __init__(self, client): super(Storage, self).__init__(client) - def list_buckets(self, queries: list[str] = None, search: str = None): + def list_buckets(self, queries: List[str] = None, search: str = None): """List buckets""" api_path = '/storage/buckets' @@ -23,7 +24,7 @@ def list_buckets(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_bucket(self, bucket_id: str, name: str, permissions: list[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): + def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): """Create bucket""" api_path = '/storage/buckets' @@ -65,7 +66,7 @@ def get_bucket(self, bucket_id: str): 'content-type': 'application/json', }, api_params) - def update_bucket(self, bucket_id: str, name: str, permissions: list[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): + def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): """Update bucket""" api_path = '/storage/buckets/{bucketId}' @@ -107,7 +108,7 @@ def delete_bucket(self, bucket_id: str): 'content-type': 'application/json', }, api_params) - def list_files(self, bucket_id: str, queries: list[str] = None, search: str = None): + def list_files(self, bucket_id: str, queries: List[str] = None, search: str = None): """List files""" api_path = '/storage/buckets/{bucketId}/files' @@ -124,7 +125,7 @@ def list_files(self, bucket_id: str, queries: list[str] = None, search: str = No 'content-type': 'application/json', }, api_params) - def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: list[str] = None, on_progress = None): + def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: List[str] = None, on_progress = None): """Create file""" api_path = '/storage/buckets/{bucketId}/files' @@ -173,7 +174,7 @@ def get_file(self, bucket_id: str, file_id: str): 'content-type': 'application/json', }, api_params) - def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: list[str] = None): + def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: List[str] = None): """Update file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index f157768..fd28540 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException class Teams(Service): @@ -6,7 +7,7 @@ class Teams(Service): def __init__(self, client): super(Teams, self).__init__(client) - def list(self, queries: list[str] = None, search: str = None): + def list(self, queries: List[str] = None, search: str = None): """List teams""" api_path = '/teams' @@ -19,7 +20,7 @@ def list(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, team_id: str, name: str, roles: list[str] = None): + def create(self, team_id: str, name: str, roles: List[str] = None): """Create team""" api_path = '/teams' @@ -88,7 +89,7 @@ def delete(self, team_id: str): 'content-type': 'application/json', }, api_params) - def list_memberships(self, team_id: str, queries: list[str] = None, search: str = None): + def list_memberships(self, team_id: str, queries: List[str] = None, search: str = None): """List team memberships""" api_path = '/teams/{teamId}/memberships' @@ -105,7 +106,7 @@ def list_memberships(self, team_id: str, queries: list[str] = None, search: str 'content-type': 'application/json', }, api_params) - def create_membership(self, team_id: str, roles: list[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None): + def create_membership(self, team_id: str, roles: List[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None): """Create team membership""" api_path = '/teams/{teamId}/memberships' @@ -148,7 +149,7 @@ def get_membership(self, team_id: str, membership_id: str): 'content-type': 'application/json', }, api_params) - def update_membership(self, team_id: str, membership_id: str, roles: list[str]): + def update_membership(self, team_id: str, membership_id: str, roles: List[str]): """Update membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 6ed17ee..09155c3 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.password_hash import PasswordHash; from ..enums.authenticator_type import AuthenticatorType; @@ -9,7 +10,7 @@ class Users(Service): def __init__(self, client): super(Users, self).__init__(client) - def list(self, queries: list[str] = None, search: str = None): + def list(self, queries: List[str] = None, search: str = None): """List users""" api_path = '/users' @@ -89,7 +90,7 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: list[str] = None, search: str = None): + def list_identities(self, queries: List[str] = None, search: str = None): """List identities""" api_path = '/users/identities' @@ -336,7 +337,7 @@ def create_jwt(self, user_id: str, session_id: str = None, duration: float = Non 'content-type': 'application/json', }, api_params) - def update_labels(self, user_id: str, labels: list[str]): + def update_labels(self, user_id: str, labels: List[str]): """Update user labels""" api_path = '/users/{userId}/labels' @@ -355,7 +356,7 @@ def update_labels(self, user_id: str, labels: list[str]): 'content-type': 'application/json', }, api_params) - def list_logs(self, user_id: str, queries: list[str] = None): + def list_logs(self, user_id: str, queries: List[str] = None): """List user logs""" api_path = '/users/{userId}/logs' @@ -658,7 +659,7 @@ def update_status(self, user_id: str, status: bool): 'content-type': 'application/json', }, api_params) - def list_targets(self, user_id: str, queries: list[str] = None): + def list_targets(self, user_id: str, queries: List[str] = None): """List user targets""" api_path = '/users/{userId}/targets' From e28bc15f2d3e66debef625c594753ec4c13d571f Mon Sep 17 00:00:00 2001 From: Christy Jacob <christyjacob4@gmail.com> Date: Mon, 10 Mar 2025 12:53:37 +0000 Subject: [PATCH 43/60] fix: update python version --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index 4e04484..bc6853d 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/9.0.0 ({os.uname().sysname}; {os.uname().version}; {os.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/9.0.1 ({os.uname().sysname}; {os.uname().version}; {os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '9.0.0', + 'x-sdk-version': '9.0.1', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/setup.py b/setup.py index 40bc73f..5598001 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '9.0.0', + version = '9.0.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.1.tar.gz', install_requires=[ 'requests', ], From 1236cce15ec54974ee94a2ff71566785f4c5bafd Mon Sep 17 00:00:00 2001 From: Christy Jacob <christyjacob4@gmail.com> Date: Mon, 10 Mar 2025 19:05:58 +0000 Subject: [PATCH 44/60] feat: add platform agnostic uname() for user agent --- appwrite/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appwrite/client.py b/appwrite/client.py index bc6853d..5c95431 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -1,6 +1,7 @@ import io import json import os +import platform import requests from .input_file import InputFile from .exception import AppwriteException @@ -13,7 +14,7 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/9.0.1 ({os.uname().sysname}; {os.uname().version}; {os.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/9.0.1 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', From 7b23b5ff5b153af0f0f2b47690da1bac1968f405 Mon Sep 17 00:00:00 2001 From: Christy Jacob <christyjacob4@gmail.com> Date: Mon, 10 Mar 2025 19:07:14 +0000 Subject: [PATCH 45/60] feat: update version --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index 5c95431..b8885cd 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/9.0.1 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/9.0.2 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '9.0.1', + 'x-sdk-version': '9.0.2', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/setup.py b/setup.py index 5598001..d427818 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '9.0.1', + version = '9.0.2', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.2.tar.gz', install_requires=[ 'requests', ], From 784e5d97fb370f47abcdc9937752bf6098b389eb Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Tue, 25 Mar 2025 13:56:04 +0000 Subject: [PATCH 46/60] feat: add updated docstrings --- appwrite/client.py | 4 +- appwrite/services/account.py | 876 +++++++++++++++++--- appwrite/services/avatars.py | 198 ++++- appwrite/services/databases.py | 1194 ++++++++++++++++++++++++++-- appwrite/services/functions.py | 620 +++++++++++++-- appwrite/services/graphql.py | 44 +- appwrite/services/health.py | 429 ++++++++-- appwrite/services/locale.py | 126 ++- appwrite/services/messaging.py | 1364 +++++++++++++++++++++++++++++--- appwrite/services/storage.py | 359 ++++++++- appwrite/services/teams.py | 315 +++++++- appwrite/services/users.py | 979 +++++++++++++++++++++-- setup.py | 4 +- 13 files changed, 5960 insertions(+), 552 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index b8885cd..a65edeb 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/9.0.2 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/9.0.3 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '9.0.2', + 'x-sdk-version': '9.0.3', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 8344161..70b7eab 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -1,5 +1,5 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException from ..enums.authenticator_type import AuthenticatorType; from ..enums.authentication_factor import AuthenticationFactor; @@ -7,11 +7,22 @@ class Account(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Account, self).__init__(client) - def get(self): - """Get account""" + def get(self) -> Dict[str, Any]: + """ + Get the currently logged in user. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account' api_params = {} @@ -20,8 +31,30 @@ def get(self): 'content-type': 'application/json', }, api_params) - def create(self, user_id: str, email: str, password: str, name: str = None): - """Create account""" + def create(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + """ + Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + password : str + New user password. Must be between 8 and 256 chars. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account' api_params = {} @@ -44,8 +77,28 @@ def create(self, user_id: str, email: str, password: str, name: str = None): 'content-type': 'application/json', }, api_params) - def update_email(self, email: str, password: str): - """Update email""" + def update_email(self, email: str, password: str) -> Dict[str, Any]: + """ + Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. + This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + + Parameters + ---------- + email : str + User email. + password : str + User password. Must be at least 8 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/email' api_params = {} @@ -63,8 +116,24 @@ def update_email(self, email: str, password: str): 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: List[str] = None): - """List identities""" + def list_identities(self, queries: List[str] = None) -> Dict[str, Any]: + """ + Get the list of identities for the currently logged in user. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/identities' api_params = {} @@ -75,8 +144,24 @@ def list_identities(self, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def delete_identity(self, identity_id: str): - """Delete identity""" + def delete_identity(self, identity_id: str) -> Dict[str, Any]: + """ + Delete an identity by its unique ID. + Parameters + ---------- + identity_id : str + Identity ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/identities/{identityId}' api_params = {} @@ -90,8 +175,19 @@ def delete_identity(self, identity_id: str): 'content-type': 'application/json', }, api_params) - def create_jwt(self): - """Create JWT""" + def create_jwt(self) -> Dict[str, Any]: + """ + Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/jwts' api_params = {} @@ -100,8 +196,24 @@ def create_jwt(self): 'content-type': 'application/json', }, api_params) - def list_logs(self, queries: List[str] = None): - """List logs""" + def list_logs(self, queries: List[str] = None) -> Dict[str, Any]: + """ + Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/logs' api_params = {} @@ -112,8 +224,24 @@ def list_logs(self, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def update_mfa(self, mfa: bool): - """Update MFA""" + def update_mfa(self, mfa: bool) -> Dict[str, Any]: + """ + Enable or disable MFA on an account. + Parameters + ---------- + mfa : bool + Enable or disable MFA. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa' api_params = {} @@ -127,8 +255,24 @@ def update_mfa(self, mfa: bool): 'content-type': 'application/json', }, api_params) - def create_mfa_authenticator(self, type: AuthenticatorType): - """Create authenticator""" + def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: + """ + Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. + Parameters + ---------- + type : AuthenticatorType + Type of authenticator. Must be `totp` + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/authenticators/{type}' api_params = {} @@ -142,8 +286,26 @@ def create_mfa_authenticator(self, type: AuthenticatorType): 'content-type': 'application/json', }, api_params) - def update_mfa_authenticator(self, type: AuthenticatorType, otp: str): - """Verify authenticator""" + def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[str, Any]: + """ + Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. + Parameters + ---------- + type : AuthenticatorType + Type of authenticator. + otp : str + Valid verification token. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/authenticators/{type}' api_params = {} @@ -161,8 +323,24 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str): 'content-type': 'application/json', }, api_params) - def delete_mfa_authenticator(self, type: AuthenticatorType): - """Delete authenticator""" + def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: + """ + Delete an authenticator for a user by ID. + Parameters + ---------- + type : AuthenticatorType + Type of authenticator. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/authenticators/{type}' api_params = {} @@ -176,8 +354,24 @@ def delete_mfa_authenticator(self, type: AuthenticatorType): 'content-type': 'application/json', }, api_params) - def create_mfa_challenge(self, factor: AuthenticationFactor): - """Create MFA challenge""" + def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]: + """ + Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. + Parameters + ---------- + factor : AuthenticationFactor + Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/challenge' api_params = {} @@ -191,8 +385,26 @@ def create_mfa_challenge(self, factor: AuthenticationFactor): 'content-type': 'application/json', }, api_params) - def update_mfa_challenge(self, challenge_id: str, otp: str): - """Create MFA challenge (confirmation)""" + def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]: + """ + Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. + Parameters + ---------- + challenge_id : str + ID of the challenge. + otp : str + Valid verification token. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/challenge' api_params = {} @@ -210,8 +422,19 @@ def update_mfa_challenge(self, challenge_id: str, otp: str): 'content-type': 'application/json', }, api_params) - def list_mfa_factors(self): - """List factors""" + def list_mfa_factors(self) -> Dict[str, Any]: + """ + List the factors available on the account to be used as a MFA challange. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/factors' api_params = {} @@ -220,8 +443,19 @@ def list_mfa_factors(self): 'content-type': 'application/json', }, api_params) - def get_mfa_recovery_codes(self): - """Get MFA recovery codes""" + def get_mfa_recovery_codes(self) -> Dict[str, Any]: + """ + Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/recovery-codes' api_params = {} @@ -230,8 +464,19 @@ def get_mfa_recovery_codes(self): 'content-type': 'application/json', }, api_params) - def create_mfa_recovery_codes(self): - """Create MFA recovery codes""" + def create_mfa_recovery_codes(self) -> Dict[str, Any]: + """ + Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/recovery-codes' api_params = {} @@ -240,8 +485,19 @@ def create_mfa_recovery_codes(self): 'content-type': 'application/json', }, api_params) - def update_mfa_recovery_codes(self): - """Regenerate MFA recovery codes""" + def update_mfa_recovery_codes(self) -> Dict[str, Any]: + """ + Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/mfa/recovery-codes' api_params = {} @@ -250,8 +506,24 @@ def update_mfa_recovery_codes(self): 'content-type': 'application/json', }, api_params) - def update_name(self, name: str): - """Update name""" + def update_name(self, name: str) -> Dict[str, Any]: + """ + Update currently logged in user account name. + Parameters + ---------- + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/name' api_params = {} @@ -265,8 +537,26 @@ def update_name(self, name: str): 'content-type': 'application/json', }, api_params) - def update_password(self, password: str, old_password: str = None): - """Update password""" + def update_password(self, password: str, old_password: str = None) -> Dict[str, Any]: + """ + Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. + Parameters + ---------- + password : str + New user password. Must be at least 8 chars. + old_password : str + Current user password. Must be at least 8 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/password' api_params = {} @@ -281,8 +571,26 @@ def update_password(self, password: str, old_password: str = None): 'content-type': 'application/json', }, api_params) - def update_phone(self, phone: str, password: str): - """Update phone""" + def update_phone(self, phone: str, password: str) -> Dict[str, Any]: + """ + Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. + Parameters + ---------- + phone : str + Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + password : str + User password. Must be at least 8 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/phone' api_params = {} @@ -300,8 +608,19 @@ def update_phone(self, phone: str, password: str): 'content-type': 'application/json', }, api_params) - def get_prefs(self): - """Get account preferences""" + def get_prefs(self) -> Dict[str, Any]: + """ + Get the preferences as a key-value object for the currently logged in user. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/prefs' api_params = {} @@ -310,8 +629,24 @@ def get_prefs(self): 'content-type': 'application/json', }, api_params) - def update_prefs(self, prefs: dict): - """Update preferences""" + def update_prefs(self, prefs: dict) -> Dict[str, Any]: + """ + Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. + Parameters + ---------- + prefs : dict + Prefs key-value JSON object. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/prefs' api_params = {} @@ -325,8 +660,26 @@ def update_prefs(self, prefs: dict): 'content-type': 'application/json', }, api_params) - def create_recovery(self, email: str, url: str): - """Create password recovery""" + def create_recovery(self, email: str, url: str) -> Dict[str, Any]: + """ + Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. + Parameters + ---------- + email : str + User email. + url : str + URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/recovery' api_params = {} @@ -344,8 +697,30 @@ def create_recovery(self, email: str, url: str): 'content-type': 'application/json', }, api_params) - def update_recovery(self, user_id: str, secret: str, password: str): - """Create password recovery (confirmation)""" + def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str, Any]: + """ + Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint. + + Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + Parameters + ---------- + user_id : str + User ID. + secret : str + Valid reset token. + password : str + New user password. Must be between 8 and 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/recovery' api_params = {} @@ -367,8 +742,19 @@ def update_recovery(self, user_id: str, secret: str, password: str): 'content-type': 'application/json', }, api_params) - def list_sessions(self): - """List sessions""" + def list_sessions(self) -> Dict[str, Any]: + """ + Get the list of active sessions across different devices for the currently logged in user. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions' api_params = {} @@ -377,8 +763,19 @@ def list_sessions(self): 'content-type': 'application/json', }, api_params) - def delete_sessions(self): - """Delete sessions""" + def delete_sessions(self) -> Dict[str, Any]: + """ + Delete all sessions from the user account and remove any sessions cookies from the end client. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions' api_params = {} @@ -387,8 +784,19 @@ def delete_sessions(self): 'content-type': 'application/json', }, api_params) - def create_anonymous_session(self): - """Create anonymous session""" + def create_anonymous_session(self) -> Dict[str, Any]: + """ + Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session). + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions/anonymous' api_params = {} @@ -397,8 +805,28 @@ def create_anonymous_session(self): 'content-type': 'application/json', }, api_params) - def create_email_password_session(self, email: str, password: str): - """Create email password session""" + def create_email_password_session(self, email: str, password: str) -> Dict[str, Any]: + """ + Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. + + A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters + ---------- + email : str + User email. + password : str + User password. Must be at least 8 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions/email' api_params = {} @@ -416,8 +844,26 @@ def create_email_password_session(self, email: str, password: str): 'content-type': 'application/json', }, api_params) - def update_magic_url_session(self, user_id: str, secret: str): - """Update magic URL session""" + def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: + """ + Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + secret : str + Valid verification token. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions/magic-url' api_params = {} @@ -435,8 +881,26 @@ def update_magic_url_session(self, user_id: str, secret: str): 'content-type': 'application/json', }, api_params) - def update_phone_session(self, user_id: str, secret: str): - """Update phone session""" + def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]: + """ + Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + secret : str + Valid verification token. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions/phone' api_params = {} @@ -454,8 +918,26 @@ def update_phone_session(self, user_id: str, secret: str): 'content-type': 'application/json', }, api_params) - def create_session(self, user_id: str, secret: str): - """Create session""" + def create_session(self, user_id: str, secret: str) -> Dict[str, Any]: + """ + Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + secret : str + Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions/token' api_params = {} @@ -473,8 +955,24 @@ def create_session(self, user_id: str, secret: str): 'content-type': 'application/json', }, api_params) - def get_session(self, session_id: str): - """Get session""" + def get_session(self, session_id: str) -> Dict[str, Any]: + """ + Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. + Parameters + ---------- + session_id : str + Session ID. Use the string 'current' to get the current device session. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions/{sessionId}' api_params = {} @@ -488,8 +986,24 @@ def get_session(self, session_id: str): 'content-type': 'application/json', }, api_params) - def update_session(self, session_id: str): - """Update session""" + def update_session(self, session_id: str) -> Dict[str, Any]: + """ + Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. + Parameters + ---------- + session_id : str + Session ID. Use the string 'current' to update the current device session. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions/{sessionId}' api_params = {} @@ -503,8 +1017,24 @@ def update_session(self, session_id: str): 'content-type': 'application/json', }, api_params) - def delete_session(self, session_id: str): - """Delete session""" + def delete_session(self, session_id: str) -> Dict[str, Any]: + """ + Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. + Parameters + ---------- + session_id : str + Session ID. Use the string 'current' to delete the current device session. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/sessions/{sessionId}' api_params = {} @@ -518,8 +1048,19 @@ def delete_session(self, session_id: str): 'content-type': 'application/json', }, api_params) - def update_status(self): - """Update status""" + def update_status(self) -> Dict[str, Any]: + """ + Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/status' api_params = {} @@ -528,8 +1069,30 @@ def update_status(self): 'content-type': 'application/json', }, api_params) - def create_email_token(self, user_id: str, email: str, phrase: bool = None): - """Create email token (OTP)""" + def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> Dict[str, Any]: + """ + Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. + + A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + phrase : bool + Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/tokens/email' api_params = {} @@ -548,8 +1111,33 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None): 'content-type': 'application/json', }, api_params) - def create_magic_url_token(self, user_id: str, email: str, url: str = None, phrase: bool = None): - """Create magic URL token""" + def create_magic_url_token(self, user_id: str, email: str, url: str = None, phrase: bool = None) -> Dict[str, Any]: + """ + Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. + + A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + + Parameters + ---------- + user_id : str + Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + url : str + URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. + phrase : bool + Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/tokens/magic-url' api_params = {} @@ -569,8 +1157,34 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra 'content-type': 'application/json', }, api_params) - def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: List[str] = None): - """Create OAuth2 token""" + def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: List[str] = None) -> str: + """ + Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. + + If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. + + A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters + ---------- + provider : OAuthProvider + OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + success : str + URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. + failure : str + URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. + scopes : List[str] + A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. + + Returns + ------- + str + Authentication response as a string + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/tokens/oauth2/{provider}' api_params = {} @@ -587,8 +1201,28 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai 'content-type': 'application/json', }, api_params, response_type='location') - def create_phone_token(self, user_id: str, phone: str): - """Create phone token""" + def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]: + """ + Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. + + A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters + ---------- + user_id : str + Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + phone : str + Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/tokens/phone' api_params = {} @@ -606,8 +1240,27 @@ def create_phone_token(self, user_id: str, phone: str): 'content-type': 'application/json', }, api_params) - def create_verification(self, url: str): - """Create email verification""" + def create_verification(self, url: str) -> Dict[str, Any]: + """ + Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. + + Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + + Parameters + ---------- + url : str + URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/verification' api_params = {} @@ -621,8 +1274,26 @@ def create_verification(self, url: str): 'content-type': 'application/json', }, api_params) - def update_verification(self, user_id: str, secret: str): - """Create email verification (confirmation)""" + def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]: + """ + Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. + Parameters + ---------- + user_id : str + User ID. + secret : str + Valid verification token. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/verification' api_params = {} @@ -640,8 +1311,19 @@ def update_verification(self, user_id: str, secret: str): 'content-type': 'application/json', }, api_params) - def create_phone_verification(self): - """Create phone verification""" + def create_phone_verification(self) -> Dict[str, Any]: + """ + Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/verification/phone' api_params = {} @@ -650,8 +1332,26 @@ def create_phone_verification(self): 'content-type': 'application/json', }, api_params) - def update_phone_verification(self, user_id: str, secret: str): - """Update phone verification (confirmation)""" + def update_phone_verification(self, user_id: str, secret: str) -> Dict[str, Any]: + """ + Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. + Parameters + ---------- + user_id : str + User ID. + secret : str + Valid verification token. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/account/verification/phone' api_params = {} diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 4220f35..85e0e44 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -1,5 +1,5 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException from ..enums.browser import Browser; from ..enums.credit_card import CreditCard; @@ -7,11 +7,35 @@ class Avatars(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Avatars, self).__init__(client) - def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None): - """Get browser icon""" + def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]: + """ + You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. + + When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters + ---------- + code : Browser + Browser Code. + width : float + Image width. Pass an integer between 0 to 2000. Defaults to 100. + height : float + Image height. Pass an integer between 0 to 2000. Defaults to 100. + quality : float + Image quality. Pass an integer between 0 to 100. Defaults to 100. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/avatars/browsers/{code}' api_params = {} @@ -28,8 +52,33 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, 'content-type': 'application/json', }, api_params) - def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None): - """Get credit card icon""" + def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]: + """ + The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. + + When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + + Parameters + ---------- + code : CreditCard + Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay. + width : float + Image width. Pass an integer between 0 to 2000. Defaults to 100. + height : float + Image height. Pass an integer between 0 to 2000. Defaults to 100. + quality : float + Image quality. Pass an integer between 0 to 100. Defaults to 100. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/avatars/credit-cards/{code}' api_params = {} @@ -46,8 +95,26 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = 'content-type': 'application/json', }, api_params) - def get_favicon(self, url: str): - """Get favicon""" + def get_favicon(self, url: str) -> Dict[str, Any]: + """ + Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. + + This endpoint does not follow HTTP redirects. + Parameters + ---------- + url : str + Website URL which you want to fetch the favicon from. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/avatars/favicon' api_params = {} @@ -61,8 +128,33 @@ def get_favicon(self, url: str): 'content-type': 'application/json', }, api_params) - def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None): - """Get country flag""" + def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]: + """ + You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. + + When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + + Parameters + ---------- + code : Flag + Country Code. ISO Alpha-2 country code format. + width : float + Image width. Pass an integer between 0 to 2000. Defaults to 100. + height : float + Image height. Pass an integer between 0 to 2000. Defaults to 100. + quality : float + Image quality. Pass an integer between 0 to 100. Defaults to 100. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/avatars/flags/{code}' api_params = {} @@ -79,8 +171,32 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit 'content-type': 'application/json', }, api_params) - def get_image(self, url: str, width: float = None, height: float = None): - """Get image from URL""" + def get_image(self, url: str, width: float = None, height: float = None) -> Dict[str, Any]: + """ + Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. + + When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. + + This endpoint does not follow HTTP redirects. + Parameters + ---------- + url : str + Image URL which you want to crop. + width : float + Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. + height : float + Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/avatars/image' api_params = {} @@ -96,8 +212,35 @@ def get_image(self, url: str, width: float = None, height: float = None): 'content-type': 'application/json', }, api_params) - def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None): - """Get user initials""" + def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> Dict[str, Any]: + """ + Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. + + You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. + + When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + + Parameters + ---------- + name : str + Full Name. When empty, current user name or email will be used. Max length: 128 chars. + width : float + Image width. Pass an integer between 0 to 2000. Defaults to 100. + height : float + Image height. Pass an integer between 0 to 2000. Defaults to 100. + background : str + Changes background color. By default a random color will be picked and stay will persistent to the given name. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/avatars/initials' api_params = {} @@ -111,8 +254,31 @@ def get_initials(self, name: str = None, width: float = None, height: float = No 'content-type': 'application/json', }, api_params) - def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None): - """Get QR code""" + def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> Dict[str, Any]: + """ + Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. + + Parameters + ---------- + text : str + Plain text to be converted to QR code image. + size : float + QR code size. Pass an integer between 1 to 1000. Defaults to 400. + margin : float + Margin from edge. Pass an integer between 0 to 10. Defaults to 1. + download : bool + Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/avatars/qr' api_params = {} diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 08e8edf..583647a 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -1,5 +1,5 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException from ..enums.relationship_type import RelationshipType; from ..enums.relation_mutate import RelationMutate; @@ -7,11 +7,29 @@ class Databases(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Databases, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None): - """List databases""" + def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases' api_params = {} @@ -23,8 +41,29 @@ def list(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, database_id: str, name: str, enabled: bool = None): - """Create database""" + def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Database. + + Parameters + ---------- + database_id : str + Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Database name. Max length: 128 chars. + enabled : bool + Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases' api_params = {} @@ -43,8 +82,24 @@ def create(self, database_id: str, name: str, enabled: bool = None): 'content-type': 'application/json', }, api_params) - def get(self, database_id: str): - """Get database""" + def get(self, database_id: str) -> Dict[str, Any]: + """ + Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. + Parameters + ---------- + database_id : str + Database ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}' api_params = {} @@ -58,8 +113,28 @@ def get(self, database_id: str): 'content-type': 'application/json', }, api_params) - def update(self, database_id: str, name: str, enabled: bool = None): - """Update database""" + def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: + """ + Update a database by its unique ID. + Parameters + ---------- + database_id : str + Database ID. + name : str + Database name. Max length: 128 chars. + enabled : bool + Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}' api_params = {} @@ -78,8 +153,24 @@ def update(self, database_id: str, name: str, enabled: bool = None): 'content-type': 'application/json', }, api_params) - def delete(self, database_id: str): - """Delete database""" + def delete(self, database_id: str) -> Dict[str, Any]: + """ + Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. + Parameters + ---------- + database_id : str + Database ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}' api_params = {} @@ -93,8 +184,28 @@ def delete(self, database_id: str): 'content-type': 'application/json', }, api_params) - def list_collections(self, database_id: str, queries: List[str] = None, search: str = None): - """List collections""" + def list_collections(self, database_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. + Parameters + ---------- + database_id : str + Database ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections' api_params = {} @@ -110,8 +221,34 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: 'content-type': 'application/json', }, api_params) - def create_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None): - """Create collection""" + def create_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Collection name. Max length: 128 chars. + permissions : List[str] + An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + document_security : bool + Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + enabled : bool + Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections' api_params = {} @@ -136,8 +273,26 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per 'content-type': 'application/json', }, api_params) - def get_collection(self, database_id: str, collection_id: str): - """Get collection""" + def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any]: + """ + Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} @@ -155,8 +310,34 @@ def get_collection(self, database_id: str, collection_id: str): 'content-type': 'application/json', }, api_params) - def update_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None): - """Update collection""" + def update_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None) -> Dict[str, Any]: + """ + Update a collection by its unique ID. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + name : str + Collection name. Max length: 128 chars. + permissions : List[str] + An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + document_security : bool + Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + enabled : bool + Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} @@ -181,8 +362,26 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per 'content-type': 'application/json', }, api_params) - def delete_collection(self, database_id: str, collection_id: str): - """Delete collection""" + def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, Any]: + """ + Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}' api_params = {} @@ -200,8 +399,28 @@ def delete_collection(self, database_id: str, collection_id: str): 'content-type': 'application/json', }, api_params) - def list_attributes(self, database_id: str, collection_id: str, queries: List[str] = None): - """List attributes""" + def list_attributes(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + List attributes in the collection. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' api_params = {} @@ -220,8 +439,35 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st 'content-type': 'application/json', }, api_params) - def create_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool = None, array: bool = None): - """Create boolean attribute""" + def create_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool = None, array: bool = None) -> Dict[str, Any]: + """ + Create a boolean attribute. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : bool + Default value for attribute when not provided. Cannot be set when attribute is required. + array : bool + Is attribute an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean' api_params = {} @@ -249,8 +495,34 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def update_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool, new_key: str = None): - """Update boolean attribute""" + def update_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool, new_key: str = None) -> Dict[str, Any]: + """ + Update a boolean attribute. Changing the `default` value will not update already existing documents. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : bool + Default value for attribute when not provided. Cannot be set when attribute is required. + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}' api_params = {} @@ -278,8 +550,34 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def create_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): - """Create datetime attribute""" + def create_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create a date time attribute according to the ISO 8601 standard. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. + array : bool + Is attribute an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime' api_params = {} @@ -307,8 +605,34 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s 'content-type': 'application/json', }, api_params) - def update_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): - """Update dateTime attribute""" + def update_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update a date time attribute. Changing the `default` value will not update already existing documents. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}' api_params = {} @@ -336,8 +660,35 @@ def update_datetime_attribute(self, database_id: str, collection_id: str, key: s 'content-type': 'application/json', }, api_params) - def create_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): - """Create email attribute""" + def create_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create an email attribute. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + array : bool + Is attribute an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email' api_params = {} @@ -365,8 +716,35 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): - """Update email attribute""" + def update_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update an email attribute. Changing the `default` value will not update already existing documents. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}' api_params = {} @@ -394,8 +772,37 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None): - """Create enum attribute""" + def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + elements : List[str] + Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + array : bool + Is attribute an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' api_params = {} @@ -427,8 +834,37 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str, new_key: str = None): - """Update enum attribute""" + def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update an enum attribute. Changing the `default` value will not update already existing documents. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + elements : List[str] + Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}' api_params = {} @@ -460,8 +896,39 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None): - """Create float attribute""" + def create_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: + """ + Create a float attribute. Optionally, minimum and maximum values can be provided. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + min : float + Minimum value to enforce on new documents + max : float + Maximum value to enforce on new documents + default : float + Default value for attribute when not provided. Cannot be set when attribute is required. + array : bool + Is attribute an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float' api_params = {} @@ -491,8 +958,39 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None): - """Update float attribute""" + def update_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: + """ + Update a float attribute. Changing the `default` value will not update already existing documents. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : float + Default value for attribute when not provided. Cannot be set when attribute is required. + min : float + Minimum value to enforce on new documents + max : float + Maximum value to enforce on new documents + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}' api_params = {} @@ -522,8 +1020,39 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None): - """Create integer attribute""" + def create_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: + """ + Create an integer attribute. Optionally, minimum and maximum values can be provided. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + min : float + Minimum value to enforce on new documents + max : float + Maximum value to enforce on new documents + default : float + Default value for attribute when not provided. Cannot be set when attribute is required. + array : bool + Is attribute an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer' api_params = {} @@ -553,8 +1082,39 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def update_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None): - """Update integer attribute""" + def update_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: + """ + Update an integer attribute. Changing the `default` value will not update already existing documents. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : float + Default value for attribute when not provided. Cannot be set when attribute is required. + min : float + Minimum value to enforce on new documents + max : float + Maximum value to enforce on new documents + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}' api_params = {} @@ -584,8 +1144,35 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def create_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): - """Create IP address attribute""" + def create_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create IP address attribute. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + array : bool + Is attribute an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip' api_params = {} @@ -613,8 +1200,35 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re 'content-type': 'application/json', }, api_params) - def update_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): - """Update IP address attribute""" + def update_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update an ip attribute. Changing the `default` value will not update already existing documents. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}' api_params = {} @@ -642,8 +1256,39 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re 'content-type': 'application/json', }, api_params) - def create_relationship_attribute(self, database_id: str, collection_id: str, related_collection_id: str, type: RelationshipType, two_way: bool = None, key: str = None, two_way_key: str = None, on_delete: RelationMutate = None): - """Create relationship attribute""" + def create_relationship_attribute(self, database_id: str, collection_id: str, related_collection_id: str, type: RelationshipType, two_way: bool = None, key: str = None, two_way_key: str = None, on_delete: RelationMutate = None) -> Dict[str, Any]: + """ + Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + related_collection_id : str + Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + type : RelationshipType + Relation type + two_way : bool + Is Two Way? + key : str + Attribute Key. + two_way_key : str + Two Way Attribute Key. + on_delete : RelationMutate + Constraints option + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship' api_params = {} @@ -673,8 +1318,39 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re 'content-type': 'application/json', }, api_params) - def create_string_attribute(self, database_id: str, collection_id: str, key: str, size: float, required: bool, default: str = None, array: bool = None, encrypt: bool = None): - """Create string attribute""" + def create_string_attribute(self, database_id: str, collection_id: str, key: str, size: float, required: bool, default: str = None, array: bool = None, encrypt: bool = None) -> Dict[str, Any]: + """ + Create a string attribute. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + size : float + Attribute size for text attributes, in number of characters. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + array : bool + Is attribute an array? + encrypt : bool + Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string' api_params = {} @@ -707,8 +1383,37 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str 'content-type': 'application/json', }, api_params) - def update_string_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, size: float = None, new_key: str = None): - """Update string attribute""" + def update_string_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, size: float = None, new_key: str = None) -> Dict[str, Any]: + """ + Update a string attribute. Changing the `default` value will not update already existing documents. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + size : float + Maximum size of the string attribute. + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}' api_params = {} @@ -737,8 +1442,35 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str 'content-type': 'application/json', }, api_params) - def create_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None): - """Create URL attribute""" + def create_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create a URL attribute. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + array : bool + Is attribute an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url' api_params = {} @@ -766,8 +1498,35 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r 'content-type': 'application/json', }, api_params) - def update_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None): - """Update URL attribute""" + def update_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update an url attribute. Changing the `default` value will not update already existing documents. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + required : bool + Is attribute required? + default : str + Default value for attribute when not provided. Cannot be set when attribute is required. + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}' api_params = {} @@ -795,8 +1554,28 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r 'content-type': 'application/json', }, api_params) - def get_attribute(self, database_id: str, collection_id: str, key: str): - """Get attribute""" + def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: + """ + Get attribute by ID. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} @@ -818,8 +1597,28 @@ def get_attribute(self, database_id: str, collection_id: str, key: str): 'content-type': 'application/json', }, api_params) - def delete_attribute(self, database_id: str, collection_id: str, key: str): - """Delete attribute""" + def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: + """ + Deletes an attribute. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' api_params = {} @@ -841,8 +1640,33 @@ def delete_attribute(self, database_id: str, collection_id: str, key: str): 'content-type': 'application/json', }, api_params) - def update_relationship_attribute(self, database_id: str, collection_id: str, key: str, on_delete: RelationMutate = None, new_key: str = None): - """Update relationship attribute""" + def update_relationship_attribute(self, database_id: str, collection_id: str, key: str, on_delete: RelationMutate = None, new_key: str = None) -> Dict[str, Any]: + """ + Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Attribute Key. + on_delete : RelationMutate + Constraints option + new_key : str + New attribute key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship' api_params = {} @@ -866,8 +1690,28 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke 'content-type': 'application/json', }, api_params) - def list_documents(self, database_id: str, collection_id: str, queries: List[str] = None): - """List documents""" + def list_documents(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} @@ -886,8 +1730,33 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str 'content-type': 'application/json', }, api_params) - def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None): - """Create document""" + def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None) -> Dict[str, Any]: + """ + Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + document_id : str + Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + data : dict + Document data as JSON object. + permissions : List[str] + An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/documents' api_params = {} @@ -914,8 +1783,30 @@ def create_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def get_document(self, database_id: str, collection_id: str, document_id: str, queries: List[str] = None): - """Get document""" + def get_document(self, database_id: str, collection_id: str, document_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + document_id : str + Document ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} @@ -938,8 +1829,32 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q 'content-type': 'application/json', }, api_params) - def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: List[str] = None): - """Update document""" + def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: List[str] = None) -> Dict[str, Any]: + """ + Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + document_id : str + Document ID. + data : dict + Document data as JSON object. Include only attribute and value pairs to be updated. + permissions : List[str] + An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} @@ -963,8 +1878,28 @@ def update_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def delete_document(self, database_id: str, collection_id: str, document_id: str): - """Delete document""" + def delete_document(self, database_id: str, collection_id: str, document_id: str) -> Dict[str, Any]: + """ + Delete a document by its unique ID. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + document_id : str + Document ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' api_params = {} @@ -986,8 +1921,28 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def list_indexes(self, database_id: str, collection_id: str, queries: List[str] = None): - """List indexes""" + def list_indexes(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + List indexes in the collection. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} @@ -1006,8 +1961,35 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] 'content-type': 'application/json', }, api_params) - def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: List[str] = None): - """Create index""" + def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: List[str] = None) -> Dict[str, Any]: + """ + Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. + Attributes can be `key`, `fulltext`, and `unique`. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Index Key. + type : IndexType + Index type. + attributes : List[str] + Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. + orders : List[str] + Array of index orders. Maximum of 100 orders are allowed. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' api_params = {} @@ -1038,8 +2020,28 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind 'content-type': 'application/json', }, api_params) - def get_index(self, database_id: str, collection_id: str, key: str): - """Get index""" + def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: + """ + Get index by ID. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Index Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} @@ -1061,8 +2063,28 @@ def get_index(self, database_id: str, collection_id: str, key: str): 'content-type': 'application/json', }, api_params) - def delete_index(self, database_id: str, collection_id: str, key: str): - """Delete index""" + def delete_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: + """ + Delete an index. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + key : str + Index Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' api_params = {} diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 0c990bd..ce0a60a 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -1,5 +1,5 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException from ..enums.runtime import Runtime; from ..input_file import InputFile @@ -7,11 +7,29 @@ class Functions(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Functions, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None): - """List functions""" + def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the project's functions. You can use the query params to filter your results. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions' api_params = {} @@ -23,8 +41,66 @@ def list(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None): - """Create function""" + def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None) -> Dict[str, Any]: + """ + Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. + Parameters + ---------- + function_id : str + Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Function name. Max length: 128 chars. + runtime : Runtime + Execution runtime. + execute : List[str] + An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + events : List[str] + Events list. Maximum of 100 events are allowed. + schedule : str + Schedule CRON syntax. + timeout : float + Function maximum execution time in seconds. + enabled : bool + Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. + logging : bool + Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + entrypoint : str + Entrypoint File. This path is relative to the "providerRootDirectory". + commands : str + Build Commands. + scopes : List[str] + List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. + installation_id : str + Appwrite Installation ID for VCS (Version Control System) deployment. + provider_repository_id : str + Repository ID of the repo linked to the function. + provider_branch : str + Production branch for the repo linked to the function. + provider_silent_mode : bool + Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. + provider_root_directory : str + Path to function code in the linked repo. + template_repository : str + Repository name of the template. + template_owner : str + The name of the owner of the template. + template_root_directory : str + Path to function code in the template repo. + template_version : str + Version (tag) for the repo linked to the function template. + specification : str + Runtime specification for the function and builds. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions' api_params = {} @@ -65,8 +141,19 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st 'content-type': 'application/json', }, api_params) - def list_runtimes(self): - """List runtimes""" + def list_runtimes(self) -> Dict[str, Any]: + """ + Get a list of all runtimes that are currently active on your instance. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/runtimes' api_params = {} @@ -75,8 +162,20 @@ def list_runtimes(self): 'content-type': 'application/json', }, api_params) - def list_specifications(self): - """List available function runtime specifications""" + def list_specifications(self) -> Dict[str, Any]: + """ + List allowed function specifications for this instance. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/specifications' api_params = {} @@ -85,8 +184,24 @@ def list_specifications(self): 'content-type': 'application/json', }, api_params) - def get(self, function_id: str): - """Get function""" + def get(self, function_id: str) -> Dict[str, Any]: + """ + Get a function by its unique ID. + Parameters + ---------- + function_id : str + Function ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}' api_params = {} @@ -100,8 +215,58 @@ def get(self, function_id: str): 'content-type': 'application/json', }, api_params) - def update(self, function_id: str, name: str, runtime: Runtime = None, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None): - """Update function""" + def update(self, function_id: str, name: str, runtime: Runtime = None, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: + """ + Update function by its unique ID. + Parameters + ---------- + function_id : str + Function ID. + name : str + Function name. Max length: 128 chars. + runtime : Runtime + Execution runtime. + execute : List[str] + An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + events : List[str] + Events list. Maximum of 100 events are allowed. + schedule : str + Schedule CRON syntax. + timeout : float + Maximum execution time in seconds. + enabled : bool + Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. + logging : bool + Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + entrypoint : str + Entrypoint File. This path is relative to the "providerRootDirectory". + commands : str + Build Commands. + scopes : List[str] + List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. + installation_id : str + Appwrite Installation ID for VCS (Version Controle System) deployment. + provider_repository_id : str + Repository ID of the repo linked to the function + provider_branch : str + Production branch for the repo linked to the function + provider_silent_mode : bool + Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. + provider_root_directory : str + Path to function code in the linked repo. + specification : str + Runtime specification for the function and builds. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}' api_params = {} @@ -135,8 +300,24 @@ def update(self, function_id: str, name: str, runtime: Runtime = None, execute: 'content-type': 'application/json', }, api_params) - def delete(self, function_id: str): - """Delete function""" + def delete(self, function_id: str) -> Dict[str, Any]: + """ + Delete a function by its unique ID. + Parameters + ---------- + function_id : str + Function ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}' api_params = {} @@ -150,8 +331,28 @@ def delete(self, function_id: str): 'content-type': 'application/json', }, api_params) - def list_deployments(self, function_id: str, queries: List[str] = None, search: str = None): - """List deployments""" + def list_deployments(self, function_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the project's code deployments. You can use the query params to filter your results. + Parameters + ---------- + function_id : str + Function ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: size, buildId, activate, entrypoint, commands, type, size + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/deployments' api_params = {} @@ -167,8 +368,38 @@ def list_deployments(self, function_id: str, queries: List[str] = None, search: 'content-type': 'application/json', }, api_params) - def create_deployment(self, function_id: str, code: InputFile, activate: bool, entrypoint: str = None, commands: str = None, on_progress = None): - """Create deployment""" + def create_deployment(self, function_id: str, code: InputFile, activate: bool, entrypoint: str = None, commands: str = None, on_progress = None) -> Dict[str, Any]: + """ + Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. + + This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions). + + Use the "command" param to set the entrypoint used to execute your code. + Parameters + ---------- + function_id : str + Function ID. + code : InputFile + Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. + activate : bool + Automatically activate the deployment when it is finished building. + entrypoint : str + Entrypoint File. + commands : str + Build Commands. + on_progress : callable, optional + Optional callback for upload progress + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/deployments' api_params = {} @@ -197,8 +428,26 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_deployment(self, function_id: str, deployment_id: str): - """Get deployment""" + def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Get a code deployment by its unique ID. + Parameters + ---------- + function_id : str + Function ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} @@ -216,8 +465,26 @@ def get_deployment(self, function_id: str, deployment_id: str): 'content-type': 'application/json', }, api_params) - def update_deployment(self, function_id: str, deployment_id: str): - """Update deployment""" + def update_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint. + Parameters + ---------- + function_id : str + Function ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} @@ -235,8 +502,26 @@ def update_deployment(self, function_id: str, deployment_id: str): 'content-type': 'application/json', }, api_params) - def delete_deployment(self, function_id: str, deployment_id: str): - """Delete deployment""" + def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Delete a code deployment by its unique ID. + Parameters + ---------- + function_id : str + Function ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} @@ -254,8 +539,28 @@ def delete_deployment(self, function_id: str, deployment_id: str): 'content-type': 'application/json', }, api_params) - def create_build(self, function_id: str, deployment_id: str, build_id: str = None): - """Rebuild deployment""" + def create_build(self, function_id: str, deployment_id: str, build_id: str = None) -> Dict[str, Any]: + """ + Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + Parameters + ---------- + function_id : str + Function ID. + deployment_id : str + Deployment ID. + build_id : str + Build unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} @@ -274,8 +579,26 @@ def create_build(self, function_id: str, deployment_id: str, build_id: str = Non 'content-type': 'application/json', }, api_params) - def update_deployment_build(self, function_id: str, deployment_id: str): - """Cancel deployment""" + def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + Parameters + ---------- + function_id : str + Function ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/deployments/{deploymentId}/build' api_params = {} @@ -293,8 +616,26 @@ def update_deployment_build(self, function_id: str, deployment_id: str): 'content-type': 'application/json', }, api_params) - def get_deployment_download(self, function_id: str, deployment_id: str): - """Download deployment""" + def get_deployment_download(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. + Parameters + ---------- + function_id : str + Function ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/deployments/{deploymentId}/download' api_params = {} @@ -312,8 +653,28 @@ def get_deployment_download(self, function_id: str, deployment_id: str): 'content-type': 'application/json', }, api_params) - def list_executions(self, function_id: str, queries: List[str] = None, search: str = None): - """List executions""" + def list_executions(self, function_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the current user function execution logs. You can use the query params to filter your results. + Parameters + ---------- + function_id : str + Function ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/executions' api_params = {} @@ -329,8 +690,36 @@ def list_executions(self, function_id: str, queries: List[str] = None, search: s 'content-type': 'application/json', }, api_params) - def create_execution(self, function_id: str, body: str = None, xasync: bool = None, path: str = None, method: ExecutionMethod = None, headers: dict = None, scheduled_at: str = None): - """Create execution""" + def create_execution(self, function_id: str, body: str = None, xasync: bool = None, path: str = None, method: ExecutionMethod = None, headers: dict = None, scheduled_at: str = None) -> Dict[str, Any]: + """ + Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. + Parameters + ---------- + function_id : str + Function ID. + body : str + HTTP body of execution. Default value is empty string. + xasync : bool + Execute code in the background. Default value is false. + path : str + HTTP path of execution. Path can include query params. Default value is / + method : ExecutionMethod + HTTP method of execution. Default value is GET. + headers : dict + HTTP headers of execution. Defaults to empty. + scheduled_at : str + Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/executions' api_params = {} @@ -350,8 +739,26 @@ def create_execution(self, function_id: str, body: str = None, xasync: bool = No 'content-type': 'application/json', }, api_params) - def get_execution(self, function_id: str, execution_id: str): - """Get execution""" + def get_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: + """ + Get a function execution log by its unique ID. + Parameters + ---------- + function_id : str + Function ID. + execution_id : str + Execution ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} @@ -369,8 +776,27 @@ def get_execution(self, function_id: str, execution_id: str): 'content-type': 'application/json', }, api_params) - def delete_execution(self, function_id: str, execution_id: str): - """Delete execution""" + def delete_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: + """ + Delete a function execution by its unique ID. + + Parameters + ---------- + function_id : str + Function ID. + execution_id : str + Execution ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/executions/{executionId}' api_params = {} @@ -388,8 +814,24 @@ def delete_execution(self, function_id: str, execution_id: str): 'content-type': 'application/json', }, api_params) - def list_variables(self, function_id: str): - """List variables""" + def list_variables(self, function_id: str) -> Dict[str, Any]: + """ + Get a list of all variables of a specific function. + Parameters + ---------- + function_id : str + Function unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/variables' api_params = {} @@ -403,8 +845,28 @@ def list_variables(self, function_id: str): 'content-type': 'application/json', }, api_params) - def create_variable(self, function_id: str, key: str, value: str): - """Create variable""" + def create_variable(self, function_id: str, key: str, value: str) -> Dict[str, Any]: + """ + Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. + Parameters + ---------- + function_id : str + Function unique ID. + key : str + Variable key. Max length: 255 chars. + value : str + Variable value. Max length: 8192 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/variables' api_params = {} @@ -426,8 +888,26 @@ def create_variable(self, function_id: str, key: str, value: str): 'content-type': 'application/json', }, api_params) - def get_variable(self, function_id: str, variable_id: str): - """Get variable""" + def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: + """ + Get a variable by its unique ID. + Parameters + ---------- + function_id : str + Function unique ID. + variable_id : str + Variable unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} @@ -445,8 +925,30 @@ def get_variable(self, function_id: str, variable_id: str): 'content-type': 'application/json', }, api_params) - def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None): - """Update variable""" + def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None) -> Dict[str, Any]: + """ + Update variable by its unique ID. + Parameters + ---------- + function_id : str + Function unique ID. + variable_id : str + Variable unique ID. + key : str + Variable key. Max length: 255 chars. + value : str + Variable value. Max length: 8192 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} @@ -469,8 +971,26 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s 'content-type': 'application/json', }, api_params) - def delete_variable(self, function_id: str, variable_id: str): - """Delete variable""" + def delete_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: + """ + Delete a variable by its unique ID. + Parameters + ---------- + function_id : str + Function unique ID. + variable_id : str + Variable unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/functions/{functionId}/variables/{variableId}' api_params = {} diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 4a0fd36..0981afa 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -1,14 +1,30 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException class Graphql(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Graphql, self).__init__(client) - def query(self, query: dict): - """GraphQL endpoint""" + def query(self, query: dict) -> Dict[str, Any]: + """ + Execute a GraphQL mutation. + Parameters + ---------- + query : dict + The query or queries to execute. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/graphql' api_params = {} @@ -23,8 +39,24 @@ def query(self, query: dict): 'content-type': 'application/json', }, api_params) - def mutation(self, query: dict): - """GraphQL endpoint""" + def mutation(self, query: dict) -> Dict[str, Any]: + """ + Execute a GraphQL mutation. + Parameters + ---------- + query : dict + The query or queries to execute. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/graphql/mutation' api_params = {} diff --git a/appwrite/services/health.py b/appwrite/services/health.py index 014b536..0007496 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -1,15 +1,26 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException from ..enums.name import Name; class Health(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Health, self).__init__(client) - def get(self): - """Get HTTP""" + def get(self) -> Dict[str, Any]: + """ + Check the Appwrite HTTP server is up and responsive. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health' api_params = {} @@ -18,8 +29,19 @@ def get(self): 'content-type': 'application/json', }, api_params) - def get_antivirus(self): - """Get antivirus""" + def get_antivirus(self) -> Dict[str, Any]: + """ + Check the Appwrite Antivirus server is up and connection is successful. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/anti-virus' api_params = {} @@ -28,8 +50,19 @@ def get_antivirus(self): 'content-type': 'application/json', }, api_params) - def get_cache(self): - """Get cache""" + def get_cache(self) -> Dict[str, Any]: + """ + Check the Appwrite in-memory cache servers are up and connection is successful. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/cache' api_params = {} @@ -38,8 +71,24 @@ def get_cache(self): 'content-type': 'application/json', }, api_params) - def get_certificate(self, domain: str = None): - """Get the SSL certificate for a domain""" + def get_certificate(self, domain: str = None) -> Dict[str, Any]: + """ + Get the SSL certificate for a domain + Parameters + ---------- + domain : str + string + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/certificate' api_params = {} @@ -50,8 +99,19 @@ def get_certificate(self, domain: str = None): 'content-type': 'application/json', }, api_params) - def get_db(self): - """Get DB""" + def get_db(self) -> Dict[str, Any]: + """ + Check the Appwrite database servers are up and connection is successful. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/db' api_params = {} @@ -60,8 +120,19 @@ def get_db(self): 'content-type': 'application/json', }, api_params) - def get_pub_sub(self): - """Get pubsub""" + def get_pub_sub(self) -> Dict[str, Any]: + """ + Check the Appwrite pub-sub servers are up and connection is successful. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/pubsub' api_params = {} @@ -70,8 +141,24 @@ def get_pub_sub(self): 'content-type': 'application/json', }, api_params) - def get_queue_builds(self, threshold: float = None): - """Get builds queue""" + def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of builds that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/builds' api_params = {} @@ -82,8 +169,24 @@ def get_queue_builds(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_certificates(self, threshold: float = None): - """Get certificates queue""" + def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/certificates' api_params = {} @@ -94,8 +197,26 @@ def get_queue_certificates(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_databases(self, name: str = None, threshold: float = None): - """Get databases queue""" + def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + name : str + Queue name for which to check the queue size + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/databases' api_params = {} @@ -107,8 +228,24 @@ def get_queue_databases(self, name: str = None, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_deletes(self, threshold: float = None): - """Get deletes queue""" + def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/deletes' api_params = {} @@ -119,8 +256,27 @@ def get_queue_deletes(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_failed_jobs(self, name: Name, threshold: float = None): - """Get number of failed queue jobs""" + def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any]: + """ + Returns the amount of failed jobs in a given queue. + + Parameters + ---------- + name : Name + The name of the queue + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/failed/{name}' api_params = {} @@ -135,8 +291,24 @@ def get_failed_jobs(self, name: Name, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_functions(self, threshold: float = None): - """Get functions queue""" + def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/functions' api_params = {} @@ -147,8 +319,24 @@ def get_queue_functions(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_logs(self, threshold: float = None): - """Get logs queue""" + def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of logs that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/logs' api_params = {} @@ -159,8 +347,24 @@ def get_queue_logs(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_mails(self, threshold: float = None): - """Get mails queue""" + def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of mails that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/mails' api_params = {} @@ -171,8 +375,24 @@ def get_queue_mails(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_messaging(self, threshold: float = None): - """Get messaging queue""" + def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of messages that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/messaging' api_params = {} @@ -183,8 +403,24 @@ def get_queue_messaging(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_migrations(self, threshold: float = None): - """Get migrations queue""" + def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/migrations' api_params = {} @@ -195,8 +431,24 @@ def get_queue_migrations(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_stats_resources(self, threshold: float = None): - """Get stats resources queue""" + def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/stats-resources' api_params = {} @@ -207,8 +459,24 @@ def get_queue_stats_resources(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_usage(self, threshold: float = None): - """Get stats usage queue""" + def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/stats-usage' api_params = {} @@ -219,8 +487,24 @@ def get_queue_usage(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_stats_usage_dump(self, threshold: float = None): - """Get usage dump queue""" + def get_queue_stats_usage_dump(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/stats-usage-dump' api_params = {} @@ -231,8 +515,24 @@ def get_queue_stats_usage_dump(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_queue_webhooks(self, threshold: float = None): - """Get webhooks queue""" + def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: + """ + Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. + Parameters + ---------- + threshold : float + Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/queue/webhooks' api_params = {} @@ -243,8 +543,19 @@ def get_queue_webhooks(self, threshold: float = None): 'content-type': 'application/json', }, api_params) - def get_storage(self): - """Get storage""" + def get_storage(self) -> Dict[str, Any]: + """ + Check the Appwrite storage device is up and connection is successful. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/storage' api_params = {} @@ -253,8 +564,19 @@ def get_storage(self): 'content-type': 'application/json', }, api_params) - def get_storage_local(self): - """Get local storage""" + def get_storage_local(self) -> Dict[str, Any]: + """ + Check the Appwrite local storage device is up and connection is successful. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/storage/local' api_params = {} @@ -263,8 +585,19 @@ def get_storage_local(self): 'content-type': 'application/json', }, api_params) - def get_time(self): - """Get time""" + def get_time(self) -> Dict[str, Any]: + """ + Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/health/time' api_params = {} diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index 6c14eaf..3f137a5 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -1,14 +1,27 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException class Locale(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Locale, self).__init__(client) - def get(self): - """Get user locale""" + def get(self) -> Dict[str, Any]: + """ + Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language. + + ([IP Geolocation by DB-IP](https://db-ip.com)) + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/locale' api_params = {} @@ -17,8 +30,19 @@ def get(self): 'content-type': 'application/json', }, api_params) - def list_codes(self): - """List locale codes""" + def list_codes(self) -> Dict[str, Any]: + """ + List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/locale/codes' api_params = {} @@ -27,8 +51,19 @@ def list_codes(self): 'content-type': 'application/json', }, api_params) - def list_continents(self): - """List continents""" + def list_continents(self) -> Dict[str, Any]: + """ + List of all continents. You can use the locale header to get the data in a supported language. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/locale/continents' api_params = {} @@ -37,8 +72,19 @@ def list_continents(self): 'content-type': 'application/json', }, api_params) - def list_countries(self): - """List countries""" + def list_countries(self) -> Dict[str, Any]: + """ + List of all countries. You can use the locale header to get the data in a supported language. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/locale/countries' api_params = {} @@ -47,8 +93,19 @@ def list_countries(self): 'content-type': 'application/json', }, api_params) - def list_countries_eu(self): - """List EU countries""" + def list_countries_eu(self) -> Dict[str, Any]: + """ + List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/locale/countries/eu' api_params = {} @@ -57,8 +114,19 @@ def list_countries_eu(self): 'content-type': 'application/json', }, api_params) - def list_countries_phones(self): - """List countries phone codes""" + def list_countries_phones(self) -> Dict[str, Any]: + """ + List of all countries phone codes. You can use the locale header to get the data in a supported language. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/locale/countries/phones' api_params = {} @@ -67,8 +135,19 @@ def list_countries_phones(self): 'content-type': 'application/json', }, api_params) - def list_currencies(self): - """List currencies""" + def list_currencies(self) -> Dict[str, Any]: + """ + List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/locale/currencies' api_params = {} @@ -77,8 +156,19 @@ def list_currencies(self): 'content-type': 'application/json', }, api_params) - def list_languages(self): - """List languages""" + def list_languages(self) -> Dict[str, Any]: + """ + List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/locale/languages' api_params = {} diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 9b41d18..d3aa1fb 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -1,16 +1,34 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException from ..enums.message_priority import MessagePriority; from ..enums.smtp_encryption import SmtpEncryption; class Messaging(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Messaging, self).__init__(client) - def list_messages(self, queries: List[str] = None, search: str = None): - """List messages""" + def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all messages from the current Appwrite project. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages' api_params = {} @@ -22,8 +40,46 @@ def list_messages(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_email(self, message_id: str, subject: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, cc: List[str] = None, bcc: List[str] = None, attachments: List[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None): - """Create email""" + def create_email(self, message_id: str, subject: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, cc: List[str] = None, bcc: List[str] = None, attachments: List[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None) -> Dict[str, Any]: + """ + Create a new email message. + Parameters + ---------- + message_id : str + Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + subject : str + Email Subject. + content : str + Email Content. + topics : List[str] + List of Topic IDs. + users : List[str] + List of User IDs. + targets : List[str] + List of Targets IDs. + cc : List[str] + Array of target IDs to be added as CC. + bcc : List[str] + Array of target IDs to be added as BCC. + attachments : List[str] + Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. + draft : bool + Is message a draft + html : bool + Is content of type HTML + scheduled_at : str + Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/email' api_params = {} @@ -54,8 +110,47 @@ def create_email(self, message_id: str, subject: str, content: str, topics: List 'content-type': 'application/json', }, api_params) - def update_email(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: List[str] = None, bcc: List[str] = None, scheduled_at: str = None, attachments: List[str] = None): - """Update email""" + def update_email(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: List[str] = None, bcc: List[str] = None, scheduled_at: str = None, attachments: List[str] = None) -> Dict[str, Any]: + """ + Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + + Parameters + ---------- + message_id : str + Message ID. + topics : List[str] + List of Topic IDs. + users : List[str] + List of User IDs. + targets : List[str] + List of Targets IDs. + subject : str + Email Subject. + content : str + Email Content. + draft : bool + Is message a draft + html : bool + Is content of type HTML + cc : List[str] + Array of target IDs to be added as CC. + bcc : List[str] + Array of target IDs to be added as BCC. + scheduled_at : str + Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + attachments : List[str] + Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/email/{messageId}' api_params = {} @@ -80,8 +175,60 @@ def update_email(self, message_id: str, topics: List[str] = None, users: List[st 'content-type': 'application/json', }, api_params) - def create_push(self, message_id: str, title: str = None, body: str = None, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): - """Create push notification""" + def create_push(self, message_id: str, title: str = None, body: str = None, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None) -> Dict[str, Any]: + """ + Create a new push notification. + Parameters + ---------- + message_id : str + Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + title : str + Title for push notification. + body : str + Body for push notification. + topics : List[str] + List of Topic IDs. + users : List[str] + List of User IDs. + targets : List[str] + List of Targets IDs. + data : dict + Additional key-value pair data for push notification. + action : str + Action for push notification. + image : str + Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. + icon : str + Icon for push notification. Available only for Android and Web Platform. + sound : str + Sound for push notification. Available only for Android and iOS Platform. + color : str + Color for push notification. Available only for Android Platform. + tag : str + Tag for push notification. Available only for Android Platform. + badge : float + Badge for push notification. Available only for iOS Platform. + draft : bool + Is message a draft + scheduled_at : str + Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + content_available : bool + If set to true, the notification will be delivered in the background. Available only for iOS Platform. + critical : bool + If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. + priority : MessagePriority + Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/push' api_params = {} @@ -113,8 +260,61 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi 'content-type': 'application/json', }, api_params) - def update_push(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): - """Update push notification""" + def update_push(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None) -> Dict[str, Any]: + """ + Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + + Parameters + ---------- + message_id : str + Message ID. + topics : List[str] + List of Topic IDs. + users : List[str] + List of User IDs. + targets : List[str] + List of Targets IDs. + title : str + Title for push notification. + body : str + Body for push notification. + data : dict + Additional Data for push notification. + action : str + Action for push notification. + image : str + Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. + icon : str + Icon for push notification. Available only for Android and Web platforms. + sound : str + Sound for push notification. Available only for Android and iOS platforms. + color : str + Color for push notification. Available only for Android platforms. + tag : str + Tag for push notification. Available only for Android platforms. + badge : float + Badge for push notification. Available only for iOS platforms. + draft : bool + Is message a draft + scheduled_at : str + Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + content_available : bool + If set to true, the notification will be delivered in the background. Available only for iOS Platform. + critical : bool + If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. + priority : MessagePriority + Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/push/{messageId}' api_params = {} @@ -146,8 +346,36 @@ def update_push(self, message_id: str, topics: List[str] = None, users: List[str 'content-type': 'application/json', }, api_params) - def create_sms(self, message_id: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, draft: bool = None, scheduled_at: str = None): - """Create SMS""" + def create_sms(self, message_id: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, draft: bool = None, scheduled_at: str = None) -> Dict[str, Any]: + """ + Create a new SMS message. + Parameters + ---------- + message_id : str + Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + content : str + SMS Content. + topics : List[str] + List of Topic IDs. + users : List[str] + List of User IDs. + targets : List[str] + List of Targets IDs. + draft : bool + Is message a draft + scheduled_at : str + Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/sms' api_params = {} @@ -170,8 +398,37 @@ def create_sms(self, message_id: str, content: str, topics: List[str] = None, us 'content-type': 'application/json', }, api_params) - def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, content: str = None, draft: bool = None, scheduled_at: str = None): - """Update SMS""" + def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, content: str = None, draft: bool = None, scheduled_at: str = None) -> Dict[str, Any]: + """ + Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + + Parameters + ---------- + message_id : str + Message ID. + topics : List[str] + List of Topic IDs. + users : List[str] + List of User IDs. + targets : List[str] + List of Targets IDs. + content : str + Email Content. + draft : bool + Is message a draft + scheduled_at : str + Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/sms/{messageId}' api_params = {} @@ -191,8 +448,25 @@ def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] 'content-type': 'application/json', }, api_params) - def get_message(self, message_id: str): - """Get message""" + def get_message(self, message_id: str) -> Dict[str, Any]: + """ + Get a message by its unique ID. + + Parameters + ---------- + message_id : str + Message ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/{messageId}' api_params = {} @@ -206,8 +480,24 @@ def get_message(self, message_id: str): 'content-type': 'application/json', }, api_params) - def delete(self, message_id: str): - """Delete message""" + def delete(self, message_id: str) -> Dict[str, Any]: + """ + Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message. + Parameters + ---------- + message_id : str + Message ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/{messageId}' api_params = {} @@ -221,8 +511,26 @@ def delete(self, message_id: str): 'content-type': 'application/json', }, api_params) - def list_message_logs(self, message_id: str, queries: List[str] = None): - """List message logs""" + def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get the message activity logs listed by its unique ID. + Parameters + ---------- + message_id : str + Message ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/{messageId}/logs' api_params = {} @@ -237,8 +545,26 @@ def list_message_logs(self, message_id: str, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def list_targets(self, message_id: str, queries: List[str] = None): - """List message targets""" + def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get a list of the targets associated with a message. + Parameters + ---------- + message_id : str + Message ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/messages/{messageId}/targets' api_params = {} @@ -253,8 +579,26 @@ def list_targets(self, message_id: str, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def list_providers(self, queries: List[str] = None, search: str = None): - """List providers""" + def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all providers from the current Appwrite project. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers' api_params = {} @@ -266,8 +610,38 @@ def list_providers(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None, enabled: bool = None): - """Create APNS provider""" + def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Apple Push Notification service provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + auth_key : str + APNS authentication key. + auth_key_id : str + APNS authentication key ID. + team_id : str + APNS team ID. + bundle_id : str + APNS bundle ID. + sandbox : bool + Use APNS sandbox environment. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/apns' api_params = {} @@ -291,8 +665,38 @@ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None 'content-type': 'application/json', }, api_params) - def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool = None, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None): - """Update APNS provider""" + def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool = None, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None) -> Dict[str, Any]: + """ + Update a Apple Push Notification service provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + enabled : bool + Set as enabled. + auth_key : str + APNS authentication key. + auth_key_id : str + APNS authentication key ID. + team_id : str + APNS team ID. + bundle_id : str + APNS bundle ID. + sandbox : bool + Use APNS sandbox environment. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/apns/{providerId}' api_params = {} @@ -313,8 +717,30 @@ def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool 'content-type': 'application/json', }, api_params) - def create_fcm_provider(self, provider_id: str, name: str, service_account_json: dict = None, enabled: bool = None): - """Create FCM provider""" + def create_fcm_provider(self, provider_id: str, name: str, service_account_json: dict = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Firebase Cloud Messaging provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + service_account_json : dict + FCM service account JSON. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/fcm' api_params = {} @@ -334,8 +760,30 @@ def create_fcm_provider(self, provider_id: str, name: str, service_account_json: 'content-type': 'application/json', }, api_params) - def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool = None, service_account_json: dict = None): - """Update FCM provider""" + def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool = None, service_account_json: dict = None) -> Dict[str, Any]: + """ + Update a Firebase Cloud Messaging provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + enabled : bool + Set as enabled. + service_account_json : dict + FCM service account JSON. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/fcm/{providerId}' api_params = {} @@ -352,8 +800,42 @@ def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool 'content-type': 'application/json', }, api_params) - def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = None, domain: str = None, is_eu_region: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): - """Create Mailgun provider""" + def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = None, domain: str = None, is_eu_region: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Mailgun provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + api_key : str + Mailgun API Key. + domain : str + Mailgun Domain. + is_eu_region : bool + Set as EU region. + from_name : str + Sender Name. + from_email : str + Sender email address. + reply_to_name : str + Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well. + reply_to_email : str + Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/mailgun' api_params = {} @@ -379,8 +861,42 @@ def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = No 'content-type': 'application/json', }, api_params) - def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: str = None, domain: str = None, is_eu_region: bool = None, enabled: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None): - """Update Mailgun provider""" + def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: str = None, domain: str = None, is_eu_region: bool = None, enabled: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None) -> Dict[str, Any]: + """ + Update a Mailgun provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + api_key : str + Mailgun API Key. + domain : str + Mailgun Domain. + is_eu_region : bool + Set as EU region. + enabled : bool + Set as enabled. + from_name : str + Sender Name. + from_email : str + Sender email address. + reply_to_name : str + Name set in the reply to field for the mail. Default value is sender name. + reply_to_email : str + Email set in the reply to field for the mail. Default value is sender email. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/mailgun/{providerId}' api_params = {} @@ -403,8 +919,34 @@ def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: s 'content-type': 'application/json', }, api_params) - def create_msg91_provider(self, provider_id: str, name: str, template_id: str = None, sender_id: str = None, auth_key: str = None, enabled: bool = None): - """Create Msg91 provider""" + def create_msg91_provider(self, provider_id: str, name: str, template_id: str = None, sender_id: str = None, auth_key: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new MSG91 provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + template_id : str + Msg91 template ID + sender_id : str + Msg91 sender ID. + auth_key : str + Msg91 auth key. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/msg91' api_params = {} @@ -426,8 +968,34 @@ def create_msg91_provider(self, provider_id: str, name: str, template_id: str = 'content-type': 'application/json', }, api_params) - def update_msg91_provider(self, provider_id: str, name: str = None, enabled: bool = None, template_id: str = None, sender_id: str = None, auth_key: str = None): - """Update Msg91 provider""" + def update_msg91_provider(self, provider_id: str, name: str = None, enabled: bool = None, template_id: str = None, sender_id: str = None, auth_key: str = None) -> Dict[str, Any]: + """ + Update a MSG91 provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + enabled : bool + Set as enabled. + template_id : str + Msg91 template ID. + sender_id : str + Msg91 sender ID. + auth_key : str + Msg91 auth key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/msg91/{providerId}' api_params = {} @@ -446,8 +1014,38 @@ def update_msg91_provider(self, provider_id: str, name: str = None, enabled: boo 'content-type': 'application/json', }, api_params) - def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): - """Create Sendgrid provider""" + def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Sendgrid provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + api_key : str + Sendgrid API key. + from_name : str + Sender Name. + from_email : str + Sender email address. + reply_to_name : str + Name set in the reply to field for the mail. Default value is sender name. + reply_to_email : str + Email set in the reply to field for the mail. Default value is sender email. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/sendgrid' api_params = {} @@ -471,8 +1069,38 @@ def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = N 'content-type': 'application/json', }, api_params) - def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None): - """Update Sendgrid provider""" + def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None) -> Dict[str, Any]: + """ + Update a Sendgrid provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + enabled : bool + Set as enabled. + api_key : str + Sendgrid API key. + from_name : str + Sender Name. + from_email : str + Sender email address. + reply_to_name : str + Name set in the Reply To field for the mail. Default value is Sender Name. + reply_to_email : str + Email set in the Reply To field for the mail. Default value is Sender Email. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/sendgrid/{providerId}' api_params = {} @@ -493,8 +1121,50 @@ def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: 'content-type': 'application/json', }, api_params) - def create_smtp_provider(self, provider_id: str, name: str, host: str, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): - """Create SMTP provider""" + def create_smtp_provider(self, provider_id: str, name: str, host: str, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new SMTP provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + host : str + SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. + port : float + The default SMTP server port. + username : str + Authentication username. + password : str + Authentication password. + encryption : SmtpEncryption + Encryption type. Can be omitted, 'ssl', or 'tls' + auto_tls : bool + Enable SMTP AutoTLS feature. + mailer : str + The value to use for the X-Mailer header. + from_name : str + Sender Name. + from_email : str + Sender email address. + reply_to_name : str + Name set in the reply to field for the mail. Default value is sender name. + reply_to_email : str + Email set in the reply to field for the mail. Default value is sender email. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/smtp' api_params = {} @@ -527,8 +1197,50 @@ def create_smtp_provider(self, provider_id: str, name: str, host: str, port: flo 'content-type': 'application/json', }, api_params) - def update_smtp_provider(self, provider_id: str, name: str = None, host: str = None, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None): - """Update SMTP provider""" + def update_smtp_provider(self, provider_id: str, name: str = None, host: str = None, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Update a SMTP provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + host : str + SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. + port : float + SMTP port. + username : str + Authentication username. + password : str + Authentication password. + encryption : SmtpEncryption + Encryption type. Can be 'ssl' or 'tls' + auto_tls : bool + Enable SMTP AutoTLS feature. + mailer : str + The value to use for the X-Mailer header. + from_name : str + Sender Name. + from_email : str + Sender email address. + reply_to_name : str + Name set in the Reply To field for the mail. Default value is Sender Name. + reply_to_email : str + Email set in the Reply To field for the mail. Default value is Sender Email. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/smtp/{providerId}' api_params = {} @@ -555,8 +1267,34 @@ def update_smtp_provider(self, provider_id: str, name: str = None, host: str = N 'content-type': 'application/json', }, api_params) - def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = None, customer_id: str = None, api_key: str = None, enabled: bool = None): - """Create Telesign provider""" + def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = None, customer_id: str = None, api_key: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Telesign provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + xfrom : str + Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + customer_id : str + Telesign customer ID. + api_key : str + Telesign API key. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/telesign' api_params = {} @@ -578,8 +1316,34 @@ def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = Non 'content-type': 'application/json', }, api_params) - def update_telesign_provider(self, provider_id: str, name: str = None, enabled: bool = None, customer_id: str = None, api_key: str = None, xfrom: str = None): - """Update Telesign provider""" + def update_telesign_provider(self, provider_id: str, name: str = None, enabled: bool = None, customer_id: str = None, api_key: str = None, xfrom: str = None) -> Dict[str, Any]: + """ + Update a Telesign provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + enabled : bool + Set as enabled. + customer_id : str + Telesign customer ID. + api_key : str + Telesign API key. + xfrom : str + Sender number. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/telesign/{providerId}' api_params = {} @@ -598,8 +1362,34 @@ def update_telesign_provider(self, provider_id: str, name: str = None, enabled: 'content-type': 'application/json', }, api_params) - def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = None, username: str = None, api_key: str = None, enabled: bool = None): - """Create Textmagic provider""" + def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = None, username: str = None, api_key: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Textmagic provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + xfrom : str + Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + username : str + Textmagic username. + api_key : str + Textmagic apiKey. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/textmagic' api_params = {} @@ -621,8 +1411,34 @@ def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = No 'content-type': 'application/json', }, api_params) - def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: bool = None, username: str = None, api_key: str = None, xfrom: str = None): - """Update Textmagic provider""" + def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: bool = None, username: str = None, api_key: str = None, xfrom: str = None) -> Dict[str, Any]: + """ + Update a Textmagic provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + enabled : bool + Set as enabled. + username : str + Textmagic username. + api_key : str + Textmagic apiKey. + xfrom : str + Sender number. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/textmagic/{providerId}' api_params = {} @@ -641,8 +1457,34 @@ def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: 'content-type': 'application/json', }, api_params) - def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, account_sid: str = None, auth_token: str = None, enabled: bool = None): - """Create Twilio provider""" + def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, account_sid: str = None, auth_token: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Twilio provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + xfrom : str + Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + account_sid : str + Twilio account secret ID. + auth_token : str + Twilio authentication token. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/twilio' api_params = {} @@ -664,8 +1506,34 @@ def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, 'content-type': 'application/json', }, api_params) - def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bool = None, account_sid: str = None, auth_token: str = None, xfrom: str = None): - """Update Twilio provider""" + def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bool = None, account_sid: str = None, auth_token: str = None, xfrom: str = None) -> Dict[str, Any]: + """ + Update a Twilio provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + enabled : bool + Set as enabled. + account_sid : str + Twilio account secret ID. + auth_token : str + Twilio authentication token. + xfrom : str + Sender number. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/twilio/{providerId}' api_params = {} @@ -684,8 +1552,34 @@ def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bo 'content-type': 'application/json', }, api_params) - def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, api_key: str = None, api_secret: str = None, enabled: bool = None): - """Create Vonage provider""" + def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, api_key: str = None, api_secret: str = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Vonage provider. + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + xfrom : str + Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + api_key : str + Vonage API key. + api_secret : str + Vonage API secret. + enabled : bool + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/vonage' api_params = {} @@ -707,8 +1601,34 @@ def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, 'content-type': 'application/json', }, api_params) - def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, api_secret: str = None, xfrom: str = None): - """Update Vonage provider""" + def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, api_secret: str = None, xfrom: str = None) -> Dict[str, Any]: + """ + Update a Vonage provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + name : str + Provider name. + enabled : bool + Set as enabled. + api_key : str + Vonage API key. + api_secret : str + Vonage API secret. + xfrom : str + Sender number. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/vonage/{providerId}' api_params = {} @@ -727,8 +1647,25 @@ def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bo 'content-type': 'application/json', }, api_params) - def get_provider(self, provider_id: str): - """Get provider""" + def get_provider(self, provider_id: str) -> Dict[str, Any]: + """ + Get a provider by its unique ID. + + Parameters + ---------- + provider_id : str + Provider ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/{providerId}' api_params = {} @@ -742,8 +1679,24 @@ def get_provider(self, provider_id: str): 'content-type': 'application/json', }, api_params) - def delete_provider(self, provider_id: str): - """Delete provider""" + def delete_provider(self, provider_id: str) -> Dict[str, Any]: + """ + Delete a provider by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/{providerId}' api_params = {} @@ -757,8 +1710,26 @@ def delete_provider(self, provider_id: str): 'content-type': 'application/json', }, api_params) - def list_provider_logs(self, provider_id: str, queries: List[str] = None): - """List provider logs""" + def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get the provider activity logs listed by its unique ID. + Parameters + ---------- + provider_id : str + Provider ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/providers/{providerId}/logs' api_params = {} @@ -773,8 +1744,26 @@ def list_provider_logs(self, provider_id: str, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None): - """List subscriber logs""" + def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get the subscriber activity logs listed by its unique ID. + Parameters + ---------- + subscriber_id : str + Subscriber ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/subscribers/{subscriberId}/logs' api_params = {} @@ -789,8 +1778,26 @@ def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def list_topics(self, queries: List[str] = None, search: str = None): - """List topics""" + def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all topics from the current Appwrite project. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics' api_params = {} @@ -802,8 +1809,28 @@ def list_topics(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None): - """Create topic""" + def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None) -> Dict[str, Any]: + """ + Create a new topic. + Parameters + ---------- + topic_id : str + Topic ID. Choose a custom Topic ID or a new Topic ID. + name : str + Topic Name. + subscribe : List[str] + An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics' api_params = {} @@ -822,8 +1849,25 @@ def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None): 'content-type': 'application/json', }, api_params) - def get_topic(self, topic_id: str): - """Get topic""" + def get_topic(self, topic_id: str) -> Dict[str, Any]: + """ + Get a topic by its unique ID. + + Parameters + ---------- + topic_id : str + Topic ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics/{topicId}' api_params = {} @@ -837,8 +1881,29 @@ def get_topic(self, topic_id: str): 'content-type': 'application/json', }, api_params) - def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = None): - """Update topic""" + def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = None) -> Dict[str, Any]: + """ + Update a topic by its unique ID. + + Parameters + ---------- + topic_id : str + Topic ID. + name : str + Topic Name. + subscribe : List[str] + An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics/{topicId}' api_params = {} @@ -854,8 +1919,24 @@ def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = N 'content-type': 'application/json', }, api_params) - def delete_topic(self, topic_id: str): - """Delete topic""" + def delete_topic(self, topic_id: str) -> Dict[str, Any]: + """ + Delete a topic by its unique ID. + Parameters + ---------- + topic_id : str + Topic ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics/{topicId}' api_params = {} @@ -869,8 +1950,26 @@ def delete_topic(self, topic_id: str): 'content-type': 'application/json', }, api_params) - def list_topic_logs(self, topic_id: str, queries: List[str] = None): - """List topic logs""" + def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get the topic activity logs listed by its unique ID. + Parameters + ---------- + topic_id : str + Topic ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics/{topicId}/logs' api_params = {} @@ -885,8 +1984,28 @@ def list_topic_logs(self, topic_id: str, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str = None): - """List subscribers""" + def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all subscribers from the current Appwrite project. + Parameters + ---------- + topic_id : str + Topic ID. The topic ID subscribed to. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} @@ -902,8 +2021,28 @@ def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str 'content-type': 'application/json', }, api_params) - def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str): - """Create subscriber""" + def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str) -> Dict[str, Any]: + """ + Create a new subscriber. + Parameters + ---------- + topic_id : str + Topic ID. The topic ID to subscribe to. + subscriber_id : str + Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID. + target_id : str + Target ID. The target ID to link to the specified Topic ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics/{topicId}/subscribers' api_params = {} @@ -925,8 +2064,27 @@ def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str): 'content-type': 'application/json', }, api_params) - def get_subscriber(self, topic_id: str, subscriber_id: str): - """Get subscriber""" + def get_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: + """ + Get a subscriber by its unique ID. + + Parameters + ---------- + topic_id : str + Topic ID. The topic ID subscribed to. + subscriber_id : str + Subscriber ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} @@ -944,8 +2102,26 @@ def get_subscriber(self, topic_id: str, subscriber_id: str): 'content-type': 'application/json', }, api_params) - def delete_subscriber(self, topic_id: str, subscriber_id: str): - """Delete subscriber""" + def delete_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: + """ + Delete a subscriber by its unique ID. + Parameters + ---------- + topic_id : str + Topic ID. The topic ID subscribed to. + subscriber_id : str + Subscriber ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}' api_params = {} diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index ac73261..c1d6d58 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -1,5 +1,5 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException from ..enums.compression import Compression; from ..input_file import InputFile @@ -8,11 +8,29 @@ class Storage(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Storage, self).__init__(client) - def list_buckets(self, queries: List[str] = None, search: str = None): - """List buckets""" + def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the storage buckets. You can use the query params to filter your results. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets' api_params = {} @@ -24,8 +42,42 @@ def list_buckets(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): - """Create bucket""" + def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None) -> Dict[str, Any]: + """ + Create a new storage bucket. + Parameters + ---------- + bucket_id : str + Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Bucket name + permissions : List[str] + An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + file_security : bool + Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). + enabled : bool + Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. + maximum_file_size : float + Maximum file size allowed in bytes. Maximum allowed value is 30MB. + allowed_file_extensions : List[str] + Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. + compression : Compression + Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled + encryption : bool + Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled + antivirus : bool + Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets' api_params = {} @@ -51,8 +103,24 @@ def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None 'content-type': 'application/json', }, api_params) - def get_bucket(self, bucket_id: str): - """Get bucket""" + def get_bucket(self, bucket_id: str) -> Dict[str, Any]: + """ + Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata. + Parameters + ---------- + bucket_id : str + Bucket unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}' api_params = {} @@ -66,8 +134,42 @@ def get_bucket(self, bucket_id: str): 'content-type': 'application/json', }, api_params) - def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): - """Update bucket""" + def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None) -> Dict[str, Any]: + """ + Update a storage bucket by its unique ID. + Parameters + ---------- + bucket_id : str + Bucket unique ID. + name : str + Bucket name + permissions : List[str] + An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + file_security : bool + Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). + enabled : bool + Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. + maximum_file_size : float + Maximum file size allowed in bytes. Maximum allowed value is 30MB. + allowed_file_extensions : List[str] + Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. + compression : Compression + Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled + encryption : bool + Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled + antivirus : bool + Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}' api_params = {} @@ -93,8 +195,24 @@ def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None 'content-type': 'application/json', }, api_params) - def delete_bucket(self, bucket_id: str): - """Delete bucket""" + def delete_bucket(self, bucket_id: str) -> Dict[str, Any]: + """ + Delete a storage bucket by its unique ID. + Parameters + ---------- + bucket_id : str + Bucket unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}' api_params = {} @@ -108,8 +226,28 @@ def delete_bucket(self, bucket_id: str): 'content-type': 'application/json', }, api_params) - def list_files(self, bucket_id: str, queries: List[str] = None, search: str = None): - """List files""" + def list_files(self, bucket_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the user files. You can use the query params to filter your results. + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}/files' api_params = {} @@ -125,8 +263,39 @@ def list_files(self, bucket_id: str, queries: List[str] = None, search: str = No 'content-type': 'application/json', }, api_params) - def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: List[str] = None, on_progress = None): - """Create file""" + def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: List[str] = None, on_progress = None) -> Dict[str, Any]: + """ + Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console. + + Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes. + + When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. + + If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. + + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + file : InputFile + Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). + permissions : List[str] + An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + on_progress : callable, optional + Optional callback for upload progress + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}/files' api_params = {} @@ -155,8 +324,26 @@ def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_file(self, bucket_id: str, file_id: str): - """Get file""" + def get_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: + """ + Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} @@ -174,8 +361,30 @@ def get_file(self, bucket_id: str, file_id: str): 'content-type': 'application/json', }, api_params) - def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: List[str] = None): - """Update file""" + def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: List[str] = None) -> Dict[str, Any]: + """ + Update a file by its unique ID. Only users with write permissions have access to update this resource. + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File unique ID. + name : str + Name of the file + permissions : List[str] + An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} @@ -195,8 +404,26 @@ def update_file(self, bucket_id: str, file_id: str, name: str = None, permission 'content-type': 'application/json', }, api_params) - def delete_file(self, bucket_id: str, file_id: str): - """Delete file""" + def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: + """ + Delete a file by its unique ID. Only users with write permissions have access to delete this resource. + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}/files/{fileId}' api_params = {} @@ -214,8 +441,26 @@ def delete_file(self, bucket_id: str, file_id: str): 'content-type': 'application/json', }, api_params) - def get_file_download(self, bucket_id: str, file_id: str): - """Get file for download""" + def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]: + """ + Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + Parameters + ---------- + bucket_id : str + Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}/files/{fileId}/download' api_params = {} @@ -233,8 +478,48 @@ def get_file_download(self, bucket_id: str, file_id: str): 'content-type': 'application/json', }, api_params) - def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None): - """Get file preview""" + def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> Dict[str, Any]: + """ + Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File ID + width : float + Resize preview image width, Pass an integer between 0 to 4000. + height : float + Resize preview image height, Pass an integer between 0 to 4000. + gravity : ImageGravity + Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right + quality : float + Preview image quality. Pass an integer between 0 to 100. Defaults to 100. + border_width : float + Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. + border_color : str + Preview image border color. Use a valid HEX color, no # is needed for prefix. + border_radius : float + Preview image border radius in pixels. Pass an integer between 0 to 4000. + opacity : float + Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. + rotation : float + Preview image rotation in degrees. Pass an integer between -360 and 360. + background : str + Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. + output : ImageFormat + Output format type (jpeg, jpg, png, gif and webp). + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}/files/{fileId}/preview' api_params = {} @@ -263,8 +548,26 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he 'content-type': 'application/json', }, api_params) - def get_file_view(self, bucket_id: str, file_id: str): - """Get file for view""" + def get_file_view(self, bucket_id: str, file_id: str) -> Dict[str, Any]: + """ + Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/storage/buckets/{bucketId}/files/{fileId}/view' api_params = {} diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index fd28540..f330966 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -1,14 +1,32 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException class Teams(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Teams, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None): - """List teams""" + def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams' api_params = {} @@ -20,8 +38,28 @@ def list(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, team_id: str, name: str, roles: List[str] = None): - """Create team""" + def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, Any]: + """ + Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. + Parameters + ---------- + team_id : str + Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Team name. Max length: 128 chars. + roles : List[str] + Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams' api_params = {} @@ -40,8 +78,24 @@ def create(self, team_id: str, name: str, roles: List[str] = None): 'content-type': 'application/json', }, api_params) - def get(self, team_id: str): - """Get team""" + def get(self, team_id: str) -> Dict[str, Any]: + """ + Get a team by its ID. All team members have read access for this resource. + Parameters + ---------- + team_id : str + Team ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}' api_params = {} @@ -55,8 +109,26 @@ def get(self, team_id: str): 'content-type': 'application/json', }, api_params) - def update_name(self, team_id: str, name: str): - """Update name""" + def update_name(self, team_id: str, name: str) -> Dict[str, Any]: + """ + Update the team's name by its unique ID. + Parameters + ---------- + team_id : str + Team ID. + name : str + New team name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}' api_params = {} @@ -74,8 +146,24 @@ def update_name(self, team_id: str, name: str): 'content-type': 'application/json', }, api_params) - def delete(self, team_id: str): - """Delete team""" + def delete(self, team_id: str) -> Dict[str, Any]: + """ + Delete a team using its ID. Only team members with the owner role can delete the team. + Parameters + ---------- + team_id : str + Team ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}' api_params = {} @@ -89,8 +177,28 @@ def delete(self, team_id: str): 'content-type': 'application/json', }, api_params) - def list_memberships(self, team_id: str, queries: List[str] = None, search: str = None): - """List team memberships""" + def list_memberships(self, team_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. + Parameters + ---------- + team_id : str + Team ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}/memberships' api_params = {} @@ -106,8 +214,43 @@ def list_memberships(self, team_id: str, queries: List[str] = None, search: str 'content-type': 'application/json', }, api_params) - def create_membership(self, team_id: str, roles: List[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None): - """Create team membership""" + def create_membership(self, team_id: str, roles: List[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None) -> Dict[str, Any]: + """ + Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. + + You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. + + Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. + + Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. + + Parameters + ---------- + team_id : str + Team ID. + roles : List[str] + Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. + email : str + Email of the new team member. + user_id : str + ID of the user to be added to a team. + phone : str + Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + url : str + URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. + name : str + Name of the new team member. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}/memberships' api_params = {} @@ -130,8 +273,26 @@ def create_membership(self, team_id: str, roles: List[str], email: str = None, u 'content-type': 'application/json', }, api_params) - def get_membership(self, team_id: str, membership_id: str): - """Get team membership""" + def get_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: + """ + Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. + Parameters + ---------- + team_id : str + Team ID. + membership_id : str + Membership ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} @@ -149,8 +310,29 @@ def get_membership(self, team_id: str, membership_id: str): 'content-type': 'application/json', }, api_params) - def update_membership(self, team_id: str, membership_id: str, roles: List[str]): - """Update membership""" + def update_membership(self, team_id: str, membership_id: str, roles: List[str]) -> Dict[str, Any]: + """ + Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). + + Parameters + ---------- + team_id : str + Team ID. + membership_id : str + Membership ID. + roles : List[str] + An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} @@ -172,8 +354,26 @@ def update_membership(self, team_id: str, membership_id: str, roles: List[str]): 'content-type': 'application/json', }, api_params) - def delete_membership(self, team_id: str, membership_id: str): - """Delete team membership""" + def delete_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: + """ + This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted. + Parameters + ---------- + team_id : str + Team ID. + membership_id : str + Membership ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}/memberships/{membershipId}' api_params = {} @@ -191,8 +391,33 @@ def delete_membership(self, team_id: str, membership_id: str): 'content-type': 'application/json', }, api_params) - def update_membership_status(self, team_id: str, membership_id: str, user_id: str, secret: str): - """Update team membership status""" + def update_membership_status(self, team_id: str, membership_id: str, user_id: str, secret: str) -> Dict[str, Any]: + """ + Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user. + + If the request is successful, a session for the user is automatically created. + + Parameters + ---------- + team_id : str + Team ID. + membership_id : str + Membership ID. + user_id : str + User ID. + secret : str + Secret key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}/memberships/{membershipId}/status' api_params = {} @@ -218,8 +443,24 @@ def update_membership_status(self, team_id: str, membership_id: str, user_id: st 'content-type': 'application/json', }, api_params) - def get_prefs(self, team_id: str): - """Get team preferences""" + def get_prefs(self, team_id: str) -> Dict[str, Any]: + """ + Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). + Parameters + ---------- + team_id : str + Team ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}/prefs' api_params = {} @@ -233,8 +474,26 @@ def get_prefs(self, team_id: str): 'content-type': 'application/json', }, api_params) - def update_prefs(self, team_id: str, prefs: dict): - """Update preferences""" + def update_prefs(self, team_id: str, prefs: dict) -> Dict[str, Any]: + """ + Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. + Parameters + ---------- + team_id : str + Team ID. + prefs : dict + Prefs key-value JSON object. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/teams/{teamId}/prefs' api_params = {} diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 09155c3..afa8b7d 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -1,5 +1,5 @@ from ..service import Service -from typing import List +from typing import List, Dict, Any from ..exception import AppwriteException from ..enums.password_hash import PasswordHash; from ..enums.authenticator_type import AuthenticatorType; @@ -7,11 +7,29 @@ class Users(Service): - def __init__(self, client): + def __init__(self, client) -> None: super(Users, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None): - """List users""" + def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the project's users. You can use the query params to filter your results. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users' api_params = {} @@ -23,8 +41,32 @@ def list(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, user_id: str, email: str = None, phone: str = None, password: str = None, name: str = None): - """Create user""" + def create(self, user_id: str, email: str = None, phone: str = None, password: str = None, name: str = None) -> Dict[str, Any]: + """ + Create a new user. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + phone : str + Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + password : str + Plain text user password. Must be at least 8 chars. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users' api_params = {} @@ -42,8 +84,30 @@ def create(self, user_id: str, email: str = None, phone: str = None, password: s 'content-type': 'application/json', }, api_params) - def create_argon2_user(self, user_id: str, email: str, password: str, name: str = None): - """Create user with Argon2 password""" + def create_argon2_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + """ + Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + password : str + User password hashed using Argon2. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/argon2' api_params = {} @@ -66,8 +130,30 @@ def create_argon2_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str = None): - """Create user with bcrypt password""" + def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + """ + Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + password : str + User password hashed using Bcrypt. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/bcrypt' api_params = {} @@ -90,8 +176,26 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: List[str] = None, search: str = None): - """List identities""" + def list_identities(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get identities for all users. + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/identities' api_params = {} @@ -103,8 +207,24 @@ def list_identities(self, queries: List[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def delete_identity(self, identity_id: str): - """Delete identity""" + def delete_identity(self, identity_id: str) -> Dict[str, Any]: + """ + Delete an identity by its unique ID. + Parameters + ---------- + identity_id : str + Identity ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/identities/{identityId}' api_params = {} @@ -118,8 +238,30 @@ def delete_identity(self, identity_id: str): 'content-type': 'application/json', }, api_params) - def create_md5_user(self, user_id: str, email: str, password: str, name: str = None): - """Create user with MD5 password""" + def create_md5_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + """ + Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + password : str + User password hashed using MD5. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/md5' api_params = {} @@ -142,8 +284,30 @@ def create_md5_user(self, user_id: str, email: str, password: str, name: str = N 'content-type': 'application/json', }, api_params) - def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str = None): - """Create user with PHPass password""" + def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + """ + Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + password : str + User password hashed using PHPass. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/phpass' api_params = {} @@ -166,8 +330,40 @@ def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def create_scrypt_user(self, user_id: str, email: str, password: str, password_salt: str, password_cpu: float, password_memory: float, password_parallel: float, password_length: float, name: str = None): - """Create user with Scrypt password""" + def create_scrypt_user(self, user_id: str, email: str, password: str, password_salt: str, password_cpu: float, password_memory: float, password_parallel: float, password_length: float, name: str = None) -> Dict[str, Any]: + """ + Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + password : str + User password hashed using Scrypt. + password_salt : str + Optional salt used to hash password. + password_cpu : float + Optional CPU cost used to hash password. + password_memory : float + Optional memory cost used to hash password. + password_parallel : float + Optional parallelization cost used to hash password. + password_length : float + Optional hash length used to hash password. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/scrypt' api_params = {} @@ -210,8 +406,36 @@ def create_scrypt_user(self, user_id: str, email: str, password: str, password_s 'content-type': 'application/json', }, api_params) - def create_scrypt_modified_user(self, user_id: str, email: str, password: str, password_salt: str, password_salt_separator: str, password_signer_key: str, name: str = None): - """Create user with Scrypt modified password""" + def create_scrypt_modified_user(self, user_id: str, email: str, password: str, password_salt: str, password_salt_separator: str, password_signer_key: str, name: str = None) -> Dict[str, Any]: + """ + Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + password : str + User password hashed using Scrypt Modified. + password_salt : str + Salt used to hash password. + password_salt_separator : str + Salt separator used to hash password. + password_signer_key : str + Signer key used to hash password. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/scrypt-modified' api_params = {} @@ -246,8 +470,32 @@ def create_scrypt_modified_user(self, user_id: str, email: str, password: str, p 'content-type': 'application/json', }, api_params) - def create_sha_user(self, user_id: str, email: str, password: str, password_version: PasswordHash = None, name: str = None): - """Create user with SHA password""" + def create_sha_user(self, user_id: str, email: str, password: str, password_version: PasswordHash = None, name: str = None) -> Dict[str, Any]: + """ + Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + email : str + User email. + password : str + User password hashed using SHA. + password_version : PasswordHash + Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512' + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/sha' api_params = {} @@ -271,8 +519,24 @@ def create_sha_user(self, user_id: str, email: str, password: str, password_vers 'content-type': 'application/json', }, api_params) - def get(self, user_id: str): - """Get user""" + def get(self, user_id: str) -> Dict[str, Any]: + """ + Get a user by its unique ID. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}' api_params = {} @@ -286,8 +550,24 @@ def get(self, user_id: str): 'content-type': 'application/json', }, api_params) - def delete(self, user_id: str): - """Delete user""" + def delete(self, user_id: str) -> Dict[str, Any]: + """ + Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}' api_params = {} @@ -301,8 +581,26 @@ def delete(self, user_id: str): 'content-type': 'application/json', }, api_params) - def update_email(self, user_id: str, email: str): - """Update email""" + def update_email(self, user_id: str, email: str) -> Dict[str, Any]: + """ + Update the user email by its unique ID. + Parameters + ---------- + user_id : str + User ID. + email : str + User email. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/email' api_params = {} @@ -320,8 +618,28 @@ def update_email(self, user_id: str, email: str): 'content-type': 'application/json', }, api_params) - def create_jwt(self, user_id: str, session_id: str = None, duration: float = None): - """Create user JWT""" + def create_jwt(self, user_id: str, session_id: str = None, duration: float = None) -> Dict[str, Any]: + """ + Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. + Parameters + ---------- + user_id : str + User ID. + session_id : str + Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. + duration : float + Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/jwts' api_params = {} @@ -337,8 +655,28 @@ def create_jwt(self, user_id: str, session_id: str = None, duration: float = Non 'content-type': 'application/json', }, api_params) - def update_labels(self, user_id: str, labels: List[str]): - """Update user labels""" + def update_labels(self, user_id: str, labels: List[str]) -> Dict[str, Any]: + """ + Update the user labels by its unique ID. + + Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. + Parameters + ---------- + user_id : str + User ID. + labels : List[str] + Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/labels' api_params = {} @@ -356,8 +694,26 @@ def update_labels(self, user_id: str, labels: List[str]): 'content-type': 'application/json', }, api_params) - def list_logs(self, user_id: str, queries: List[str] = None): - """List user logs""" + def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get the user activity logs list by its unique ID. + Parameters + ---------- + user_id : str + User ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/logs' api_params = {} @@ -372,8 +728,24 @@ def list_logs(self, user_id: str, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def list_memberships(self, user_id: str): - """List user memberships""" + def list_memberships(self, user_id: str) -> Dict[str, Any]: + """ + Get the user membership list by its unique ID. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/memberships' api_params = {} @@ -387,8 +759,26 @@ def list_memberships(self, user_id: str): 'content-type': 'application/json', }, api_params) - def update_mfa(self, user_id: str, mfa: bool): - """Update MFA""" + def update_mfa(self, user_id: str, mfa: bool) -> Dict[str, Any]: + """ + Enable or disable MFA on a user account. + Parameters + ---------- + user_id : str + User ID. + mfa : bool + Enable or disable MFA. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/mfa' api_params = {} @@ -406,8 +796,26 @@ def update_mfa(self, user_id: str, mfa: bool): 'content-type': 'application/json', }, api_params) - def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType): - """Delete authenticator""" + def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType) -> Dict[str, Any]: + """ + Delete an authenticator app. + Parameters + ---------- + user_id : str + User ID. + type : AuthenticatorType + Type of authenticator. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/mfa/authenticators/{type}' api_params = {} @@ -425,8 +833,24 @@ def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType): 'content-type': 'application/json', }, api_params) - def list_mfa_factors(self, user_id: str): - """List factors""" + def list_mfa_factors(self, user_id: str) -> Dict[str, Any]: + """ + List the factors available on the account to be used as a MFA challange. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/mfa/factors' api_params = {} @@ -440,8 +864,24 @@ def list_mfa_factors(self, user_id: str): 'content-type': 'application/json', }, api_params) - def get_mfa_recovery_codes(self, user_id: str): - """Get MFA recovery codes""" + def get_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: + """ + Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} @@ -455,8 +895,24 @@ def get_mfa_recovery_codes(self, user_id: str): 'content-type': 'application/json', }, api_params) - def update_mfa_recovery_codes(self, user_id: str): - """Regenerate MFA recovery codes""" + def update_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: + """ + Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} @@ -470,8 +926,24 @@ def update_mfa_recovery_codes(self, user_id: str): 'content-type': 'application/json', }, api_params) - def create_mfa_recovery_codes(self, user_id: str): - """Create MFA recovery codes""" + def create_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: + """ + Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/mfa/recovery-codes' api_params = {} @@ -485,8 +957,26 @@ def create_mfa_recovery_codes(self, user_id: str): 'content-type': 'application/json', }, api_params) - def update_name(self, user_id: str, name: str): - """Update name""" + def update_name(self, user_id: str, name: str) -> Dict[str, Any]: + """ + Update the user name by its unique ID. + Parameters + ---------- + user_id : str + User ID. + name : str + User name. Max length: 128 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/name' api_params = {} @@ -504,8 +994,26 @@ def update_name(self, user_id: str, name: str): 'content-type': 'application/json', }, api_params) - def update_password(self, user_id: str, password: str): - """Update password""" + def update_password(self, user_id: str, password: str) -> Dict[str, Any]: + """ + Update the user password by its unique ID. + Parameters + ---------- + user_id : str + User ID. + password : str + New user password. Must be at least 8 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/password' api_params = {} @@ -523,8 +1031,26 @@ def update_password(self, user_id: str, password: str): 'content-type': 'application/json', }, api_params) - def update_phone(self, user_id: str, number: str): - """Update phone""" + def update_phone(self, user_id: str, number: str) -> Dict[str, Any]: + """ + Update the user phone by its unique ID. + Parameters + ---------- + user_id : str + User ID. + number : str + User phone number. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/phone' api_params = {} @@ -542,8 +1068,24 @@ def update_phone(self, user_id: str, number: str): 'content-type': 'application/json', }, api_params) - def get_prefs(self, user_id: str): - """Get user preferences""" + def get_prefs(self, user_id: str) -> Dict[str, Any]: + """ + Get the user preferences by its unique ID. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/prefs' api_params = {} @@ -557,8 +1099,26 @@ def get_prefs(self, user_id: str): 'content-type': 'application/json', }, api_params) - def update_prefs(self, user_id: str, prefs: dict): - """Update user preferences""" + def update_prefs(self, user_id: str, prefs: dict) -> Dict[str, Any]: + """ + Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. + Parameters + ---------- + user_id : str + User ID. + prefs : dict + Prefs key-value JSON object. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/prefs' api_params = {} @@ -576,8 +1136,24 @@ def update_prefs(self, user_id: str, prefs: dict): 'content-type': 'application/json', }, api_params) - def list_sessions(self, user_id: str): - """List user sessions""" + def list_sessions(self, user_id: str) -> Dict[str, Any]: + """ + Get the user sessions list by its unique ID. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/sessions' api_params = {} @@ -591,8 +1167,26 @@ def list_sessions(self, user_id: str): 'content-type': 'application/json', }, api_params) - def create_session(self, user_id: str): - """Create session""" + def create_session(self, user_id: str) -> Dict[str, Any]: + """ + Creates a session for a user. Returns an immediately usable session object. + + If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint. + Parameters + ---------- + user_id : str + User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/sessions' api_params = {} @@ -606,8 +1200,24 @@ def create_session(self, user_id: str): 'content-type': 'application/json', }, api_params) - def delete_sessions(self, user_id: str): - """Delete user sessions""" + def delete_sessions(self, user_id: str) -> Dict[str, Any]: + """ + Delete all user's sessions by using the user's unique ID. + Parameters + ---------- + user_id : str + User ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/sessions' api_params = {} @@ -621,8 +1231,26 @@ def delete_sessions(self, user_id: str): 'content-type': 'application/json', }, api_params) - def delete_session(self, user_id: str, session_id: str): - """Delete user session""" + def delete_session(self, user_id: str, session_id: str) -> Dict[str, Any]: + """ + Delete a user sessions by its unique ID. + Parameters + ---------- + user_id : str + User ID. + session_id : str + Session ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/sessions/{sessionId}' api_params = {} @@ -640,8 +1268,26 @@ def delete_session(self, user_id: str, session_id: str): 'content-type': 'application/json', }, api_params) - def update_status(self, user_id: str, status: bool): - """Update user status""" + def update_status(self, user_id: str, status: bool) -> Dict[str, Any]: + """ + Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. + Parameters + ---------- + user_id : str + User ID. + status : bool + User Status. To activate the user pass `true` and to block the user pass `false`. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/status' api_params = {} @@ -659,8 +1305,26 @@ def update_status(self, user_id: str, status: bool): 'content-type': 'application/json', }, api_params) - def list_targets(self, user_id: str, queries: List[str] = None): - """List user targets""" + def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + List the messaging targets that are associated with a user. + Parameters + ---------- + user_id : str + User ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/targets' api_params = {} @@ -675,8 +1339,34 @@ def list_targets(self, user_id: str, queries: List[str] = None): 'content-type': 'application/json', }, api_params) - def create_target(self, user_id: str, target_id: str, provider_type: MessagingProviderType, identifier: str, provider_id: str = None, name: str = None): - """Create user target""" + def create_target(self, user_id: str, target_id: str, provider_type: MessagingProviderType, identifier: str, provider_id: str = None, name: str = None) -> Dict[str, Any]: + """ + Create a messaging target. + Parameters + ---------- + user_id : str + User ID. + target_id : str + Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + provider_type : MessagingProviderType + The target provider type. Can be one of the following: `email`, `sms` or `push`. + identifier : str + The target identifier (token, email, phone etc.) + provider_id : str + Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. + name : str + Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/targets' api_params = {} @@ -704,8 +1394,26 @@ def create_target(self, user_id: str, target_id: str, provider_type: MessagingPr 'content-type': 'application/json', }, api_params) - def get_target(self, user_id: str, target_id: str): - """Get user target""" + def get_target(self, user_id: str, target_id: str) -> Dict[str, Any]: + """ + Get a user's push notification target by ID. + Parameters + ---------- + user_id : str + User ID. + target_id : str + Target ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/targets/{targetId}' api_params = {} @@ -723,8 +1431,32 @@ def get_target(self, user_id: str, target_id: str): 'content-type': 'application/json', }, api_params) - def update_target(self, user_id: str, target_id: str, identifier: str = None, provider_id: str = None, name: str = None): - """Update user target""" + def update_target(self, user_id: str, target_id: str, identifier: str = None, provider_id: str = None, name: str = None) -> Dict[str, Any]: + """ + Update a messaging target. + Parameters + ---------- + user_id : str + User ID. + target_id : str + Target ID. + identifier : str + The target identifier (token, email, phone etc.) + provider_id : str + Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. + name : str + Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/targets/{targetId}' api_params = {} @@ -745,8 +1477,26 @@ def update_target(self, user_id: str, target_id: str, identifier: str = None, pr 'content-type': 'application/json', }, api_params) - def delete_target(self, user_id: str, target_id: str): - """Delete user target""" + def delete_target(self, user_id: str, target_id: str) -> Dict[str, Any]: + """ + Delete a messaging target. + Parameters + ---------- + user_id : str + User ID. + target_id : str + Target ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/targets/{targetId}' api_params = {} @@ -764,8 +1514,29 @@ def delete_target(self, user_id: str, target_id: str): 'content-type': 'application/json', }, api_params) - def create_token(self, user_id: str, length: float = None, expire: float = None): - """Create token""" + def create_token(self, user_id: str, length: float = None, expire: float = None) -> Dict[str, Any]: + """ + Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. + + Parameters + ---------- + user_id : str + User ID. + length : float + Token length in characters. The default length is 6 characters + expire : float + Token expiration period in seconds. The default expiration is 15 minutes. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/tokens' api_params = {} @@ -781,8 +1552,26 @@ def create_token(self, user_id: str, length: float = None, expire: float = None) 'content-type': 'application/json', }, api_params) - def update_email_verification(self, user_id: str, email_verification: bool): - """Update email verification""" + def update_email_verification(self, user_id: str, email_verification: bool) -> Dict[str, Any]: + """ + Update the user email verification status by its unique ID. + Parameters + ---------- + user_id : str + User ID. + email_verification : bool + User email verification status. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/verification' api_params = {} @@ -800,8 +1589,26 @@ def update_email_verification(self, user_id: str, email_verification: bool): 'content-type': 'application/json', }, api_params) - def update_phone_verification(self, user_id: str, phone_verification: bool): - """Update phone verification""" + def update_phone_verification(self, user_id: str, phone_verification: bool) -> Dict[str, Any]: + """ + Update the user phone verification status by its unique ID. + Parameters + ---------- + user_id : str + User ID. + phone_verification : bool + User phone verification status. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ api_path = '/users/{userId}/verification/phone' api_params = {} diff --git a/setup.py b/setup.py index d427818..6ffadf7 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '9.0.2', + version = '9.0.3', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.2.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.3.tar.gz', install_requires=[ 'requests', ], From 38f20eb17a35a60eb66a10e138fce562e3af03eb Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Tue, 25 Mar 2025 14:24:54 +0000 Subject: [PATCH 47/60] chore: add addtional space --- appwrite/services/account.py | 43 +++++++++++++++++++++++++++++++ appwrite/services/avatars.py | 7 ++++++ appwrite/services/databases.py | 42 +++++++++++++++++++++++++++++++ appwrite/services/functions.py | 24 ++++++++++++++++++ appwrite/services/graphql.py | 2 ++ appwrite/services/health.py | 23 +++++++++++++++++ appwrite/services/locale.py | 8 ++++++ appwrite/services/messaging.py | 46 ++++++++++++++++++++++++++++++++++ appwrite/services/storage.py | 13 ++++++++++ appwrite/services/teams.py | 13 ++++++++++ appwrite/services/users.py | 42 +++++++++++++++++++++++++++++++ 11 files changed, 263 insertions(+) diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 70b7eab..d2fdf9a 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -13,6 +13,7 @@ def __init__(self, client) -> None: def get(self) -> Dict[str, Any]: """ Get the currently logged in user. + Returns ------- Dict[str, Any] @@ -34,6 +35,7 @@ def get(self) -> Dict[str, Any]: def create(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: """ Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). + Parameters ---------- user_id : str @@ -82,6 +84,7 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]: Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + Parameters ---------- email : str @@ -119,6 +122,7 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]: def list_identities(self, queries: List[str] = None) -> Dict[str, Any]: """ Get the list of identities for the currently logged in user. + Parameters ---------- queries : List[str] @@ -147,6 +151,7 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]: def delete_identity(self, identity_id: str) -> Dict[str, Any]: """ Delete an identity by its unique ID. + Parameters ---------- identity_id : str @@ -178,6 +183,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: def create_jwt(self) -> Dict[str, Any]: """ Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. + Returns ------- Dict[str, Any] @@ -199,6 +205,7 @@ def create_jwt(self) -> Dict[str, Any]: def list_logs(self, queries: List[str] = None) -> Dict[str, Any]: """ Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. + Parameters ---------- queries : List[str] @@ -227,6 +234,7 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]: def update_mfa(self, mfa: bool) -> Dict[str, Any]: """ Enable or disable MFA on an account. + Parameters ---------- mfa : bool @@ -258,6 +266,7 @@ def update_mfa(self, mfa: bool) -> Dict[str, Any]: def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: """ Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. + Parameters ---------- type : AuthenticatorType @@ -289,6 +298,7 @@ def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[str, Any]: """ Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. + Parameters ---------- type : AuthenticatorType @@ -326,6 +336,7 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[st def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: """ Delete an authenticator for a user by ID. + Parameters ---------- type : AuthenticatorType @@ -357,6 +368,7 @@ def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]: """ Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. + Parameters ---------- factor : AuthenticationFactor @@ -388,6 +400,7 @@ def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]: def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]: """ Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. + Parameters ---------- challenge_id : str @@ -425,6 +438,7 @@ def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]: def list_mfa_factors(self) -> Dict[str, Any]: """ List the factors available on the account to be used as a MFA challange. + Returns ------- Dict[str, Any] @@ -446,6 +460,7 @@ def list_mfa_factors(self) -> Dict[str, Any]: def get_mfa_recovery_codes(self) -> Dict[str, Any]: """ Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. + Returns ------- Dict[str, Any] @@ -467,6 +482,7 @@ def get_mfa_recovery_codes(self) -> Dict[str, Any]: def create_mfa_recovery_codes(self) -> Dict[str, Any]: """ Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. + Returns ------- Dict[str, Any] @@ -488,6 +504,7 @@ def create_mfa_recovery_codes(self) -> Dict[str, Any]: def update_mfa_recovery_codes(self) -> Dict[str, Any]: """ Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. + Returns ------- Dict[str, Any] @@ -509,6 +526,7 @@ def update_mfa_recovery_codes(self) -> Dict[str, Any]: def update_name(self, name: str) -> Dict[str, Any]: """ Update currently logged in user account name. + Parameters ---------- name : str @@ -540,6 +558,7 @@ def update_name(self, name: str) -> Dict[str, Any]: def update_password(self, password: str, old_password: str = None) -> Dict[str, Any]: """ Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. + Parameters ---------- password : str @@ -574,6 +593,7 @@ def update_password(self, password: str, old_password: str = None) -> Dict[str, def update_phone(self, phone: str, password: str) -> Dict[str, Any]: """ Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. + Parameters ---------- phone : str @@ -611,6 +631,7 @@ def update_phone(self, phone: str, password: str) -> Dict[str, Any]: def get_prefs(self) -> Dict[str, Any]: """ Get the preferences as a key-value object for the currently logged in user. + Returns ------- Dict[str, Any] @@ -632,6 +653,7 @@ def get_prefs(self) -> Dict[str, Any]: def update_prefs(self, prefs: dict) -> Dict[str, Any]: """ Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. + Parameters ---------- prefs : dict @@ -663,6 +685,7 @@ def update_prefs(self, prefs: dict) -> Dict[str, Any]: def create_recovery(self, email: str, url: str) -> Dict[str, Any]: """ Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. + Parameters ---------- email : str @@ -702,6 +725,7 @@ def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str, Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + Parameters ---------- user_id : str @@ -745,6 +769,7 @@ def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str, def list_sessions(self) -> Dict[str, Any]: """ Get the list of active sessions across different devices for the currently logged in user. + Returns ------- Dict[str, Any] @@ -766,6 +791,7 @@ def list_sessions(self) -> Dict[str, Any]: def delete_sessions(self) -> Dict[str, Any]: """ Delete all sessions from the user account and remove any sessions cookies from the end client. + Returns ------- Dict[str, Any] @@ -787,6 +813,7 @@ def delete_sessions(self) -> Dict[str, Any]: def create_anonymous_session(self) -> Dict[str, Any]: """ Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session). + Returns ------- Dict[str, Any] @@ -810,6 +837,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str, Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- email : str @@ -847,6 +875,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str, def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters ---------- user_id : str @@ -884,6 +913,7 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters ---------- user_id : str @@ -921,6 +951,7 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]: def create_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters ---------- user_id : str @@ -958,6 +989,7 @@ def create_session(self, user_id: str, secret: str) -> Dict[str, Any]: def get_session(self, session_id: str) -> Dict[str, Any]: """ Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. + Parameters ---------- session_id : str @@ -989,6 +1021,7 @@ def get_session(self, session_id: str) -> Dict[str, Any]: def update_session(self, session_id: str) -> Dict[str, Any]: """ Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. + Parameters ---------- session_id : str @@ -1020,6 +1053,7 @@ def update_session(self, session_id: str) -> Dict[str, Any]: def delete_session(self, session_id: str) -> Dict[str, Any]: """ Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. + Parameters ---------- session_id : str @@ -1051,6 +1085,7 @@ def delete_session(self, session_id: str) -> Dict[str, Any]: def update_status(self) -> Dict[str, Any]: """ Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead. + Returns ------- Dict[str, Any] @@ -1074,6 +1109,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1117,6 +1153,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1164,6 +1201,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- provider : OAuthProvider @@ -1206,6 +1244,7 @@ def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]: Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1246,6 +1285,7 @@ def create_verification(self, url: str) -> Dict[str, Any]: Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + Parameters ---------- url : str @@ -1277,6 +1317,7 @@ def create_verification(self, url: str) -> Dict[str, Any]: def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. + Parameters ---------- user_id : str @@ -1314,6 +1355,7 @@ def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]: def create_phone_verification(self) -> Dict[str, Any]: """ Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. + Returns ------- Dict[str, Any] @@ -1335,6 +1377,7 @@ def create_phone_verification(self) -> Dict[str, Any]: def update_phone_verification(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. + Parameters ---------- user_id : str diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 85e0e44..2778447 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -15,6 +15,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : Browser @@ -58,6 +59,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : CreditCard @@ -100,6 +102,7 @@ def get_favicon(self, url: str) -> Dict[str, Any]: Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. This endpoint does not follow HTTP redirects. + Parameters ---------- url : str @@ -134,6 +137,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : Flag @@ -178,6 +182,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> Dict When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. This endpoint does not follow HTTP redirects. + Parameters ---------- url : str @@ -220,6 +225,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- name : str @@ -258,6 +264,7 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download: """ Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. + Parameters ---------- text : str diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 583647a..facfdea 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -13,6 +13,7 @@ def __init__(self, client) -> None: def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. + Parameters ---------- queries : List[str] @@ -45,6 +46,7 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, """ Create a new Database. + Parameters ---------- database_id : str @@ -85,6 +87,7 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, def get(self, database_id: str) -> Dict[str, Any]: """ Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. + Parameters ---------- database_id : str @@ -116,6 +119,7 @@ def get(self, database_id: str) -> Dict[str, Any]: def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: """ Update a database by its unique ID. + Parameters ---------- database_id : str @@ -156,6 +160,7 @@ def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, def delete(self, database_id: str) -> Dict[str, Any]: """ Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. + Parameters ---------- database_id : str @@ -187,6 +192,7 @@ def delete(self, database_id: str) -> Dict[str, Any]: def list_collections(self, database_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. + Parameters ---------- database_id : str @@ -224,6 +230,7 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: def create_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + Parameters ---------- database_id : str @@ -276,6 +283,7 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any]: """ Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. + Parameters ---------- database_id : str @@ -313,6 +321,7 @@ def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any] def update_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None) -> Dict[str, Any]: """ Update a collection by its unique ID. + Parameters ---------- database_id : str @@ -365,6 +374,7 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, Any]: """ Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. + Parameters ---------- database_id : str @@ -402,6 +412,7 @@ def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, A def list_attributes(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: """ List attributes in the collection. + Parameters ---------- database_id : str @@ -443,6 +454,7 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st """ Create a boolean attribute. + Parameters ---------- database_id : str @@ -498,6 +510,7 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st def update_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool, new_key: str = None) -> Dict[str, Any]: """ Update a boolean attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -553,6 +566,7 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st def create_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: """ Create a date time attribute according to the ISO 8601 standard. + Parameters ---------- database_id : str @@ -608,6 +622,7 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s def update_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: """ Update a date time attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -664,6 +679,7 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, """ Create an email attribute. + Parameters ---------- database_id : str @@ -720,6 +736,7 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, """ Update an email attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -776,6 +793,7 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, """ Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. + Parameters ---------- database_id : str @@ -838,6 +856,7 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, """ Update an enum attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -900,6 +919,7 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, """ Create a float attribute. Optionally, minimum and maximum values can be provided. + Parameters ---------- database_id : str @@ -962,6 +982,7 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, """ Update a float attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1024,6 +1045,7 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st """ Create an integer attribute. Optionally, minimum and maximum values can be provided. + Parameters ---------- database_id : str @@ -1086,6 +1108,7 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st """ Update an integer attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1148,6 +1171,7 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re """ Create IP address attribute. + Parameters ---------- database_id : str @@ -1204,6 +1228,7 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re """ Update an ip attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1260,6 +1285,7 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re """ Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + Parameters ---------- database_id : str @@ -1322,6 +1348,7 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str """ Create a string attribute. + Parameters ---------- database_id : str @@ -1387,6 +1414,7 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str """ Update a string attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1446,6 +1474,7 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r """ Create a URL attribute. + Parameters ---------- database_id : str @@ -1502,6 +1531,7 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r """ Update an url attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1557,6 +1587,7 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: """ Get attribute by ID. + Parameters ---------- database_id : str @@ -1600,6 +1631,7 @@ def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[ def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: """ Deletes an attribute. + Parameters ---------- database_id : str @@ -1644,6 +1676,7 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke """ Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + Parameters ---------- database_id : str @@ -1693,6 +1726,7 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke def list_documents(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + Parameters ---------- database_id : str @@ -1734,6 +1768,7 @@ def create_document(self, database_id: str, collection_id: str, document_id: str """ Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + Parameters ---------- database_id : str @@ -1786,6 +1821,7 @@ def create_document(self, database_id: str, collection_id: str, document_id: str def get_document(self, database_id: str, collection_id: str, document_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + Parameters ---------- database_id : str @@ -1832,6 +1868,7 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: List[str] = None) -> Dict[str, Any]: """ Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + Parameters ---------- database_id : str @@ -1881,6 +1918,7 @@ def update_document(self, database_id: str, collection_id: str, document_id: str def delete_document(self, database_id: str, collection_id: str, document_id: str) -> Dict[str, Any]: """ Delete a document by its unique ID. + Parameters ---------- database_id : str @@ -1924,6 +1962,7 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str def list_indexes(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: """ List indexes in the collection. + Parameters ---------- database_id : str @@ -1965,6 +2004,7 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind """ Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be `key`, `fulltext`, and `unique`. + Parameters ---------- database_id : str @@ -2023,6 +2063,7 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: """ Get index by ID. + Parameters ---------- database_id : str @@ -2066,6 +2107,7 @@ def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, def delete_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: """ Delete an index. + Parameters ---------- database_id : str diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index ce0a60a..6567166 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -13,6 +13,7 @@ def __init__(self, client) -> None: def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's functions. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -44,6 +45,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None) -> Dict[str, Any]: """ Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. + Parameters ---------- function_id : str @@ -144,6 +146,7 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st def list_runtimes(self) -> Dict[str, Any]: """ Get a list of all runtimes that are currently active on your instance. + Returns ------- Dict[str, Any] @@ -166,6 +169,7 @@ def list_specifications(self) -> Dict[str, Any]: """ List allowed function specifications for this instance. + Returns ------- Dict[str, Any] @@ -187,6 +191,7 @@ def list_specifications(self) -> Dict[str, Any]: def get(self, function_id: str) -> Dict[str, Any]: """ Get a function by its unique ID. + Parameters ---------- function_id : str @@ -218,6 +223,7 @@ def get(self, function_id: str) -> Dict[str, Any]: def update(self, function_id: str, name: str, runtime: Runtime = None, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: """ Update function by its unique ID. + Parameters ---------- function_id : str @@ -303,6 +309,7 @@ def update(self, function_id: str, name: str, runtime: Runtime = None, execute: def delete(self, function_id: str) -> Dict[str, Any]: """ Delete a function by its unique ID. + Parameters ---------- function_id : str @@ -334,6 +341,7 @@ def delete(self, function_id: str) -> Dict[str, Any]: def list_deployments(self, function_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's code deployments. You can use the query params to filter your results. + Parameters ---------- function_id : str @@ -375,6 +383,7 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions). Use the "command" param to set the entrypoint used to execute your code. + Parameters ---------- function_id : str @@ -431,6 +440,7 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: """ Get a code deployment by its unique ID. + Parameters ---------- function_id : str @@ -468,6 +478,7 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any] def update_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: """ Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint. + Parameters ---------- function_id : str @@ -505,6 +516,7 @@ def update_deployment(self, function_id: str, deployment_id: str) -> Dict[str, A def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: """ Delete a code deployment by its unique ID. + Parameters ---------- function_id : str @@ -542,6 +554,7 @@ def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, A def create_build(self, function_id: str, deployment_id: str, build_id: str = None) -> Dict[str, Any]: """ Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + Parameters ---------- function_id : str @@ -582,6 +595,7 @@ def create_build(self, function_id: str, deployment_id: str, build_id: str = Non def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[str, Any]: """ Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + Parameters ---------- function_id : str @@ -619,6 +633,7 @@ def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[ def get_deployment_download(self, function_id: str, deployment_id: str) -> Dict[str, Any]: """ Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. + Parameters ---------- function_id : str @@ -656,6 +671,7 @@ def get_deployment_download(self, function_id: str, deployment_id: str) -> Dict[ def list_executions(self, function_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the current user function execution logs. You can use the query params to filter your results. + Parameters ---------- function_id : str @@ -693,6 +709,7 @@ def list_executions(self, function_id: str, queries: List[str] = None, search: s def create_execution(self, function_id: str, body: str = None, xasync: bool = None, path: str = None, method: ExecutionMethod = None, headers: dict = None, scheduled_at: str = None) -> Dict[str, Any]: """ Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. + Parameters ---------- function_id : str @@ -742,6 +759,7 @@ def create_execution(self, function_id: str, body: str = None, xasync: bool = No def get_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: """ Get a function execution log by its unique ID. + Parameters ---------- function_id : str @@ -780,6 +798,7 @@ def delete_execution(self, function_id: str, execution_id: str) -> Dict[str, Any """ Delete a function execution by its unique ID. + Parameters ---------- function_id : str @@ -817,6 +836,7 @@ def delete_execution(self, function_id: str, execution_id: str) -> Dict[str, Any def list_variables(self, function_id: str) -> Dict[str, Any]: """ Get a list of all variables of a specific function. + Parameters ---------- function_id : str @@ -848,6 +868,7 @@ def list_variables(self, function_id: str) -> Dict[str, Any]: def create_variable(self, function_id: str, key: str, value: str) -> Dict[str, Any]: """ Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. + Parameters ---------- function_id : str @@ -891,6 +912,7 @@ def create_variable(self, function_id: str, key: str, value: str) -> Dict[str, A def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: """ Get a variable by its unique ID. + Parameters ---------- function_id : str @@ -928,6 +950,7 @@ def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None) -> Dict[str, Any]: """ Update variable by its unique ID. + Parameters ---------- function_id : str @@ -974,6 +997,7 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s def delete_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: """ Delete a variable by its unique ID. + Parameters ---------- function_id : str diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 0981afa..22ca3aa 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -10,6 +10,7 @@ def __init__(self, client) -> None: def query(self, query: dict) -> Dict[str, Any]: """ Execute a GraphQL mutation. + Parameters ---------- query : dict @@ -42,6 +43,7 @@ def query(self, query: dict) -> Dict[str, Any]: def mutation(self, query: dict) -> Dict[str, Any]: """ Execute a GraphQL mutation. + Parameters ---------- query : dict diff --git a/appwrite/services/health.py b/appwrite/services/health.py index 0007496..23f5aa9 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -11,6 +11,7 @@ def __init__(self, client) -> None: def get(self) -> Dict[str, Any]: """ Check the Appwrite HTTP server is up and responsive. + Returns ------- Dict[str, Any] @@ -32,6 +33,7 @@ def get(self) -> Dict[str, Any]: def get_antivirus(self) -> Dict[str, Any]: """ Check the Appwrite Antivirus server is up and connection is successful. + Returns ------- Dict[str, Any] @@ -53,6 +55,7 @@ def get_antivirus(self) -> Dict[str, Any]: def get_cache(self) -> Dict[str, Any]: """ Check the Appwrite in-memory cache servers are up and connection is successful. + Returns ------- Dict[str, Any] @@ -74,6 +77,7 @@ def get_cache(self) -> Dict[str, Any]: def get_certificate(self, domain: str = None) -> Dict[str, Any]: """ Get the SSL certificate for a domain + Parameters ---------- domain : str @@ -102,6 +106,7 @@ def get_certificate(self, domain: str = None) -> Dict[str, Any]: def get_db(self) -> Dict[str, Any]: """ Check the Appwrite database servers are up and connection is successful. + Returns ------- Dict[str, Any] @@ -123,6 +128,7 @@ def get_db(self) -> Dict[str, Any]: def get_pub_sub(self) -> Dict[str, Any]: """ Check the Appwrite pub-sub servers are up and connection is successful. + Returns ------- Dict[str, Any] @@ -144,6 +150,7 @@ def get_pub_sub(self) -> Dict[str, Any]: def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of builds that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -172,6 +179,7 @@ def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -200,6 +208,7 @@ def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict[str, Any]: """ Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- name : str @@ -231,6 +240,7 @@ def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -260,6 +270,7 @@ def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any] """ Returns the amount of failed jobs in a given queue. + Parameters ---------- name : Name @@ -294,6 +305,7 @@ def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any] def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -322,6 +334,7 @@ def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of logs that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -350,6 +363,7 @@ def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of mails that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -378,6 +392,7 @@ def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of messages that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -406,6 +421,7 @@ def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -434,6 +450,7 @@ def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. + Parameters ---------- threshold : float @@ -462,6 +479,7 @@ def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -490,6 +508,7 @@ def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: def get_queue_stats_usage_dump(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -518,6 +537,7 @@ def get_queue_stats_usage_dump(self, threshold: float = None) -> Dict[str, Any]: def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -546,6 +566,7 @@ def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: def get_storage(self) -> Dict[str, Any]: """ Check the Appwrite storage device is up and connection is successful. + Returns ------- Dict[str, Any] @@ -567,6 +588,7 @@ def get_storage(self) -> Dict[str, Any]: def get_storage_local(self) -> Dict[str, Any]: """ Check the Appwrite local storage device is up and connection is successful. + Returns ------- Dict[str, Any] @@ -588,6 +610,7 @@ def get_storage_local(self) -> Dict[str, Any]: def get_time(self) -> Dict[str, Any]: """ Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP. + Returns ------- Dict[str, Any] diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index 3f137a5..67f7a9c 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -12,6 +12,7 @@ def get(self) -> Dict[str, Any]: Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language. ([IP Geolocation by DB-IP](https://db-ip.com)) + Returns ------- Dict[str, Any] @@ -33,6 +34,7 @@ def get(self) -> Dict[str, Any]: def list_codes(self) -> Dict[str, Any]: """ List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). + Returns ------- Dict[str, Any] @@ -54,6 +56,7 @@ def list_codes(self) -> Dict[str, Any]: def list_continents(self) -> Dict[str, Any]: """ List of all continents. You can use the locale header to get the data in a supported language. + Returns ------- Dict[str, Any] @@ -75,6 +78,7 @@ def list_continents(self) -> Dict[str, Any]: def list_countries(self) -> Dict[str, Any]: """ List of all countries. You can use the locale header to get the data in a supported language. + Returns ------- Dict[str, Any] @@ -96,6 +100,7 @@ def list_countries(self) -> Dict[str, Any]: def list_countries_eu(self) -> Dict[str, Any]: """ List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language. + Returns ------- Dict[str, Any] @@ -117,6 +122,7 @@ def list_countries_eu(self) -> Dict[str, Any]: def list_countries_phones(self) -> Dict[str, Any]: """ List of all countries phone codes. You can use the locale header to get the data in a supported language. + Returns ------- Dict[str, Any] @@ -138,6 +144,7 @@ def list_countries_phones(self) -> Dict[str, Any]: def list_currencies(self) -> Dict[str, Any]: """ List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language. + Returns ------- Dict[str, Any] @@ -159,6 +166,7 @@ def list_currencies(self) -> Dict[str, Any]: def list_languages(self) -> Dict[str, Any]: """ List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. + Returns ------- Dict[str, Any] diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index d3aa1fb..684c08d 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -12,6 +12,7 @@ def __init__(self, client) -> None: def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all messages from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -43,6 +44,7 @@ def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[s def create_email(self, message_id: str, subject: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, cc: List[str] = None, bcc: List[str] = None, attachments: List[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None) -> Dict[str, Any]: """ Create a new email message. + Parameters ---------- message_id : str @@ -114,6 +116,7 @@ def update_email(self, message_id: str, topics: List[str] = None, users: List[st """ Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -178,6 +181,7 @@ def update_email(self, message_id: str, topics: List[str] = None, users: List[st def create_push(self, message_id: str, title: str = None, body: str = None, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None) -> Dict[str, Any]: """ Create a new push notification. + Parameters ---------- message_id : str @@ -264,6 +268,7 @@ def update_push(self, message_id: str, topics: List[str] = None, users: List[str """ Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -349,6 +354,7 @@ def update_push(self, message_id: str, topics: List[str] = None, users: List[str def create_sms(self, message_id: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, draft: bool = None, scheduled_at: str = None) -> Dict[str, Any]: """ Create a new SMS message. + Parameters ---------- message_id : str @@ -402,6 +408,7 @@ def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] """ Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -452,6 +459,7 @@ def get_message(self, message_id: str) -> Dict[str, Any]: """ Get a message by its unique ID. + Parameters ---------- message_id : str @@ -483,6 +491,7 @@ def get_message(self, message_id: str) -> Dict[str, Any]: def delete(self, message_id: str) -> Dict[str, Any]: """ Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message. + Parameters ---------- message_id : str @@ -514,6 +523,7 @@ def delete(self, message_id: str) -> Dict[str, Any]: def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get the message activity logs listed by its unique ID. + Parameters ---------- message_id : str @@ -548,6 +558,7 @@ def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[ def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get a list of the targets associated with a message. + Parameters ---------- message_id : str @@ -582,6 +593,7 @@ def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all providers from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -613,6 +625,7 @@ def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Apple Push Notification service provider. + Parameters ---------- provider_id : str @@ -668,6 +681,7 @@ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool = None, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None) -> Dict[str, Any]: """ Update a Apple Push Notification service provider by its unique ID. + Parameters ---------- provider_id : str @@ -720,6 +734,7 @@ def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool def create_fcm_provider(self, provider_id: str, name: str, service_account_json: dict = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Firebase Cloud Messaging provider. + Parameters ---------- provider_id : str @@ -763,6 +778,7 @@ def create_fcm_provider(self, provider_id: str, name: str, service_account_json: def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool = None, service_account_json: dict = None) -> Dict[str, Any]: """ Update a Firebase Cloud Messaging provider by its unique ID. + Parameters ---------- provider_id : str @@ -803,6 +819,7 @@ def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = None, domain: str = None, is_eu_region: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Mailgun provider. + Parameters ---------- provider_id : str @@ -864,6 +881,7 @@ def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = No def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: str = None, domain: str = None, is_eu_region: bool = None, enabled: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None) -> Dict[str, Any]: """ Update a Mailgun provider by its unique ID. + Parameters ---------- provider_id : str @@ -922,6 +940,7 @@ def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: s def create_msg91_provider(self, provider_id: str, name: str, template_id: str = None, sender_id: str = None, auth_key: str = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new MSG91 provider. + Parameters ---------- provider_id : str @@ -971,6 +990,7 @@ def create_msg91_provider(self, provider_id: str, name: str, template_id: str = def update_msg91_provider(self, provider_id: str, name: str = None, enabled: bool = None, template_id: str = None, sender_id: str = None, auth_key: str = None) -> Dict[str, Any]: """ Update a MSG91 provider by its unique ID. + Parameters ---------- provider_id : str @@ -1017,6 +1037,7 @@ def update_msg91_provider(self, provider_id: str, name: str = None, enabled: boo def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Sendgrid provider. + Parameters ---------- provider_id : str @@ -1072,6 +1093,7 @@ def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = N def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None) -> Dict[str, Any]: """ Update a Sendgrid provider by its unique ID. + Parameters ---------- provider_id : str @@ -1124,6 +1146,7 @@ def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: def create_smtp_provider(self, provider_id: str, name: str, host: str, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new SMTP provider. + Parameters ---------- provider_id : str @@ -1200,6 +1223,7 @@ def create_smtp_provider(self, provider_id: str, name: str, host: str, port: flo def update_smtp_provider(self, provider_id: str, name: str = None, host: str = None, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: """ Update a SMTP provider by its unique ID. + Parameters ---------- provider_id : str @@ -1270,6 +1294,7 @@ def update_smtp_provider(self, provider_id: str, name: str = None, host: str = N def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = None, customer_id: str = None, api_key: str = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Telesign provider. + Parameters ---------- provider_id : str @@ -1319,6 +1344,7 @@ def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = Non def update_telesign_provider(self, provider_id: str, name: str = None, enabled: bool = None, customer_id: str = None, api_key: str = None, xfrom: str = None) -> Dict[str, Any]: """ Update a Telesign provider by its unique ID. + Parameters ---------- provider_id : str @@ -1365,6 +1391,7 @@ def update_telesign_provider(self, provider_id: str, name: str = None, enabled: def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = None, username: str = None, api_key: str = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Textmagic provider. + Parameters ---------- provider_id : str @@ -1414,6 +1441,7 @@ def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = No def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: bool = None, username: str = None, api_key: str = None, xfrom: str = None) -> Dict[str, Any]: """ Update a Textmagic provider by its unique ID. + Parameters ---------- provider_id : str @@ -1460,6 +1488,7 @@ def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, account_sid: str = None, auth_token: str = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Twilio provider. + Parameters ---------- provider_id : str @@ -1509,6 +1538,7 @@ def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bool = None, account_sid: str = None, auth_token: str = None, xfrom: str = None) -> Dict[str, Any]: """ Update a Twilio provider by its unique ID. + Parameters ---------- provider_id : str @@ -1555,6 +1585,7 @@ def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bo def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, api_key: str = None, api_secret: str = None, enabled: bool = None) -> Dict[str, Any]: """ Create a new Vonage provider. + Parameters ---------- provider_id : str @@ -1604,6 +1635,7 @@ def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, api_secret: str = None, xfrom: str = None) -> Dict[str, Any]: """ Update a Vonage provider by its unique ID. + Parameters ---------- provider_id : str @@ -1651,6 +1683,7 @@ def get_provider(self, provider_id: str) -> Dict[str, Any]: """ Get a provider by its unique ID. + Parameters ---------- provider_id : str @@ -1682,6 +1715,7 @@ def get_provider(self, provider_id: str) -> Dict[str, Any]: def delete_provider(self, provider_id: str) -> Dict[str, Any]: """ Delete a provider by its unique ID. + Parameters ---------- provider_id : str @@ -1713,6 +1747,7 @@ def delete_provider(self, provider_id: str) -> Dict[str, Any]: def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get the provider activity logs listed by its unique ID. + Parameters ---------- provider_id : str @@ -1747,6 +1782,7 @@ def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dic def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get the subscriber activity logs listed by its unique ID. + Parameters ---------- subscriber_id : str @@ -1781,6 +1817,7 @@ def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all topics from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -1812,6 +1849,7 @@ def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None) -> Dict[str, Any]: """ Create a new topic. + Parameters ---------- topic_id : str @@ -1853,6 +1891,7 @@ def get_topic(self, topic_id: str) -> Dict[str, Any]: """ Get a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1885,6 +1924,7 @@ def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = N """ Update a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1922,6 +1962,7 @@ def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = N def delete_topic(self, topic_id: str) -> Dict[str, Any]: """ Delete a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1953,6 +1994,7 @@ def delete_topic(self, topic_id: str) -> Dict[str, Any]: def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get the topic activity logs listed by its unique ID. + Parameters ---------- topic_id : str @@ -1987,6 +2029,7 @@ def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all subscribers from the current Appwrite project. + Parameters ---------- topic_id : str @@ -2024,6 +2067,7 @@ def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str) -> Dict[str, Any]: """ Create a new subscriber. + Parameters ---------- topic_id : str @@ -2068,6 +2112,7 @@ def get_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: """ Get a subscriber by its unique ID. + Parameters ---------- topic_id : str @@ -2105,6 +2150,7 @@ def get_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: def delete_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: """ Delete a subscriber by its unique ID. + Parameters ---------- topic_id : str diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index c1d6d58..128698c 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -14,6 +14,7 @@ def __init__(self, client) -> None: def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the storage buckets. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -45,6 +46,7 @@ def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[st def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None) -> Dict[str, Any]: """ Create a new storage bucket. + Parameters ---------- bucket_id : str @@ -106,6 +108,7 @@ def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None def get_bucket(self, bucket_id: str) -> Dict[str, Any]: """ Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata. + Parameters ---------- bucket_id : str @@ -137,6 +140,7 @@ def get_bucket(self, bucket_id: str) -> Dict[str, Any]: def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None) -> Dict[str, Any]: """ Update a storage bucket by its unique ID. + Parameters ---------- bucket_id : str @@ -198,6 +202,7 @@ def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None def delete_bucket(self, bucket_id: str) -> Dict[str, Any]: """ Delete a storage bucket by its unique ID. + Parameters ---------- bucket_id : str @@ -229,6 +234,7 @@ def delete_bucket(self, bucket_id: str) -> Dict[str, Any]: def list_files(self, bucket_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the user files. You can use the query params to filter your results. + Parameters ---------- bucket_id : str @@ -273,6 +279,7 @@ def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. + Parameters ---------- bucket_id : str @@ -327,6 +334,7 @@ def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions def get_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. + Parameters ---------- bucket_id : str @@ -364,6 +372,7 @@ def get_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: List[str] = None) -> Dict[str, Any]: """ Update a file by its unique ID. Only users with write permissions have access to update this resource. + Parameters ---------- bucket_id : str @@ -407,6 +416,7 @@ def update_file(self, bucket_id: str, file_id: str, name: str = None, permission def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Delete a file by its unique ID. Only users with write permissions have access to delete this resource. + Parameters ---------- bucket_id : str @@ -444,6 +454,7 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + Parameters ---------- bucket_id : str @@ -481,6 +492,7 @@ def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]: def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> Dict[str, Any]: """ Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. + Parameters ---------- bucket_id : str @@ -551,6 +563,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he def get_file_view(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. + Parameters ---------- bucket_id : str diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index f330966..2a106a5 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -10,6 +10,7 @@ def __init__(self, client) -> None: def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. + Parameters ---------- queries : List[str] @@ -41,6 +42,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, Any]: """ Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. + Parameters ---------- team_id : str @@ -81,6 +83,7 @@ def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, def get(self, team_id: str) -> Dict[str, Any]: """ Get a team by its ID. All team members have read access for this resource. + Parameters ---------- team_id : str @@ -112,6 +115,7 @@ def get(self, team_id: str) -> Dict[str, Any]: def update_name(self, team_id: str, name: str) -> Dict[str, Any]: """ Update the team's name by its unique ID. + Parameters ---------- team_id : str @@ -149,6 +153,7 @@ def update_name(self, team_id: str, name: str) -> Dict[str, Any]: def delete(self, team_id: str) -> Dict[str, Any]: """ Delete a team using its ID. Only team members with the owner role can delete the team. + Parameters ---------- team_id : str @@ -180,6 +185,7 @@ def delete(self, team_id: str) -> Dict[str, Any]: def list_memberships(self, team_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. + Parameters ---------- team_id : str @@ -224,6 +230,7 @@ def create_membership(self, team_id: str, roles: List[str], email: str = None, u Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. + Parameters ---------- team_id : str @@ -276,6 +283,7 @@ def create_membership(self, team_id: str, roles: List[str], email: str = None, u def get_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: """ Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. + Parameters ---------- team_id : str @@ -314,6 +322,7 @@ def update_membership(self, team_id: str, membership_id: str, roles: List[str]) """ Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). + Parameters ---------- team_id : str @@ -357,6 +366,7 @@ def update_membership(self, team_id: str, membership_id: str, roles: List[str]) def delete_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: """ This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted. + Parameters ---------- team_id : str @@ -397,6 +407,7 @@ def update_membership_status(self, team_id: str, membership_id: str, user_id: st If the request is successful, a session for the user is automatically created. + Parameters ---------- team_id : str @@ -446,6 +457,7 @@ def update_membership_status(self, team_id: str, membership_id: str, user_id: st def get_prefs(self, team_id: str) -> Dict[str, Any]: """ Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). + Parameters ---------- team_id : str @@ -477,6 +489,7 @@ def get_prefs(self, team_id: str) -> Dict[str, Any]: def update_prefs(self, team_id: str, prefs: dict) -> Dict[str, Any]: """ Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. + Parameters ---------- team_id : str diff --git a/appwrite/services/users.py b/appwrite/services/users.py index afa8b7d..f4497c1 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -13,6 +13,7 @@ def __init__(self, client) -> None: def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's users. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -44,6 +45,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: def create(self, user_id: str, email: str = None, phone: str = None, password: str = None, name: str = None) -> Dict[str, Any]: """ Create a new user. + Parameters ---------- user_id : str @@ -87,6 +89,7 @@ def create(self, user_id: str, email: str = None, phone: str = None, password: s def create_argon2_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -133,6 +136,7 @@ def create_argon2_user(self, user_id: str, email: str, password: str, name: str def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -179,6 +183,7 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str def list_identities(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get identities for all users. + Parameters ---------- queries : List[str] @@ -210,6 +215,7 @@ def list_identities(self, queries: List[str] = None, search: str = None) -> Dict def delete_identity(self, identity_id: str) -> Dict[str, Any]: """ Delete an identity by its unique ID. + Parameters ---------- identity_id : str @@ -241,6 +247,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: def create_md5_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -287,6 +294,7 @@ def create_md5_user(self, user_id: str, email: str, password: str, name: str = N def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -333,6 +341,7 @@ def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str def create_scrypt_user(self, user_id: str, email: str, password: str, password_salt: str, password_cpu: float, password_memory: float, password_parallel: float, password_length: float, name: str = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -409,6 +418,7 @@ def create_scrypt_user(self, user_id: str, email: str, password: str, password_s def create_scrypt_modified_user(self, user_id: str, email: str, password: str, password_salt: str, password_salt_separator: str, password_signer_key: str, name: str = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -473,6 +483,7 @@ def create_scrypt_modified_user(self, user_id: str, email: str, password: str, p def create_sha_user(self, user_id: str, email: str, password: str, password_version: PasswordHash = None, name: str = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -522,6 +533,7 @@ def create_sha_user(self, user_id: str, email: str, password: str, password_vers def get(self, user_id: str) -> Dict[str, Any]: """ Get a user by its unique ID. + Parameters ---------- user_id : str @@ -553,6 +565,7 @@ def get(self, user_id: str) -> Dict[str, Any]: def delete(self, user_id: str) -> Dict[str, Any]: """ Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. + Parameters ---------- user_id : str @@ -584,6 +597,7 @@ def delete(self, user_id: str) -> Dict[str, Any]: def update_email(self, user_id: str, email: str) -> Dict[str, Any]: """ Update the user email by its unique ID. + Parameters ---------- user_id : str @@ -621,6 +635,7 @@ def update_email(self, user_id: str, email: str) -> Dict[str, Any]: def create_jwt(self, user_id: str, session_id: str = None, duration: float = None) -> Dict[str, Any]: """ Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. + Parameters ---------- user_id : str @@ -660,6 +675,7 @@ def update_labels(self, user_id: str, labels: List[str]) -> Dict[str, Any]: Update the user labels by its unique ID. Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. + Parameters ---------- user_id : str @@ -697,6 +713,7 @@ def update_labels(self, user_id: str, labels: List[str]) -> Dict[str, Any]: def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get the user activity logs list by its unique ID. + Parameters ---------- user_id : str @@ -731,6 +748,7 @@ def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: def list_memberships(self, user_id: str) -> Dict[str, Any]: """ Get the user membership list by its unique ID. + Parameters ---------- user_id : str @@ -762,6 +780,7 @@ def list_memberships(self, user_id: str) -> Dict[str, Any]: def update_mfa(self, user_id: str, mfa: bool) -> Dict[str, Any]: """ Enable or disable MFA on a user account. + Parameters ---------- user_id : str @@ -799,6 +818,7 @@ def update_mfa(self, user_id: str, mfa: bool) -> Dict[str, Any]: def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType) -> Dict[str, Any]: """ Delete an authenticator app. + Parameters ---------- user_id : str @@ -836,6 +856,7 @@ def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType) -> Dic def list_mfa_factors(self, user_id: str) -> Dict[str, Any]: """ List the factors available on the account to be used as a MFA challange. + Parameters ---------- user_id : str @@ -867,6 +888,7 @@ def list_mfa_factors(self, user_id: str) -> Dict[str, Any]: def get_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. + Parameters ---------- user_id : str @@ -898,6 +920,7 @@ def get_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: def update_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. + Parameters ---------- user_id : str @@ -929,6 +952,7 @@ def update_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: def create_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. + Parameters ---------- user_id : str @@ -960,6 +984,7 @@ def create_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: def update_name(self, user_id: str, name: str) -> Dict[str, Any]: """ Update the user name by its unique ID. + Parameters ---------- user_id : str @@ -997,6 +1022,7 @@ def update_name(self, user_id: str, name: str) -> Dict[str, Any]: def update_password(self, user_id: str, password: str) -> Dict[str, Any]: """ Update the user password by its unique ID. + Parameters ---------- user_id : str @@ -1034,6 +1060,7 @@ def update_password(self, user_id: str, password: str) -> Dict[str, Any]: def update_phone(self, user_id: str, number: str) -> Dict[str, Any]: """ Update the user phone by its unique ID. + Parameters ---------- user_id : str @@ -1071,6 +1098,7 @@ def update_phone(self, user_id: str, number: str) -> Dict[str, Any]: def get_prefs(self, user_id: str) -> Dict[str, Any]: """ Get the user preferences by its unique ID. + Parameters ---------- user_id : str @@ -1102,6 +1130,7 @@ def get_prefs(self, user_id: str) -> Dict[str, Any]: def update_prefs(self, user_id: str, prefs: dict) -> Dict[str, Any]: """ Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. + Parameters ---------- user_id : str @@ -1139,6 +1168,7 @@ def update_prefs(self, user_id: str, prefs: dict) -> Dict[str, Any]: def list_sessions(self, user_id: str) -> Dict[str, Any]: """ Get the user sessions list by its unique ID. + Parameters ---------- user_id : str @@ -1172,6 +1202,7 @@ def create_session(self, user_id: str) -> Dict[str, Any]: Creates a session for a user. Returns an immediately usable session object. If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint. + Parameters ---------- user_id : str @@ -1203,6 +1234,7 @@ def create_session(self, user_id: str) -> Dict[str, Any]: def delete_sessions(self, user_id: str) -> Dict[str, Any]: """ Delete all user's sessions by using the user's unique ID. + Parameters ---------- user_id : str @@ -1234,6 +1266,7 @@ def delete_sessions(self, user_id: str) -> Dict[str, Any]: def delete_session(self, user_id: str, session_id: str) -> Dict[str, Any]: """ Delete a user sessions by its unique ID. + Parameters ---------- user_id : str @@ -1271,6 +1304,7 @@ def delete_session(self, user_id: str, session_id: str) -> Dict[str, Any]: def update_status(self, user_id: str, status: bool) -> Dict[str, Any]: """ Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. + Parameters ---------- user_id : str @@ -1308,6 +1342,7 @@ def update_status(self, user_id: str, status: bool) -> Dict[str, Any]: def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: """ List the messaging targets that are associated with a user. + Parameters ---------- user_id : str @@ -1342,6 +1377,7 @@ def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any def create_target(self, user_id: str, target_id: str, provider_type: MessagingProviderType, identifier: str, provider_id: str = None, name: str = None) -> Dict[str, Any]: """ Create a messaging target. + Parameters ---------- user_id : str @@ -1397,6 +1433,7 @@ def create_target(self, user_id: str, target_id: str, provider_type: MessagingPr def get_target(self, user_id: str, target_id: str) -> Dict[str, Any]: """ Get a user's push notification target by ID. + Parameters ---------- user_id : str @@ -1434,6 +1471,7 @@ def get_target(self, user_id: str, target_id: str) -> Dict[str, Any]: def update_target(self, user_id: str, target_id: str, identifier: str = None, provider_id: str = None, name: str = None) -> Dict[str, Any]: """ Update a messaging target. + Parameters ---------- user_id : str @@ -1480,6 +1518,7 @@ def update_target(self, user_id: str, target_id: str, identifier: str = None, pr def delete_target(self, user_id: str, target_id: str) -> Dict[str, Any]: """ Delete a messaging target. + Parameters ---------- user_id : str @@ -1518,6 +1557,7 @@ def create_token(self, user_id: str, length: float = None, expire: float = None) """ Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. + Parameters ---------- user_id : str @@ -1555,6 +1595,7 @@ def create_token(self, user_id: str, length: float = None, expire: float = None) def update_email_verification(self, user_id: str, email_verification: bool) -> Dict[str, Any]: """ Update the user email verification status by its unique ID. + Parameters ---------- user_id : str @@ -1592,6 +1633,7 @@ def update_email_verification(self, user_id: str, email_verification: bool) -> D def update_phone_verification(self, user_id: str, phone_verification: bool) -> Dict[str, Any]: """ Update the user phone verification status by its unique ID. + Parameters ---------- user_id : str From a09439f5b5b72285b5760e94d43294cdbfe9b54d Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Tue, 25 Mar 2025 16:10:50 +0000 Subject: [PATCH 48/60] fix: return type for some sdks --- appwrite/services/avatars.py | 42 +++++++++++++++++----------------- appwrite/services/functions.py | 6 ++--- appwrite/services/storage.py | 18 +++++++-------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 2778447..26e576a 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -10,7 +10,7 @@ class Avatars(Service): def __init__(self, client) -> None: super(Avatars, self).__init__(client) - def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]: + def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None) -> str: """ You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. @@ -29,8 +29,8 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ @@ -53,7 +53,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, 'content-type': 'application/json', }, api_params) - def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]: + def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> str: """ The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. @@ -73,8 +73,8 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ @@ -97,7 +97,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = 'content-type': 'application/json', }, api_params) - def get_favicon(self, url: str) -> Dict[str, Any]: + def get_favicon(self, url: str) -> str: """ Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. @@ -110,8 +110,8 @@ def get_favicon(self, url: str) -> Dict[str, Any]: Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ @@ -131,7 +131,7 @@ def get_favicon(self, url: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]: + def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> str: """ You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. @@ -151,8 +151,8 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ @@ -175,7 +175,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit 'content-type': 'application/json', }, api_params) - def get_image(self, url: str, width: float = None, height: float = None) -> Dict[str, Any]: + def get_image(self, url: str, width: float = None, height: float = None) -> str: """ Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. @@ -194,8 +194,8 @@ def get_image(self, url: str, width: float = None, height: float = None) -> Dict Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ @@ -217,7 +217,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> Dict 'content-type': 'application/json', }, api_params) - def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> Dict[str, Any]: + def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> str: """ Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. @@ -239,8 +239,8 @@ def get_initials(self, name: str = None, width: float = None, height: float = No Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ @@ -260,7 +260,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No 'content-type': 'application/json', }, api_params) - def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> Dict[str, Any]: + def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> str: """ Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. @@ -278,8 +278,8 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download: Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 6567166..baf500b 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -630,7 +630,7 @@ def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[ 'content-type': 'application/json', }, api_params) - def get_deployment_download(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + def get_deployment_download(self, function_id: str, deployment_id: str) -> str: """ Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. @@ -643,8 +643,8 @@ def get_deployment_download(self, function_id: str, deployment_id: str) -> Dict[ Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 128698c..e289978 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -451,7 +451,7 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]: + def get_file_download(self, bucket_id: str, file_id: str) -> str: """ Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. @@ -464,8 +464,8 @@ def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]: Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ @@ -489,7 +489,7 @@ def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> Dict[str, Any]: + def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> str: """ Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. @@ -524,8 +524,8 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ @@ -560,7 +560,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he 'content-type': 'application/json', }, api_params) - def get_file_view(self, bucket_id: str, file_id: str) -> Dict[str, Any]: + def get_file_view(self, bucket_id: str, file_id: str) -> str: """ Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. @@ -573,8 +573,8 @@ def get_file_view(self, bucket_id: str, file_id: str) -> Dict[str, Any]: Returns ------- - Dict[str, Any] - API response as a dictionary + str + Response as a string Raises ------ From 6770a335f60b95ba455cd52c752caa1c6864b2cd Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Tue, 25 Mar 2025 16:34:40 +0000 Subject: [PATCH 49/60] fix: typing to be bytes --- appwrite/services/avatars.py | 42 +++++++++++++++++----------------- appwrite/services/functions.py | 6 ++--- appwrite/services/storage.py | 18 +++++++-------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 26e576a..efec859 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -10,7 +10,7 @@ class Avatars(Service): def __init__(self, client) -> None: super(Avatars, self).__init__(client) - def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None) -> str: + def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None) -> bytes: """ You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. @@ -29,8 +29,8 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ @@ -53,7 +53,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, 'content-type': 'application/json', }, api_params) - def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> str: + def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> bytes: """ The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. @@ -73,8 +73,8 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ @@ -97,7 +97,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = 'content-type': 'application/json', }, api_params) - def get_favicon(self, url: str) -> str: + def get_favicon(self, url: str) -> bytes: """ Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. @@ -110,8 +110,8 @@ def get_favicon(self, url: str) -> str: Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ @@ -131,7 +131,7 @@ def get_favicon(self, url: str) -> str: 'content-type': 'application/json', }, api_params) - def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> str: + def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> bytes: """ You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. @@ -151,8 +151,8 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ @@ -175,7 +175,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit 'content-type': 'application/json', }, api_params) - def get_image(self, url: str, width: float = None, height: float = None) -> str: + def get_image(self, url: str, width: float = None, height: float = None) -> bytes: """ Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. @@ -194,8 +194,8 @@ def get_image(self, url: str, width: float = None, height: float = None) -> str: Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ @@ -217,7 +217,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> str: 'content-type': 'application/json', }, api_params) - def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> str: + def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> bytes: """ Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. @@ -239,8 +239,8 @@ def get_initials(self, name: str = None, width: float = None, height: float = No Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ @@ -260,7 +260,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No 'content-type': 'application/json', }, api_params) - def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> str: + def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> bytes: """ Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. @@ -278,8 +278,8 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download: Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index baf500b..7db7323 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -630,7 +630,7 @@ def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[ 'content-type': 'application/json', }, api_params) - def get_deployment_download(self, function_id: str, deployment_id: str) -> str: + def get_deployment_download(self, function_id: str, deployment_id: str) -> bytes: """ Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. @@ -643,8 +643,8 @@ def get_deployment_download(self, function_id: str, deployment_id: str) -> str: Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index e289978..cf43652 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -451,7 +451,7 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def get_file_download(self, bucket_id: str, file_id: str) -> str: + def get_file_download(self, bucket_id: str, file_id: str) -> bytes: """ Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. @@ -464,8 +464,8 @@ def get_file_download(self, bucket_id: str, file_id: str) -> str: Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ @@ -489,7 +489,7 @@ def get_file_download(self, bucket_id: str, file_id: str) -> str: 'content-type': 'application/json', }, api_params) - def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> str: + def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> bytes: """ Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. @@ -524,8 +524,8 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ @@ -560,7 +560,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he 'content-type': 'application/json', }, api_params) - def get_file_view(self, bucket_id: str, file_id: str) -> str: + def get_file_view(self, bucket_id: str, file_id: str) -> bytes: """ Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. @@ -573,8 +573,8 @@ def get_file_view(self, bucket_id: str, file_id: str) -> str: Returns ------- - str - Response as a string + bytes + Response as bytes Raises ------ From 54c05a4b657b388a88e52a4e30748ce2b67a6930 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Thu, 17 Apr 2025 19:55:00 +0100 Subject: [PATCH 50/60] fix: remove content-type from GET requests --- README.md | 2 +- appwrite/client.py | 7 ++- appwrite/enums/name.py | 1 - appwrite/enums/o_auth_provider.py | 1 + appwrite/services/account.py | 11 +--- appwrite/services/avatars.py | 7 --- appwrite/services/databases.py | 10 ---- appwrite/services/functions.py | 11 ---- appwrite/services/health.py | 51 ------------------- appwrite/services/locale.py | 8 --- appwrite/services/messaging.py | 13 ----- appwrite/services/storage.py | 7 --- appwrite/services/teams.py | 5 -- appwrite/services/users.py | 11 ---- .../health/get-queue-stats-usage-dump.md | 13 ----- setup.py | 4 +- 16 files changed, 10 insertions(+), 152 deletions(-) delete mode 100644 docs/examples/health/get-queue-stats-usage-dump.md diff --git a/README.md b/README.md index 466c7ac..c16cd61 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index a65edeb..ce46fde 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/9.0.3 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/9.0.4 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '9.0.3', + 'x-sdk-version': '9.0.4', 'X-Appwrite-Response-Format' : '1.6.0', } @@ -27,6 +27,9 @@ def set_self_signed(self, status=True): return self def set_endpoint(self, endpoint): + if not endpoint.startswith('http://') and not endpoint.startswith('https://'): + raise AppwriteException('Invalid endpoint URL: ' + endpoint) + self._endpoint = endpoint return self diff --git a/appwrite/enums/name.py b/appwrite/enums/name.py index 0ac227e..c4b981e 100644 --- a/appwrite/enums/name.py +++ b/appwrite/enums/name.py @@ -8,7 +8,6 @@ class Name(Enum): V1_FUNCTIONS = "v1-functions" V1_STATS_RESOURCES = "v1-stats-resources" V1_STATS_USAGE = "v1-stats-usage" - V1_STATS_USAGE_DUMP = "v1-stats-usage-dump" V1_WEBHOOKS = "v1-webhooks" V1_CERTIFICATES = "v1-certificates" V1_BUILDS = "v1-builds" diff --git a/appwrite/enums/o_auth_provider.py b/appwrite/enums/o_auth_provider.py index 3d46c8e..6c1e6bd 100644 --- a/appwrite/enums/o_auth_provider.py +++ b/appwrite/enums/o_auth_provider.py @@ -15,6 +15,7 @@ class OAuthProvider(Enum): DROPBOX = "dropbox" ETSY = "etsy" FACEBOOK = "facebook" + FIGMA = "figma" GITHUB = "github" GITLAB = "gitlab" GOOGLE = "google" diff --git a/appwrite/services/account.py b/appwrite/services/account.py index d2fdf9a..9dd3c5e 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -29,7 +29,6 @@ def get(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: @@ -145,7 +144,6 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]: api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete_identity(self, identity_id: str) -> Dict[str, Any]: @@ -228,7 +226,6 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]: api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_mfa(self, mfa: bool) -> Dict[str, Any]: @@ -454,7 +451,6 @@ def list_mfa_factors(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_mfa_recovery_codes(self) -> Dict[str, Any]: @@ -476,7 +472,6 @@ def get_mfa_recovery_codes(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_mfa_recovery_codes(self) -> Dict[str, Any]: @@ -647,7 +642,6 @@ def get_prefs(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_prefs(self, prefs: dict) -> Dict[str, Any]: @@ -785,7 +779,6 @@ def list_sessions(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete_sessions(self) -> Dict[str, Any]: @@ -1015,7 +1008,6 @@ def get_session(self, session_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_session(self, session_id: str) -> Dict[str, Any]: @@ -1205,7 +1197,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai Parameters ---------- provider : OAuthProvider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. success : str URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. failure : str @@ -1236,7 +1228,6 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai api_params['scopes'] = scopes return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params, response_type='location') def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]: diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index efec859..36e15d8 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -50,7 +50,6 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, api_params['quality'] = quality return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> bytes: @@ -94,7 +93,6 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = api_params['quality'] = quality return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_favicon(self, url: str) -> bytes: @@ -128,7 +126,6 @@ def get_favicon(self, url: str) -> bytes: api_params['url'] = url return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> bytes: @@ -172,7 +169,6 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit api_params['quality'] = quality return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_image(self, url: str, width: float = None, height: float = None) -> bytes: @@ -214,7 +210,6 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte api_params['height'] = height return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> bytes: @@ -257,7 +252,6 @@ def get_initials(self, name: str = None, width: float = None, height: float = No api_params['background'] = background return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> bytes: @@ -299,5 +293,4 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download: api_params['download'] = download return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index facfdea..0335087 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -39,7 +39,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: @@ -113,7 +112,6 @@ def get(self, database_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: @@ -224,7 +222,6 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None) -> Dict[str, Any]: @@ -315,7 +312,6 @@ def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any] return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None) -> Dict[str, Any]: @@ -447,7 +443,6 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool = None, array: bool = None) -> Dict[str, Any]: @@ -1625,7 +1620,6 @@ def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[ return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: @@ -1761,7 +1755,6 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None) -> Dict[str, Any]: @@ -1862,7 +1855,6 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: List[str] = None) -> Dict[str, Any]: @@ -1997,7 +1989,6 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: List[str] = None) -> Dict[str, Any]: @@ -2101,7 +2092,6 @@ def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 7db7323..a483a22 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -39,7 +39,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None) -> Dict[str, Any]: @@ -162,7 +161,6 @@ def list_runtimes(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_specifications(self) -> Dict[str, Any]: @@ -185,7 +183,6 @@ def list_specifications(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get(self, function_id: str) -> Dict[str, Any]: @@ -217,7 +214,6 @@ def get(self, function_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update(self, function_id: str, name: str, runtime: Runtime = None, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: @@ -373,7 +369,6 @@ def list_deployments(self, function_id: str, queries: List[str] = None, search: api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_deployment(self, function_id: str, code: InputFile, activate: bool, entrypoint: str = None, commands: str = None, on_progress = None) -> Dict[str, Any]: @@ -472,7 +467,6 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any] return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: @@ -665,7 +659,6 @@ def get_deployment_download(self, function_id: str, deployment_id: str) -> bytes return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_executions(self, function_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: @@ -703,7 +696,6 @@ def list_executions(self, function_id: str, queries: List[str] = None, search: s api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_execution(self, function_id: str, body: str = None, xasync: bool = None, path: str = None, method: ExecutionMethod = None, headers: dict = None, scheduled_at: str = None) -> Dict[str, Any]: @@ -791,7 +783,6 @@ def get_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: @@ -862,7 +853,6 @@ def list_variables(self, function_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_variable(self, function_id: str, key: str, value: str) -> Dict[str, Any]: @@ -944,7 +934,6 @@ def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None) -> Dict[str, Any]: diff --git a/appwrite/services/health.py b/appwrite/services/health.py index 23f5aa9..dd1d183 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -27,7 +27,6 @@ def get(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_antivirus(self) -> Dict[str, Any]: @@ -49,7 +48,6 @@ def get_antivirus(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_cache(self) -> Dict[str, Any]: @@ -71,7 +69,6 @@ def get_cache(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_certificate(self, domain: str = None) -> Dict[str, Any]: @@ -100,7 +97,6 @@ def get_certificate(self, domain: str = None) -> Dict[str, Any]: api_params['domain'] = domain return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_db(self) -> Dict[str, Any]: @@ -122,7 +118,6 @@ def get_db(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_pub_sub(self) -> Dict[str, Any]: @@ -144,7 +139,6 @@ def get_pub_sub(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: @@ -173,7 +167,6 @@ def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: @@ -202,7 +195,6 @@ def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict[str, Any]: @@ -234,7 +226,6 @@ def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: @@ -263,7 +254,6 @@ def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any]: @@ -299,7 +289,6 @@ def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any] api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: @@ -328,7 +317,6 @@ def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: @@ -357,7 +345,6 @@ def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: @@ -386,7 +373,6 @@ def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: @@ -415,7 +401,6 @@ def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: @@ -444,7 +429,6 @@ def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: @@ -473,7 +457,6 @@ def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: @@ -502,36 +485,6 @@ def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_queue_stats_usage_dump(self, threshold: float = None) -> Dict[str, Any]: - """ - Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server. - - Parameters - ---------- - threshold : float - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/health/queue/stats-usage-dump' - api_params = {} - - api_params['threshold'] = threshold - - return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: @@ -560,7 +513,6 @@ def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: api_params['threshold'] = threshold return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_storage(self) -> Dict[str, Any]: @@ -582,7 +534,6 @@ def get_storage(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_storage_local(self) -> Dict[str, Any]: @@ -604,7 +555,6 @@ def get_storage_local(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_time(self) -> Dict[str, Any]: @@ -626,5 +576,4 @@ def get_time(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index 67f7a9c..c34ddee 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -28,7 +28,6 @@ def get(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_codes(self) -> Dict[str, Any]: @@ -50,7 +49,6 @@ def list_codes(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_continents(self) -> Dict[str, Any]: @@ -72,7 +70,6 @@ def list_continents(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_countries(self) -> Dict[str, Any]: @@ -94,7 +91,6 @@ def list_countries(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_countries_eu(self) -> Dict[str, Any]: @@ -116,7 +112,6 @@ def list_countries_eu(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_countries_phones(self) -> Dict[str, Any]: @@ -138,7 +133,6 @@ def list_countries_phones(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_currencies(self) -> Dict[str, Any]: @@ -160,7 +154,6 @@ def list_currencies(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_languages(self) -> Dict[str, Any]: @@ -182,5 +175,4 @@ def list_languages(self) -> Dict[str, Any]: api_params = {} return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 684c08d..639a820 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -38,7 +38,6 @@ def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[s api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_email(self, message_id: str, subject: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, cc: List[str] = None, bcc: List[str] = None, attachments: List[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None) -> Dict[str, Any]: @@ -485,7 +484,6 @@ def get_message(self, message_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete(self, message_id: str) -> Dict[str, Any]: @@ -552,7 +550,6 @@ def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[ api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, Any]: @@ -587,7 +584,6 @@ def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: @@ -619,7 +615,6 @@ def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[ api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None, enabled: bool = None) -> Dict[str, Any]: @@ -1709,7 +1704,6 @@ def get_provider(self, provider_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete_provider(self, provider_id: str) -> Dict[str, Any]: @@ -1776,7 +1770,6 @@ def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dic api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> Dict[str, Any]: @@ -1811,7 +1804,6 @@ def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: @@ -1843,7 +1835,6 @@ def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None) -> Dict[str, Any]: @@ -1917,7 +1908,6 @@ def get_topic(self, topic_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = None) -> Dict[str, Any]: @@ -2023,7 +2013,6 @@ def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: @@ -2061,7 +2050,6 @@ def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str) -> Dict[str, Any]: @@ -2144,7 +2132,6 @@ def get_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index cf43652..610e11e 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -40,7 +40,6 @@ def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[st api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None) -> Dict[str, Any]: @@ -134,7 +133,6 @@ def get_bucket(self, bucket_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None) -> Dict[str, Any]: @@ -266,7 +264,6 @@ def list_files(self, bucket_id: str, queries: List[str] = None, search: str = No api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: List[str] = None, on_progress = None) -> Dict[str, Any]: @@ -366,7 +363,6 @@ def get_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: List[str] = None) -> Dict[str, Any]: @@ -486,7 +482,6 @@ def get_file_download(self, bucket_id: str, file_id: str) -> bytes: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> bytes: @@ -557,7 +552,6 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he api_params['output'] = output return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_file_view(self, bucket_id: str, file_id: str) -> bytes: @@ -595,5 +589,4 @@ def get_file_view(self, bucket_id: str, file_id: str) -> bytes: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 2a106a5..778cd07 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -36,7 +36,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, Any]: @@ -109,7 +108,6 @@ def get(self, team_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_name(self, team_id: str, name: str) -> Dict[str, Any]: @@ -217,7 +215,6 @@ def list_memberships(self, team_id: str, queries: List[str] = None, search: str api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_membership(self, team_id: str, roles: List[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None) -> Dict[str, Any]: @@ -315,7 +312,6 @@ def get_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_membership(self, team_id: str, membership_id: str, roles: List[str]) -> Dict[str, Any]: @@ -483,7 +479,6 @@ def get_prefs(self, team_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_prefs(self, team_id: str, prefs: dict) -> Dict[str, Any]: diff --git a/appwrite/services/users.py b/appwrite/services/users.py index f4497c1..532c69f 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -39,7 +39,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create(self, user_id: str, email: str = None, phone: str = None, password: str = None, name: str = None) -> Dict[str, Any]: @@ -209,7 +208,6 @@ def list_identities(self, queries: List[str] = None, search: str = None) -> Dict api_params['search'] = search return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete_identity(self, identity_id: str) -> Dict[str, Any]: @@ -559,7 +557,6 @@ def get(self, user_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def delete(self, user_id: str) -> Dict[str, Any]: @@ -742,7 +739,6 @@ def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def list_memberships(self, user_id: str) -> Dict[str, Any]: @@ -774,7 +770,6 @@ def list_memberships(self, user_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_mfa(self, user_id: str, mfa: bool) -> Dict[str, Any]: @@ -882,7 +877,6 @@ def list_mfa_factors(self, user_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def get_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: @@ -914,7 +908,6 @@ def get_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: @@ -1124,7 +1117,6 @@ def get_prefs(self, user_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_prefs(self, user_id: str, prefs: dict) -> Dict[str, Any]: @@ -1194,7 +1186,6 @@ def list_sessions(self, user_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_session(self, user_id: str) -> Dict[str, Any]: @@ -1371,7 +1362,6 @@ def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any api_params['queries'] = queries return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def create_target(self, user_id: str, target_id: str, provider_type: MessagingProviderType, identifier: str, provider_id: str = None, name: str = None) -> Dict[str, Any]: @@ -1465,7 +1455,6 @@ def get_target(self, user_id: str, target_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { - 'content-type': 'application/json', }, api_params) def update_target(self, user_id: str, target_id: str, identifier: str = None, provider_id: str = None, name: str = None) -> Dict[str, Any]: diff --git a/docs/examples/health/get-queue-stats-usage-dump.md b/docs/examples/health/get-queue-stats-usage-dump.md deleted file mode 100644 index c58059e..0000000 --- a/docs/examples/health/get-queue-stats-usage-dump.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.health import Health - -client = Client() -client.set_endpoint('https://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 - -health = Health(client) - -result = health.get_queue_stats_usage_dump( - threshold = None # optional -) diff --git a/setup.py b/setup.py index 6ffadf7..1b9067b 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '9.0.3', + version = '9.0.4', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.3.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.4.tar.gz', install_requires=[ 'requests', ], From 0a2355c3e9bc73830a1d262bbc7b1315e4aaff13 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Thu, 17 Apr 2025 20:37:44 +0100 Subject: [PATCH 51/60] chore: major version bump --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index ce46fde..2548979 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/9.0.4 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/10.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '9.0.4', + 'x-sdk-version': '10.0.0', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/setup.py b/setup.py index 1b9067b..2534ed2 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '9.0.4', + version = '10.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.4.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/10.0.0.tar.gz', install_requires=[ 'requests', ], From ec6af741333f34ba153107a756c693bc69392111 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Thu, 8 May 2025 23:26:59 +1200 Subject: [PATCH 52/60] Add bulk API methods --- appwrite/client.py | 4 +- appwrite/services/databases.py | 173 +++++++++++++++++- .../account/create-anonymous-session.md | 2 +- .../account/create-email-password-session.md | 2 +- docs/examples/account/create-email-token.md | 2 +- docs/examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-token.md | 2 +- .../account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- .../account/create-mfa-recovery-codes.md | 2 +- docs/examples/account/create-o-auth2token.md | 2 +- docs/examples/account/create-phone-token.md | 2 +- .../account/create-phone-verification.md | 2 +- docs/examples/account/create-recovery.md | 2 +- docs/examples/account/create-session.md | 2 +- docs/examples/account/create-verification.md | 2 +- docs/examples/account/create.md | 2 +- docs/examples/account/delete-identity.md | 2 +- .../account/delete-mfa-authenticator.md | 2 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/delete-sessions.md | 2 +- .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/get-prefs.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/get.md | 2 +- docs/examples/account/list-identities.md | 2 +- docs/examples/account/list-logs.md | 2 +- docs/examples/account/list-mfa-factors.md | 2 +- docs/examples/account/list-sessions.md | 2 +- docs/examples/account/update-email.md | 2 +- docs/examples/account/update-m-f-a.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- .../account/update-mfa-recovery-codes.md | 2 +- docs/examples/account/update-name.md | 2 +- docs/examples/account/update-password.md | 2 +- docs/examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- docs/examples/account/update-phone.md | 2 +- docs/examples/account/update-prefs.md | 2 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-status.md | 2 +- docs/examples/account/update-verification.md | 2 +- docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-favicon.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/avatars/get-image.md | 2 +- docs/examples/avatars/get-initials.md | 2 +- docs/examples/avatars/get-q-r.md | 2 +- .../databases/create-boolean-attribute.md | 2 +- docs/examples/databases/create-collection.md | 2 +- .../databases/create-datetime-attribute.md | 2 +- docs/examples/databases/create-document.md | 2 +- docs/examples/databases/create-documents.md | 15 ++ .../databases/create-email-attribute.md | 2 +- .../databases/create-enum-attribute.md | 2 +- .../databases/create-float-attribute.md | 2 +- docs/examples/databases/create-index.md | 2 +- .../databases/create-integer-attribute.md | 2 +- .../examples/databases/create-ip-attribute.md | 2 +- .../create-relationship-attribute.md | 2 +- .../databases/create-string-attribute.md | 2 +- .../databases/create-url-attribute.md | 2 +- docs/examples/databases/create.md | 2 +- docs/examples/databases/delete-attribute.md | 2 +- docs/examples/databases/delete-collection.md | 2 +- docs/examples/databases/delete-document.md | 2 +- docs/examples/databases/delete-documents.md | 15 ++ docs/examples/databases/delete-index.md | 2 +- docs/examples/databases/delete.md | 2 +- docs/examples/databases/get-attribute.md | 2 +- docs/examples/databases/get-collection.md | 2 +- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/get-index.md | 2 +- docs/examples/databases/get.md | 2 +- docs/examples/databases/list-attributes.md | 2 +- docs/examples/databases/list-collections.md | 2 +- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.md | 2 +- docs/examples/databases/list.md | 2 +- .../databases/update-boolean-attribute.md | 2 +- docs/examples/databases/update-collection.md | 2 +- .../databases/update-datetime-attribute.md | 2 +- docs/examples/databases/update-document.md | 2 +- docs/examples/databases/update-documents.md | 16 ++ .../databases/update-email-attribute.md | 2 +- .../databases/update-enum-attribute.md | 2 +- .../databases/update-float-attribute.md | 2 +- .../databases/update-integer-attribute.md | 2 +- .../examples/databases/update-ip-attribute.md | 2 +- .../update-relationship-attribute.md | 2 +- .../databases/update-string-attribute.md | 2 +- .../databases/update-url-attribute.md | 2 +- docs/examples/databases/update.md | 2 +- docs/examples/databases/upsert-documents.md | 15 ++ docs/examples/functions/create-build.md | 2 +- docs/examples/functions/create-deployment.md | 2 +- docs/examples/functions/create-execution.md | 2 +- docs/examples/functions/create-variable.md | 2 +- docs/examples/functions/create.md | 2 +- docs/examples/functions/delete-deployment.md | 2 +- docs/examples/functions/delete-execution.md | 2 +- docs/examples/functions/delete-variable.md | 2 +- docs/examples/functions/delete.md | 2 +- .../functions/get-deployment-download.md | 2 +- docs/examples/functions/get-deployment.md | 2 +- docs/examples/functions/get-execution.md | 2 +- docs/examples/functions/get-variable.md | 2 +- docs/examples/functions/get.md | 2 +- docs/examples/functions/list-deployments.md | 2 +- docs/examples/functions/list-executions.md | 2 +- docs/examples/functions/list-runtimes.md | 2 +- .../examples/functions/list-specifications.md | 2 +- docs/examples/functions/list-variables.md | 2 +- docs/examples/functions/list.md | 2 +- .../functions/update-deployment-build.md | 2 +- docs/examples/functions/update-deployment.md | 2 +- docs/examples/functions/update-variable.md | 2 +- docs/examples/functions/update.md | 2 +- docs/examples/graphql/mutation.md | 2 +- docs/examples/graphql/query.md | 2 +- docs/examples/health/get-antivirus.md | 2 +- docs/examples/health/get-cache.md | 2 +- docs/examples/health/get-certificate.md | 2 +- docs/examples/health/get-d-b.md | 2 +- docs/examples/health/get-failed-jobs.md | 2 +- docs/examples/health/get-pub-sub.md | 2 +- docs/examples/health/get-queue-builds.md | 2 +- .../examples/health/get-queue-certificates.md | 2 +- docs/examples/health/get-queue-databases.md | 2 +- docs/examples/health/get-queue-deletes.md | 2 +- docs/examples/health/get-queue-functions.md | 2 +- docs/examples/health/get-queue-logs.md | 2 +- docs/examples/health/get-queue-mails.md | 2 +- docs/examples/health/get-queue-messaging.md | 2 +- docs/examples/health/get-queue-migrations.md | 2 +- .../health/get-queue-stats-resources.md | 2 +- docs/examples/health/get-queue-usage.md | 2 +- docs/examples/health/get-queue-webhooks.md | 2 +- docs/examples/health/get-storage-local.md | 2 +- docs/examples/health/get-storage.md | 2 +- docs/examples/health/get-time.md | 2 +- docs/examples/health/get.md | 2 +- docs/examples/locale/get.md | 2 +- docs/examples/locale/list-codes.md | 2 +- docs/examples/locale/list-continents.md | 2 +- docs/examples/locale/list-countries-e-u.md | 2 +- docs/examples/locale/list-countries-phones.md | 2 +- docs/examples/locale/list-countries.md | 2 +- docs/examples/locale/list-currencies.md | 2 +- docs/examples/locale/list-languages.md | 2 +- .../messaging/create-apns-provider.md | 2 +- docs/examples/messaging/create-email.md | 2 +- .../examples/messaging/create-fcm-provider.md | 2 +- .../messaging/create-mailgun-provider.md | 2 +- .../messaging/create-msg91provider.md | 2 +- docs/examples/messaging/create-push.md | 2 +- .../messaging/create-sendgrid-provider.md | 2 +- docs/examples/messaging/create-sms.md | 2 +- .../messaging/create-smtp-provider.md | 2 +- docs/examples/messaging/create-subscriber.md | 2 +- .../messaging/create-telesign-provider.md | 2 +- .../messaging/create-textmagic-provider.md | 2 +- docs/examples/messaging/create-topic.md | 2 +- .../messaging/create-twilio-provider.md | 2 +- .../messaging/create-vonage-provider.md | 2 +- docs/examples/messaging/delete-provider.md | 2 +- docs/examples/messaging/delete-subscriber.md | 2 +- docs/examples/messaging/delete-topic.md | 2 +- docs/examples/messaging/delete.md | 2 +- docs/examples/messaging/get-message.md | 2 +- docs/examples/messaging/get-provider.md | 2 +- docs/examples/messaging/get-subscriber.md | 2 +- docs/examples/messaging/get-topic.md | 2 +- docs/examples/messaging/list-message-logs.md | 2 +- docs/examples/messaging/list-messages.md | 2 +- docs/examples/messaging/list-provider-logs.md | 2 +- docs/examples/messaging/list-providers.md | 2 +- .../messaging/list-subscriber-logs.md | 2 +- docs/examples/messaging/list-subscribers.md | 2 +- docs/examples/messaging/list-targets.md | 2 +- docs/examples/messaging/list-topic-logs.md | 2 +- docs/examples/messaging/list-topics.md | 2 +- .../messaging/update-apns-provider.md | 2 +- docs/examples/messaging/update-email.md | 2 +- .../examples/messaging/update-fcm-provider.md | 2 +- .../messaging/update-mailgun-provider.md | 2 +- .../messaging/update-msg91provider.md | 2 +- docs/examples/messaging/update-push.md | 2 +- .../messaging/update-sendgrid-provider.md | 2 +- docs/examples/messaging/update-sms.md | 2 +- .../messaging/update-smtp-provider.md | 2 +- .../messaging/update-telesign-provider.md | 2 +- .../messaging/update-textmagic-provider.md | 2 +- docs/examples/messaging/update-topic.md | 2 +- .../messaging/update-twilio-provider.md | 2 +- .../messaging/update-vonage-provider.md | 2 +- docs/examples/storage/create-bucket.md | 2 +- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/delete-bucket.md | 2 +- docs/examples/storage/delete-file.md | 2 +- docs/examples/storage/get-bucket.md | 2 +- docs/examples/storage/get-file-download.md | 2 +- docs/examples/storage/get-file-preview.md | 2 +- docs/examples/storage/get-file-view.md | 2 +- docs/examples/storage/get-file.md | 2 +- docs/examples/storage/list-buckets.md | 2 +- docs/examples/storage/list-files.md | 2 +- docs/examples/storage/update-bucket.md | 2 +- docs/examples/storage/update-file.md | 2 +- docs/examples/teams/create-membership.md | 2 +- docs/examples/teams/create.md | 2 +- docs/examples/teams/delete-membership.md | 2 +- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 2 +- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-memberships.md | 2 +- docs/examples/teams/list.md | 2 +- .../teams/update-membership-status.md | 2 +- docs/examples/teams/update-membership.md | 2 +- docs/examples/teams/update-name.md | 2 +- docs/examples/teams/update-prefs.md | 2 +- docs/examples/users/create-argon2user.md | 2 +- docs/examples/users/create-bcrypt-user.md | 2 +- docs/examples/users/create-j-w-t.md | 2 +- docs/examples/users/create-m-d5user.md | 2 +- .../users/create-mfa-recovery-codes.md | 2 +- docs/examples/users/create-p-h-pass-user.md | 2 +- docs/examples/users/create-s-h-a-user.md | 2 +- .../users/create-scrypt-modified-user.md | 2 +- docs/examples/users/create-scrypt-user.md | 2 +- docs/examples/users/create-session.md | 2 +- docs/examples/users/create-target.md | 2 +- docs/examples/users/create-token.md | 2 +- docs/examples/users/create.md | 2 +- docs/examples/users/delete-identity.md | 2 +- .../users/delete-mfa-authenticator.md | 2 +- docs/examples/users/delete-session.md | 2 +- docs/examples/users/delete-sessions.md | 2 +- docs/examples/users/delete-target.md | 2 +- docs/examples/users/delete.md | 2 +- docs/examples/users/get-mfa-recovery-codes.md | 2 +- docs/examples/users/get-prefs.md | 2 +- docs/examples/users/get-target.md | 2 +- docs/examples/users/get.md | 2 +- docs/examples/users/list-identities.md | 2 +- docs/examples/users/list-logs.md | 2 +- docs/examples/users/list-memberships.md | 2 +- docs/examples/users/list-mfa-factors.md | 2 +- docs/examples/users/list-sessions.md | 2 +- docs/examples/users/list-targets.md | 2 +- docs/examples/users/list.md | 2 +- .../users/update-email-verification.md | 2 +- docs/examples/users/update-email.md | 2 +- docs/examples/users/update-labels.md | 2 +- .../users/update-mfa-recovery-codes.md | 2 +- docs/examples/users/update-mfa.md | 2 +- docs/examples/users/update-name.md | 2 +- docs/examples/users/update-password.md | 2 +- .../users/update-phone-verification.md | 2 +- docs/examples/users/update-phone.md | 2 +- docs/examples/users/update-prefs.md | 2 +- docs/examples/users/update-status.md | 2 +- docs/examples/users/update-target.md | 2 +- setup.py | 4 +- 269 files changed, 499 insertions(+), 267 deletions(-) create mode 100644 docs/examples/databases/create-documents.md create mode 100644 docs/examples/databases/delete-documents.md create mode 100644 docs/examples/databases/update-documents.md create mode 100644 docs/examples/databases/upsert-documents.md diff --git a/appwrite/client.py b/appwrite/client.py index 2548979..bab61ea 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/10.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/10.1.0-rc.1 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '10.0.0', + 'x-sdk-version': '10.1.0-rc.1', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 0335087..4561066 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -1760,7 +1760,6 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None) -> Dict[str, Any]: """ Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - Parameters ---------- @@ -1811,6 +1810,178 @@ def create_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) + def create_documents(self, database_id: str, collection_id: str, documents: List[dict]) -> Dict[str, Any]: + """ + Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + documents : List[dict] + Array of documents data as JSON objects. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if collection_id is None: + raise AppwriteException('Missing required parameter: "collection_id"') + + if documents is None: + raise AppwriteException('Missing required parameter: "documents"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{collectionId}', collection_id) + + api_params['documents'] = documents + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def upsert_documents(self, database_id: str, collection_id: str, documents: List[dict] = None) -> Dict[str, Any]: + """ + Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + documents : List[dict] + Array of document data as JSON objects. May contain partial documents. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if collection_id is None: + raise AppwriteException('Missing required parameter: "collection_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{collectionId}', collection_id) + + api_params['documents'] = documents + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_documents(self, database_id: str, collection_id: str, data: dict = None, queries: List[str] = None) -> Dict[str, Any]: + """ + Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + data : dict + Document data as JSON object. Include only attribute and value pairs to be updated. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if collection_id is None: + raise AppwriteException('Missing required parameter: "collection_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{collectionId}', collection_id) + + api_params['data'] = data + api_params['queries'] = queries + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_documents(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Bulk delete documents using queries, if no queries are passed then all documents are deleted. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if collection_id is None: + raise AppwriteException('Missing required parameter: "collection_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{collectionId}', collection_id) + + api_params['queries'] = queries + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + def get_document(self, database_id: str, collection_id: str, document_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get a document by its unique ID. This endpoint response returns a JSON object with the document data. diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index ce5a92a..c3b7a87 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 5e869fd..e831821 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 5cf2bfb..7ff4f6b 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index c737f1b..172f45f 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 0077817..14e76ed 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index a6f09eb..70cee1d 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index deb4c9c..abd746c 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -3,7 +3,7 @@ from appwrite.services.account import Account from appwrite.enums import AuthenticationFactor client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index a149cb9..69aaa60 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index fa11d31..2dc171b 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -3,7 +3,7 @@ from appwrite.services.account import Account from appwrite.enums import OAuthProvider client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index d242d71..06c2b20 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index bb2058e..c130646 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 3d215a4..51c1777 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index d00e8cb..1048dfe 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 329d19e..d66fc2c 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 39b33c6..7eda5a3 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 3556122..0c894fa 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 939ea71..83709c7 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 9ddb443..5967d70 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 751ab9b..5061f84 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index f70b968..c8fe494 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 52df645..d577b4b 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index f38466f..3e2937b 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index b414047..5426228 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 4bf9beb..aeb23be 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 5d8c27a..67d193d 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index ba3796b..72a3924 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 7473313..c553a7b 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 004d071..14de4fd 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 2f9321c..7083d09 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index ca8e8e5..0146083 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index a5a9519..d53607f 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index d28a251..cfc58c5 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 38cb41c..51718eb 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 9b4bf82..534a94e 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index ecb4228..3c072e3 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index d29ab28..52e7723 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID account = Account(client) diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index e64d79f..bcc57de 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 65a6a38..a2cb7d3 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index c368300..e2ac7a2 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 2493dc5..ed140ab 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index ee3a2f7..abee773 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index c8318a4..a5272f0 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 63a7f26..fbc7af5 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.account import Account client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 7ed8318..c7ae77f 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -3,7 +3,7 @@ from appwrite.services.avatars import Avatars from appwrite.enums import Browser client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index aa66b86..160636d 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -3,7 +3,7 @@ from appwrite.services.avatars import Avatars from appwrite.enums import CreditCard client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 2c6a67e..f034ea4 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.avatars import Avatars client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 435c855..844dbb6 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -3,7 +3,7 @@ from appwrite.services.avatars import Avatars from appwrite.enums import Flag client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index ee9e0cb..9272c4d 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.avatars import Avatars client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index edcbbb3..2729ff5 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.avatars import Avatars client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 7f6da32..3fb76a7 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.avatars import Avatars client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 2b4209d..f12f446 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 99c44a2..596d4a9 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index db81c02..8fd59e6 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 22f2c07..1eaf024 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md new file mode 100644 index 0000000..1178a0f --- /dev/null +++ b/docs/examples/databases/create-documents.md @@ -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.create_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [] +) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 2e28e0b..230567a 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index b1efdc7..de1ceb9 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index b36863b..53305c8 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 9885c06..fe78b5e 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -3,7 +3,7 @@ from appwrite.services.databases import Databases from appwrite.enums import IndexType client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 8cb140a..92e8b0f 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index d4b4ab6..a7f424b 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 4172c27..6c8f4dc 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -3,7 +3,7 @@ from appwrite.services.databases import Databases from appwrite.enums import RelationshipType client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index e696871..dc434cc 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 4ad03c4..af37573 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index d5cbb99..0492203 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index b317ba9..e1c4eec 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index ab274c6..02f1e1c 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 69151aa..57f8b3b 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md new file mode 100644 index 0000000..a315f0c --- /dev/null +++ b/docs/examples/databases/delete-documents.md @@ -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 +) diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 2ed0165..0060064 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index e7e988a..be64e8c 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index a717552..dcdb0a6 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index f63298e..0833b4f 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index acdc25d..aff5008 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index ca5a995..6971683 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index deadf6a..c8191a3 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 245ec60..c97a5ce 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index ca18267..17d0a3d 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 41f0380..8b450cd 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index bf18bd1..1457151 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 11669b3..58336c9 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index c9300ea..a0f72a4 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index d929728..2e5be50 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 96c7fb5..29bc6be 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 7b9cce9..9ef6527 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md new file mode 100644 index 0000000..5a50d1a --- /dev/null +++ b/docs/examples/databases/update-documents.md @@ -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 +) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 5b042d4..c833789 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index caa1b4e..6186a72 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index d16b9bb..68cb7d7 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index ab0ccd6..05c6bfe 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index a2b8bad..550d3af 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 0aacc13..3b6c8e9 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index c85eb25..5b66fb0 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 53da6ae..4a62027 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index da59776..35d2c0c 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md new file mode 100644 index 0000000..9972064 --- /dev/null +++ b/docs/examples/databases/upsert-documents.md @@ -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.upsert_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [] # optional +) diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index ce2ffb7..3d784b0 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index c86fdf6..0774005 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -3,7 +3,7 @@ from appwrite.services.functions import Functions from appwrite.input_file import InputFile client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index cb3fddd..b41c7e3 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 101ecdf..84c286f 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index f10a953..68d6e99 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -3,7 +3,7 @@ from appwrite.services.functions import Functions from appwrite.enums import client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index f98bd60..f874b2d 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index b723fd6..df7ce7c 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index e17afed..a6e3dc8 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index a34d476..ed2fef7 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 90f029a..8cc16fa 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 0617b04..59a1374 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 0a9a347..a299f35 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 174c8b2..629948e 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index a463fa6..eeab5a5 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 4d8feea..4eb92f6 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 293bab0..e83f727 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index b624733..9c89a36 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 5e1ec7f..d7d0036 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index ee1a516..ebc19c5 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 0b5f18d..b1d696d 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md index c69cd7c..ef2b8a6 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-build.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 0f4c96e..6b96434 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index bcab368..e333ec1 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index a728241..64ee39b 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.functions import Functions client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index e05f602..189892a 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.graphql import Graphql client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index c8f3c78..585a502 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.graphql import Graphql client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 7bc0475..2b62147 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 7e69825..595c4bf 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index f6a713e..5b3e2c0 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index a23a073..47c7bd8 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index d0fe64f..5362a2d 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -3,7 +3,7 @@ from appwrite.services.health import Health from appwrite.enums import client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 109b288..e5115d0 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index b1d4d62..18ed8e3 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 99f52b8..b0a29e2 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 7d5e5a0..491d1f7 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index d677af5..fa860c6 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 3ffc4b8..d4ca938 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 0cb6417..1479f03 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 97a501c..6835efe 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index ea93eab..34cbad2 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 09e35df..019db4e 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index 3b09342..92aebc3 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index dbee75f..266ca82 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 1072a20..df5e2d5 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index d3b94b2..7d2ea44 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index 65af2f9..821d9f3 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index d63beb9..907e964 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index f5c494e..c544fcc 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.health import Health client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index a44f497..6f2a877 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.locale import Locale client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 12cd12e..5f3e501 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.locale import Locale client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index ea4ac53..0aead81 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.locale import Locale client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 7fb6aaa..f88e331 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.locale import Locale client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index aafdb3d..b1fdc1a 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.locale import Locale client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index a2f1ec4..0c5b23c 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.locale import Locale client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 39267c6..20009d6 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.locale import Locale client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 6dec1b9..1962a83 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.locale import Locale client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 700e909..b57fa00 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 92353e2..8b4c9d2 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index d13ba02..9c40eb7 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 8389971..6703f6f 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 117c46e..9315dcd 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index d405185..8671b56 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 5d20cde..46ff54f 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index c7e66d8..d1c7b49 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 85c5823..99914f0 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index cb8f4f7..bc0c892 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index b602213..aff09fe 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 03287e8..46ded71 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 4dd16da..c1cb465 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 524348f..4438563 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 68416bd..6ffded5 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 2a1840d..649e504 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 94085ef..c012a9a 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 1c2f563..76f9093 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index aee928a..0153ac9 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 9e32d80..3fadcff 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 6bc85f2..58e6228 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 43185d7..ca997f2 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index dea6cbf..c238a98 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 1c2ab0b..f28c3e5 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 8457f99..211649d 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index c8544fa..da87e59 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 258e7cd..03e5c4e 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index d2049bd..df8ec72 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index ba9e09d..f949b40 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index b941ccb..786ee42 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 57ba7f8..f8a3995 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index cb21567..1c2cefc 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 3f0205d..f695b61 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index b8f9d71..5731d5f 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 862e579..0119d71 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index aa1d4e9..039475f 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 2d4efdb..c5bd057 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 1266353..e3bb02e 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index e528bd5..fc0a44d 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 7cb0087..2eec4e2 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 2d798d4..80019aa 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 91de1f1..193a26f 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index c303104..159f954 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 160ac26..721f160 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 865fcb5..b80c55b 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 8e01128..b25f416 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 7e321f1..9672782 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index fa0b117..6e57284 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -3,7 +3,7 @@ from appwrite.services.storage import Storage from appwrite.input_file import InputFile client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 8cddfb9..dd8e8eb 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 08bba5c..17bc251 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 79f903f..e5eeb4c 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 1a82b26..d21db63 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 40f32f1..20939b2 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 3947c76..bf70d13 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 0c2d5e3..461543e 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 88540cd..51a1ae6 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index e26ac2e..4034bd4 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 61388b0..f2e741a 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 336e8a0..cf1e577 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 1af9f25..cb3bf73 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 7085d39..f623151 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index adf065c..6fb2182 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 762f532..056114b 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 17bacff..3c028a5 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 035777d..8d64589 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 985924e..55f172e 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 885a4c2..6e6f15a 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index c92d4c9..bf91a50 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index ae6e524..9c08421 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index c50f345..db20c5a 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index d25c8db..160b496 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 9eca847..e82da1b 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.teams import Teams client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 3d65496..5e95cc2 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 76532a9..d3d9e21 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index 2e1fdf6..bed6c48 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index da9d471..b1cbb53 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index a4477b0..64a87c0 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 363be4f..33f65f4 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index bb78ff7..5b4c8f8 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 1cfbcfc..9d644ce 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 2d1e72b..f442ab9 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index bebd46b..7e4c49f 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index c11c7ca..dfa64ac 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -3,7 +3,7 @@ from appwrite.services.users import Users from appwrite.enums import MessagingProviderType client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 00a0e78..b40658c 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index c8dac9f..4c51a3f 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 85c5b6d..412fbd3 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index b22d391..6472498 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -3,7 +3,7 @@ from appwrite.services.users import Users from appwrite.enums import AuthenticatorType client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index dda5713..815a96e 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 268c311..2dde88f 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 38cc5a9..287f5a2 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 090c20f..7032b0f 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index ec9986c..bca43b0 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index eb14d3a..ec9d363 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index f549f08..3b80b1f 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 6e018c2..267086a 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index b10c320..0fc7811 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 10d8ae0..6cbbe49 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index fbb3b4c..9e3b005 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 1f40b1f..a2b5989 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index a9eead0..77b04c9 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 4766646..14107fa 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 4b09ca5..778f339 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 4623bc3..2605861 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 083715b..c4a468e 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 24c5b27..b9af53a 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index d0e4da4..c0990e1 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index efd6730..9b35701 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 6014ef5..1e328b4 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 90ac15f..d104184 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index a62e6a8..1d2656c 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index f522730..14826bb 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 64d9df3..76903b7 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 8943ef5..49c0516 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 8951385..119c5fa 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -2,7 +2,7 @@ from appwrite.client import Client from appwrite.services.users import Users client = Client() -client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +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 diff --git a/setup.py b/setup.py index 2534ed2..7c9c69d 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '10.0.0', + version = '10.1.0-rc.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/10.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/10.1.0-rc.1.tar.gz', install_requires=[ 'requests', ], From 500d1a50cbe046476abe198d9ca31286b3488225 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Sun, 18 May 2025 00:04:57 +1200 Subject: [PATCH 53/60] Add support for 1.7 --- README.md | 4 +- appwrite/client.py | 6 +- appwrite/encoders/value_class_encoder.py | 20 + appwrite/enums/adapter.py | 5 + appwrite/enums/build_runtime.py | 66 + appwrite/enums/deployment_download_type.py | 5 + appwrite/enums/framework.py | 17 + appwrite/enums/image_format.py | 1 - appwrite/enums/runtime.py | 4 + appwrite/enums/vcs_deployment_type.py | 6 + appwrite/services/avatars.py | 6 +- appwrite/services/databases.py | 6 +- appwrite/services/functions.py | 230 +++- appwrite/services/sites.py | 1079 +++++++++++++++++ appwrite/services/storage.py | 17 +- appwrite/services/teams.py | 2 +- appwrite/services/tokens.py | 187 +++ appwrite/services/users.py | 8 +- docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/databases/create-document.md | 3 +- docs/examples/databases/create-documents.md | 3 +- docs/examples/databases/create-index.md | 3 +- ...uild.md => create-duplicate-deployment.md} | 2 +- .../functions/create-template-deployment.md | 18 + docs/examples/functions/create-variable.md | 3 +- .../functions/create-vcs-deployment.md | 17 + docs/examples/functions/create.md | 4 - .../functions/get-deployment-download.md | 3 +- docs/examples/functions/list-executions.md | 3 +- ...t-build.md => update-deployment-status.md} | 2 +- ...yment.md => update-function-deployment.md} | 2 +- docs/examples/functions/update-variable.md | 3 +- docs/examples/sites/create-deployment.md | 19 + .../sites/create-duplicate-deployment.md | 14 + .../sites/create-template-deployment.md | 18 + docs/examples/sites/create-variable.md | 16 + docs/examples/sites/create-vcs-deployment.md | 17 + docs/examples/sites/create.md | 32 + docs/examples/sites/delete-deployment.md | 14 + docs/examples/sites/delete-log.md | 14 + docs/examples/sites/delete-variable.md | 14 + docs/examples/sites/delete.md | 13 + .../examples/sites/get-deployment-download.md | 15 + docs/examples/sites/get-deployment.md | 14 + docs/examples/sites/get-log.md | 14 + docs/examples/sites/get-variable.md | 14 + docs/examples/sites/get.md | 13 + docs/examples/sites/list-deployments.md | 15 + docs/examples/sites/list-frameworks.md | 11 + docs/examples/sites/list-logs.md | 14 + docs/examples/sites/list-specifications.md | 11 + docs/examples/sites/list-variables.md | 13 + docs/examples/sites/list.md | 14 + .../sites/update-deployment-status.md | 14 + docs/examples/sites/update-site-deployment.md | 14 + docs/examples/sites/update-variable.md | 17 + docs/examples/sites/update.md | 31 + docs/examples/storage/get-file-download.md | 3 +- docs/examples/storage/get-file-preview.md | 5 +- docs/examples/storage/get-file-view.md | 3 +- docs/examples/tokens/create-file-token.md | 15 + docs/examples/tokens/delete.md | 13 + docs/examples/tokens/get.md | 13 + docs/examples/tokens/list.md | 15 + docs/examples/tokens/update.md | 14 + docs/examples/users/list-memberships.md | 4 +- setup.py | 4 +- 69 files changed, 2119 insertions(+), 106 deletions(-) create mode 100644 appwrite/enums/adapter.py create mode 100644 appwrite/enums/build_runtime.py create mode 100644 appwrite/enums/deployment_download_type.py create mode 100644 appwrite/enums/framework.py create mode 100644 appwrite/enums/vcs_deployment_type.py create mode 100644 appwrite/services/sites.py create mode 100644 appwrite/services/tokens.py rename docs/examples/functions/{create-build.md => create-duplicate-deployment.md} (90%) create mode 100644 docs/examples/functions/create-template-deployment.md create mode 100644 docs/examples/functions/create-vcs-deployment.md rename docs/examples/functions/{update-deployment-build.md => update-deployment-status.md} (90%) rename docs/examples/functions/{update-deployment.md => update-function-deployment.md} (89%) create mode 100644 docs/examples/sites/create-deployment.md create mode 100644 docs/examples/sites/create-duplicate-deployment.md create mode 100644 docs/examples/sites/create-template-deployment.md create mode 100644 docs/examples/sites/create-variable.md create mode 100644 docs/examples/sites/create-vcs-deployment.md create mode 100644 docs/examples/sites/create.md create mode 100644 docs/examples/sites/delete-deployment.md create mode 100644 docs/examples/sites/delete-log.md create mode 100644 docs/examples/sites/delete-variable.md create mode 100644 docs/examples/sites/delete.md create mode 100644 docs/examples/sites/get-deployment-download.md create mode 100644 docs/examples/sites/get-deployment.md create mode 100644 docs/examples/sites/get-log.md create mode 100644 docs/examples/sites/get-variable.md create mode 100644 docs/examples/sites/get.md create mode 100644 docs/examples/sites/list-deployments.md create mode 100644 docs/examples/sites/list-frameworks.md create mode 100644 docs/examples/sites/list-logs.md create mode 100644 docs/examples/sites/list-specifications.md create mode 100644 docs/examples/sites/list-variables.md create mode 100644 docs/examples/sites/list.md create mode 100644 docs/examples/sites/update-deployment-status.md create mode 100644 docs/examples/sites/update-site-deployment.md create mode 100644 docs/examples/sites/update-variable.md create mode 100644 docs/examples/sites/update.md create mode 100644 docs/examples/tokens/create-file-token.md create mode 100644 docs/examples/tokens/delete.md create mode 100644 docs/examples/tokens/get.md create mode 100644 docs/examples/tokens/list.md create mode 100644 docs/examples/tokens/update.md diff --git a/README.md b/README.md index c16cd61..2efa745 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** +**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite/client.py b/appwrite/client.py index bab61ea..bda3b80 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,12 +14,12 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/10.1.0-rc.1 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/10.2.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '10.1.0-rc.1', - 'X-Appwrite-Response-Format' : '1.6.0', + 'x-sdk-version': '10.2.0', + 'X-Appwrite-Response-Format' : '1.7.0', } def set_self_signed(self, status=True): diff --git a/appwrite/encoders/value_class_encoder.py b/appwrite/encoders/value_class_encoder.py index 95b06b7..72297a5 100644 --- a/appwrite/encoders/value_class_encoder.py +++ b/appwrite/encoders/value_class_encoder.py @@ -9,10 +9,15 @@ from ..enums.relation_mutate import RelationMutate from ..enums.index_type import IndexType from ..enums.runtime import Runtime +from ..enums.vcs_deployment_type import VCSDeploymentType +from ..enums.deployment_download_type import DeploymentDownloadType from ..enums.execution_method import ExecutionMethod from ..enums.name import Name from ..enums.message_priority import MessagePriority from ..enums.smtp_encryption import SmtpEncryption +from ..enums.framework import Framework +from ..enums.build_runtime import BuildRuntime +from ..enums.adapter import Adapter from ..enums.compression import Compression from ..enums.image_gravity import ImageGravity from ..enums.image_format import ImageFormat @@ -51,6 +56,12 @@ def default(self, o): if isinstance(o, Runtime): return o.value + if isinstance(o, VCSDeploymentType): + return o.value + + if isinstance(o, DeploymentDownloadType): + return o.value + if isinstance(o, ExecutionMethod): return o.value @@ -63,6 +74,15 @@ def default(self, o): if isinstance(o, SmtpEncryption): return o.value + if isinstance(o, Framework): + return o.value + + if isinstance(o, BuildRuntime): + return o.value + + if isinstance(o, Adapter): + return o.value + if isinstance(o, Compression): return o.value diff --git a/appwrite/enums/adapter.py b/appwrite/enums/adapter.py new file mode 100644 index 0000000..821aa24 --- /dev/null +++ b/appwrite/enums/adapter.py @@ -0,0 +1,5 @@ +from enum import Enum + +class Adapter(Enum): + STATIC = "static" + SSR = "ssr" diff --git a/appwrite/enums/build_runtime.py b/appwrite/enums/build_runtime.py new file mode 100644 index 0000000..9ba151b --- /dev/null +++ b/appwrite/enums/build_runtime.py @@ -0,0 +1,66 @@ +from enum import Enum + +class BuildRuntime(Enum): + NODE_14_5 = "node-14.5" + NODE_16_0 = "node-16.0" + NODE_18_0 = "node-18.0" + NODE_19_0 = "node-19.0" + NODE_20_0 = "node-20.0" + NODE_21_0 = "node-21.0" + NODE_22 = "node-22" + PHP_8_0 = "php-8.0" + PHP_8_1 = "php-8.1" + PHP_8_2 = "php-8.2" + PHP_8_3 = "php-8.3" + RUBY_3_0 = "ruby-3.0" + RUBY_3_1 = "ruby-3.1" + RUBY_3_2 = "ruby-3.2" + RUBY_3_3 = "ruby-3.3" + PYTHON_3_8 = "python-3.8" + PYTHON_3_9 = "python-3.9" + PYTHON_3_10 = "python-3.10" + PYTHON_3_11 = "python-3.11" + PYTHON_3_12 = "python-3.12" + PYTHON_ML_3_11 = "python-ml-3.11" + PYTHON_ML_3_12 = "python-ml-3.12" + DENO_1_21 = "deno-1.21" + DENO_1_24 = "deno-1.24" + DENO_1_35 = "deno-1.35" + DENO_1_40 = "deno-1.40" + DENO_1_46 = "deno-1.46" + DENO_2_0 = "deno-2.0" + DART_2_15 = "dart-2.15" + DART_2_16 = "dart-2.16" + DART_2_17 = "dart-2.17" + DART_2_18 = "dart-2.18" + DART_2_19 = "dart-2.19" + DART_3_0 = "dart-3.0" + DART_3_1 = "dart-3.1" + DART_3_3 = "dart-3.3" + DART_3_5 = "dart-3.5" + DOTNET_6_0 = "dotnet-6.0" + DOTNET_7_0 = "dotnet-7.0" + DOTNET_8_0 = "dotnet-8.0" + JAVA_8_0 = "java-8.0" + JAVA_11_0 = "java-11.0" + JAVA_17_0 = "java-17.0" + JAVA_18_0 = "java-18.0" + JAVA_21_0 = "java-21.0" + JAVA_22 = "java-22" + SWIFT_5_5 = "swift-5.5" + SWIFT_5_8 = "swift-5.8" + SWIFT_5_9 = "swift-5.9" + SWIFT_5_10 = "swift-5.10" + KOTLIN_1_6 = "kotlin-1.6" + KOTLIN_1_8 = "kotlin-1.8" + KOTLIN_1_9 = "kotlin-1.9" + KOTLIN_2_0 = "kotlin-2.0" + CPP_17 = "cpp-17" + CPP_20 = "cpp-20" + BUN_1_0 = "bun-1.0" + BUN_1_1 = "bun-1.1" + GO_1_23 = "go-1.23" + STATIC_1 = "static-1" + FLUTTER_3_24 = "flutter-3.24" + FLUTTER_3_27 = "flutter-3.27" + FLUTTER_3_29 = "flutter-3.29" diff --git a/appwrite/enums/deployment_download_type.py b/appwrite/enums/deployment_download_type.py new file mode 100644 index 0000000..e26e2d5 --- /dev/null +++ b/appwrite/enums/deployment_download_type.py @@ -0,0 +1,5 @@ +from enum import Enum + +class DeploymentDownloadType(Enum): + SOURCE = "source" + OUTPUT = "output" diff --git a/appwrite/enums/framework.py b/appwrite/enums/framework.py new file mode 100644 index 0000000..b3a9fb6 --- /dev/null +++ b/appwrite/enums/framework.py @@ -0,0 +1,17 @@ +from enum import Enum + +class Framework(Enum): + ANALOG = "analog" + ANGULAR = "angular" + NEXTJS = "nextjs" + REACT = "react" + NUXT = "nuxt" + VUE = "vue" + SVELTEKIT = "sveltekit" + ASTRO = "astro" + REMIX = "remix" + LYNX = "lynx" + FLUTTER = "flutter" + REACT_NATIVE = "react-native" + VITE = "vite" + OTHER = "other" diff --git a/appwrite/enums/image_format.py b/appwrite/enums/image_format.py index ba2f59e..33c6c99 100644 --- a/appwrite/enums/image_format.py +++ b/appwrite/enums/image_format.py @@ -3,7 +3,6 @@ class ImageFormat(Enum): JPG = "jpg" JPEG = "jpeg" - GIF = "gif" PNG = "png" WEBP = "webp" HEIC = "heic" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index 1485f48..df2cb34 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -22,6 +22,7 @@ class Runtime(Enum): PYTHON_3_11 = "python-3.11" PYTHON_3_12 = "python-3.12" PYTHON_ML_3_11 = "python-ml-3.11" + PYTHON_ML_3_12 = "python-ml-3.12" DENO_1_21 = "deno-1.21" DENO_1_24 = "deno-1.24" DENO_1_35 = "deno-1.35" @@ -32,6 +33,7 @@ class Runtime(Enum): DART_2_16 = "dart-2.16" DART_2_17 = "dart-2.17" DART_2_18 = "dart-2.18" + DART_2_19 = "dart-2.19" DART_3_0 = "dart-3.0" DART_3_1 = "dart-3.1" DART_3_3 = "dart-3.3" @@ -60,3 +62,5 @@ class Runtime(Enum): GO_1_23 = "go-1.23" STATIC_1 = "static-1" FLUTTER_3_24 = "flutter-3.24" + FLUTTER_3_27 = "flutter-3.27" + FLUTTER_3_29 = "flutter-3.29" diff --git a/appwrite/enums/vcs_deployment_type.py b/appwrite/enums/vcs_deployment_type.py new file mode 100644 index 0000000..d78e99f --- /dev/null +++ b/appwrite/enums/vcs_deployment_type.py @@ -0,0 +1,6 @@ +from enum import Enum + +class VCSDeploymentType(Enum): + BRANCH = "branch" + COMMIT = "commit" + TAG = "tag" diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 36e15d8..6ee1d4f 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -25,7 +25,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, height : float Image height. Pass an integer between 0 to 2000. Defaults to 100. quality : float - Image quality. Pass an integer between 0 to 100. Defaults to 100. + Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. Returns ------- @@ -68,7 +68,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = height : float Image height. Pass an integer between 0 to 2000. Defaults to 100. quality : float - Image quality. Pass an integer between 0 to 100. Defaults to 100. + Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. Returns ------- @@ -144,7 +144,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit height : float Image height. Pass an integer between 0 to 2000. Defaults to 100. quality : float - Image quality. Pass an integer between 0 to 100. Defaults to 100. + Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. Returns ------- diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 4561066..b798f7c 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -1813,7 +1813,6 @@ def create_document(self, database_id: str, collection_id: str, document_id: str def create_documents(self, database_id: str, collection_id: str, documents: List[dict]) -> Dict[str, Any]: """ Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - Parameters ---------- @@ -2162,7 +2161,7 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] return self.client.call('get', api_path, { }, api_params) - def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: List[str] = None) -> Dict[str, Any]: + def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: List[str] = None, lengths: List[float] = None) -> Dict[str, Any]: """ Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be `key`, `fulltext`, and `unique`. @@ -2181,6 +2180,8 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. orders : List[str] Array of index orders. Maximum of 100 orders are allowed. + lengths : List[float] + Length of index. Maximum of 100 Returns ------- @@ -2217,6 +2218,7 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind api_params['type'] = type api_params['attributes'] = attributes api_params['orders'] = orders + api_params['lengths'] = lengths return self.client.call('post', api_path, { 'content-type': 'application/json', diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index a483a22..9dce425 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -3,6 +3,8 @@ from ..exception import AppwriteException from ..enums.runtime import Runtime; from ..input_file import InputFile +from ..enums.vcs_deployment_type import VCSDeploymentType; +from ..enums.deployment_download_type import DeploymentDownloadType; from ..enums.execution_method import ExecutionMethod; class Functions(Service): @@ -17,7 +19,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: Parameters ---------- queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId search : str Search term to filter your list results. Max length: 256 chars. @@ -41,7 +43,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None) -> Dict[str, Any]: + def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: """ Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. @@ -64,7 +66,7 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st enabled : bool Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. logging : bool - Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + When disabled, executions will exclude logs and errors, and will be slightly faster. entrypoint : str Entrypoint File. This path is relative to the "providerRootDirectory". commands : str @@ -81,14 +83,6 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. provider_root_directory : str Path to function code in the linked repo. - template_repository : str - Repository name of the template. - template_owner : str - The name of the owner of the template. - template_root_directory : str - Path to function code in the template repo. - template_version : str - Version (tag) for the repo linked to the function template. specification : str Runtime specification for the function and builds. @@ -132,10 +126,6 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st api_params['providerBranch'] = provider_branch api_params['providerSilentMode'] = provider_silent_mode api_params['providerRootDirectory'] = provider_root_directory - api_params['templateRepository'] = template_repository - api_params['templateOwner'] = template_owner - api_params['templateRootDirectory'] = template_root_directory - api_params['templateVersion'] = template_version api_params['specification'] = specification return self.client.call('post', api_path, { @@ -166,7 +156,6 @@ def list_runtimes(self) -> Dict[str, Any]: def list_specifications(self) -> Dict[str, Any]: """ List allowed function specifications for this instance. - Returns ------- @@ -239,7 +228,7 @@ def update(self, function_id: str, name: str, runtime: Runtime = None, execute: enabled : bool Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. logging : bool - Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + When disabled, executions will exclude logs and errors, and will be slightly faster. entrypoint : str Entrypoint File. This path is relative to the "providerRootDirectory". commands : str @@ -334,16 +323,54 @@ def delete(self, function_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) + def update_function_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function. + + Parameters + ---------- + function_id : str + Function ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/functions/{functionId}/deployment' + api_params = {} + if function_id is None: + raise AppwriteException('Missing required parameter: "function_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{functionId}', function_id) + + api_params['deploymentId'] = deployment_id + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + def list_deployments(self, function_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ - Get a list of all the project's code deployments. You can use the query params to filter your results. + Get a list of all the function's code deployments. You can use the query params to filter your results. Parameters ---------- function_id : str Function ID. queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: size, buildId, activate, entrypoint, commands, type, size + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type search : str Search term to filter your list results. Max length: 256 chars. @@ -432,9 +459,9 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + def create_duplicate_deployment(self, function_id: str, deployment_id: str, build_id: str = None) -> Dict[str, Any]: """ - Get a code deployment by its unique ID. + Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. Parameters ---------- @@ -442,6 +469,8 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any] Function ID. deployment_id : str Deployment ID. + build_id : str + Build unique ID. Returns ------- @@ -454,7 +483,7 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any] If API request fails """ - api_path = '/functions/{functionId}/deployments/{deploymentId}' + api_path = '/functions/{functionId}/deployments/duplicate' api_params = {} if function_id is None: raise AppwriteException('Missing required parameter: "function_id"') @@ -463,22 +492,34 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any] raise AppwriteException('Missing required parameter: "deployment_id"') api_path = api_path.replace('{functionId}', function_id) - api_path = api_path.replace('{deploymentId}', deployment_id) + api_params['deploymentId'] = deployment_id + api_params['buildId'] = build_id - return self.client.call('get', api_path, { + return self.client.call('post', api_path, { + 'content-type': 'application/json', }, api_params) - def update_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + def create_template_deployment(self, function_id: str, repository: str, owner: str, root_directory: str, version: str, activate: bool = None) -> Dict[str, Any]: """ - Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint. + Create a deployment based on a template. + + Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. Parameters ---------- function_id : str Function ID. - deployment_id : str - Deployment ID. + repository : str + Repository name of the template. + owner : str + The name of the owner of the template. + root_directory : str + Path to function code in the template repo. + version : str + Version (tag) for the repo linked to the function template. + activate : bool + Automatically activate the deployment when it is finished building. Returns ------- @@ -491,32 +532,51 @@ def update_deployment(self, function_id: str, deployment_id: str) -> Dict[str, A If API request fails """ - api_path = '/functions/{functionId}/deployments/{deploymentId}' + api_path = '/functions/{functionId}/deployments/template' api_params = {} if function_id is None: raise AppwriteException('Missing required parameter: "function_id"') - if deployment_id is None: - raise AppwriteException('Missing required parameter: "deployment_id"') + if repository is None: + raise AppwriteException('Missing required parameter: "repository"') + + if owner is None: + raise AppwriteException('Missing required parameter: "owner"') + + if root_directory is None: + raise AppwriteException('Missing required parameter: "root_directory"') + + if version is None: + raise AppwriteException('Missing required parameter: "version"') api_path = api_path.replace('{functionId}', function_id) - api_path = api_path.replace('{deploymentId}', deployment_id) + api_params['repository'] = repository + api_params['owner'] = owner + api_params['rootDirectory'] = root_directory + api_params['version'] = version + api_params['activate'] = activate - return self.client.call('patch', api_path, { + return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + def create_vcs_deployment(self, function_id: str, type: VCSDeploymentType, reference: str, activate: bool = None) -> Dict[str, Any]: """ - Delete a code deployment by its unique ID. + Create a deployment when a function is connected to VCS. + + This endpoint lets you create deployment from a branch, commit, or a tag. Parameters ---------- function_id : str Function ID. - deployment_id : str - Deployment ID. + type : VCSDeploymentType + Type of reference passed. Allowed values are: branch, commit + reference : str + VCS reference to create deployment from. Depending on type this can be: branch name, commit hash + activate : bool + Automatically activate the deployment when it is finished building. Returns ------- @@ -529,25 +589,30 @@ def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, A If API request fails """ - api_path = '/functions/{functionId}/deployments/{deploymentId}' + api_path = '/functions/{functionId}/deployments/vcs' api_params = {} if function_id is None: raise AppwriteException('Missing required parameter: "function_id"') - if deployment_id is None: - raise AppwriteException('Missing required parameter: "deployment_id"') + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + if reference is None: + raise AppwriteException('Missing required parameter: "reference"') api_path = api_path.replace('{functionId}', function_id) - api_path = api_path.replace('{deploymentId}', deployment_id) + api_params['type'] = type + api_params['reference'] = reference + api_params['activate'] = activate - return self.client.call('delete', api_path, { + return self.client.call('post', api_path, { 'content-type': 'application/json', }, api_params) - def create_build(self, function_id: str, deployment_id: str, build_id: str = None) -> Dict[str, Any]: + def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: """ - Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + Get a function deployment by its unique ID. Parameters ---------- @@ -555,8 +620,6 @@ def create_build(self, function_id: str, deployment_id: str, build_id: str = Non Function ID. deployment_id : str Deployment ID. - build_id : str - Build unique ID. Returns ------- @@ -569,7 +632,7 @@ def create_build(self, function_id: str, deployment_id: str, build_id: str = Non If API request fails """ - api_path = '/functions/{functionId}/deployments/{deploymentId}/build' + api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: raise AppwriteException('Missing required parameter: "function_id"') @@ -580,15 +643,13 @@ def create_build(self, function_id: str, deployment_id: str, build_id: str = Non api_path = api_path.replace('{functionId}', function_id) api_path = api_path.replace('{deploymentId}', deployment_id) - api_params['buildId'] = build_id - return self.client.call('post', api_path, { - 'content-type': 'application/json', + return self.client.call('get', api_path, { }, api_params) - def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]: """ - Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + Delete a code deployment by its unique ID. Parameters ---------- @@ -608,7 +669,7 @@ def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[ If API request fails """ - api_path = '/functions/{functionId}/deployments/{deploymentId}/build' + api_path = '/functions/{functionId}/deployments/{deploymentId}' api_params = {} if function_id is None: raise AppwriteException('Missing required parameter: "function_id"') @@ -620,13 +681,13 @@ def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[ api_path = api_path.replace('{deploymentId}', deployment_id) - return self.client.call('patch', api_path, { + return self.client.call('delete', api_path, { 'content-type': 'application/json', }, api_params) - def get_deployment_download(self, function_id: str, deployment_id: str) -> bytes: + def get_deployment_download(self, function_id: str, deployment_id: str, type: DeploymentDownloadType = None) -> bytes: """ - Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. + Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. Parameters ---------- @@ -634,6 +695,8 @@ def get_deployment_download(self, function_id: str, deployment_id: str) -> bytes Function ID. deployment_id : str Deployment ID. + type : DeploymentDownloadType + Deployment file to download. Can be: "source", "output". Returns ------- @@ -657,11 +720,50 @@ def get_deployment_download(self, function_id: str, deployment_id: str) -> bytes api_path = api_path.replace('{functionId}', function_id) api_path = api_path.replace('{deploymentId}', deployment_id) + api_params['type'] = type return self.client.call('get', api_path, { }, api_params) - def list_executions(self, function_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def update_deployment_status(self, function_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + + Parameters + ---------- + function_id : str + Function ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/functions/{functionId}/deployments/{deploymentId}/status' + api_params = {} + if function_id is None: + raise AppwriteException('Missing required parameter: "function_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{functionId}', function_id) + api_path = api_path.replace('{deploymentId}', deployment_id) + + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_executions(self, function_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get a list of all the current user function execution logs. You can use the query params to filter your results. @@ -671,8 +773,6 @@ def list_executions(self, function_id: str, queries: List[str] = None, search: s Function ID. queries : List[str] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId - search : str - Search term to filter your list results. Max length: 256 chars. Returns ------- @@ -693,7 +793,6 @@ def list_executions(self, function_id: str, queries: List[str] = None, search: s api_path = api_path.replace('{functionId}', function_id) api_params['queries'] = queries - api_params['search'] = search return self.client.call('get', api_path, { }, api_params) @@ -788,7 +887,6 @@ def get_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: def delete_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: """ Delete a function execution by its unique ID. - Parameters ---------- @@ -855,7 +953,7 @@ def list_variables(self, function_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create_variable(self, function_id: str, key: str, value: str) -> Dict[str, Any]: + def create_variable(self, function_id: str, key: str, value: str, secret: bool = None) -> Dict[str, Any]: """ Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. @@ -867,6 +965,8 @@ def create_variable(self, function_id: str, key: str, value: str) -> Dict[str, A Variable key. Max length: 255 chars. value : str Variable value. Max length: 8192 chars. + secret : bool + Secret variables can be updated or deleted, but only functions can read them during build and runtime. Returns ------- @@ -894,6 +994,7 @@ def create_variable(self, function_id: str, key: str, value: str) -> Dict[str, A api_params['key'] = key api_params['value'] = value + api_params['secret'] = secret return self.client.call('post', api_path, { 'content-type': 'application/json', @@ -936,7 +1037,7 @@ def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None) -> Dict[str, Any]: + def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None, secret: bool = None) -> Dict[str, Any]: """ Update variable by its unique ID. @@ -950,6 +1051,8 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s Variable key. Max length: 255 chars. value : str Variable value. Max length: 8192 chars. + secret : bool + Secret variables can be updated or deleted, but only functions can read them during build and runtime. Returns ------- @@ -978,6 +1081,7 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s api_params['key'] = key api_params['value'] = value + api_params['secret'] = secret return self.client.call('put', api_path, { 'content-type': 'application/json', diff --git a/appwrite/services/sites.py b/appwrite/services/sites.py new file mode 100644 index 0000000..bcb7597 --- /dev/null +++ b/appwrite/services/sites.py @@ -0,0 +1,1079 @@ +from ..service import Service +from typing import List, Dict, Any +from ..exception import AppwriteException +from ..enums.framework import Framework; +from ..enums.build_runtime import BuildRuntime; +from ..enums.adapter import Adapter; +from ..input_file import InputFile +from ..enums.vcs_deployment_type import VCSDeploymentType; +from ..enums.deployment_download_type import DeploymentDownloadType; + +class Sites(Service): + + def __init__(self, client) -> None: + super(Sites, self).__init__(client) + + def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the project's sites. You can use the query params to filter your results. + + Parameters + ---------- + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites' + api_params = {} + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + }, api_params) + + def create(self, site_id: str, name: str, framework: Framework, build_runtime: BuildRuntime, enabled: bool = None, logging: bool = None, timeout: float = None, install_command: str = None, build_command: str = None, output_directory: str = None, adapter: Adapter = None, installation_id: str = None, fallback_file: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: + """ + Create a new site. + + Parameters + ---------- + site_id : str + Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Site name. Max length: 128 chars. + framework : Framework + Sites framework. + build_runtime : BuildRuntime + Runtime to use during build step. + enabled : bool + Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. + logging : bool + When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + timeout : float + Maximum request time in seconds. + install_command : str + Install Command. + build_command : str + Build Command. + output_directory : str + Output Directory for site. + adapter : Adapter + Framework adapter defining rendering strategy. Allowed values are: static, ssr + installation_id : str + Appwrite Installation ID for VCS (Version Control System) deployment. + fallback_file : str + Fallback file for single page application sites. + provider_repository_id : str + Repository ID of the repo linked to the site. + provider_branch : str + Production branch for the repo linked to the site. + provider_silent_mode : bool + Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. + provider_root_directory : str + Path to site code in the linked repo. + specification : str + Framework specification for the site and builds. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + if framework is None: + raise AppwriteException('Missing required parameter: "framework"') + + if build_runtime is None: + raise AppwriteException('Missing required parameter: "build_runtime"') + + + api_params['siteId'] = site_id + api_params['name'] = name + api_params['framework'] = framework + api_params['enabled'] = enabled + api_params['logging'] = logging + api_params['timeout'] = timeout + api_params['installCommand'] = install_command + api_params['buildCommand'] = build_command + api_params['outputDirectory'] = output_directory + api_params['buildRuntime'] = build_runtime + api_params['adapter'] = adapter + api_params['installationId'] = installation_id + api_params['fallbackFile'] = fallback_file + api_params['providerRepositoryId'] = provider_repository_id + api_params['providerBranch'] = provider_branch + api_params['providerSilentMode'] = provider_silent_mode + api_params['providerRootDirectory'] = provider_root_directory + api_params['specification'] = specification + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_frameworks(self) -> Dict[str, Any]: + """ + Get a list of all frameworks that are currently available on the server instance. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/frameworks' + api_params = {} + + return self.client.call('get', api_path, { + }, api_params) + + def list_specifications(self) -> Dict[str, Any]: + """ + List allowed site specifications for this instance. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/specifications' + api_params = {} + + return self.client.call('get', api_path, { + }, api_params) + + def get(self, site_id: str) -> Dict[str, Any]: + """ + Get a site by its unique ID. + + Parameters + ---------- + site_id : str + Site ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + api_path = api_path.replace('{siteId}', site_id) + + + return self.client.call('get', api_path, { + }, api_params) + + def update(self, site_id: str, name: str, framework: Framework, enabled: bool = None, logging: bool = None, timeout: float = None, install_command: str = None, build_command: str = None, output_directory: str = None, build_runtime: BuildRuntime = None, adapter: Adapter = None, fallback_file: str = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: + """ + Update site by its unique ID. + + Parameters + ---------- + site_id : str + Site ID. + name : str + Site name. Max length: 128 chars. + framework : Framework + Sites framework. + enabled : bool + Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. + logging : bool + When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + timeout : float + Maximum request time in seconds. + install_command : str + Install Command. + build_command : str + Build Command. + output_directory : str + Output Directory for site. + build_runtime : BuildRuntime + Runtime to use during build step. + adapter : Adapter + Framework adapter defining rendering strategy. Allowed values are: static, ssr + fallback_file : str + Fallback file for single page application sites. + installation_id : str + Appwrite Installation ID for VCS (Version Control System) deployment. + provider_repository_id : str + Repository ID of the repo linked to the site. + provider_branch : str + Production branch for the repo linked to the site. + provider_silent_mode : bool + Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. + provider_root_directory : str + Path to site code in the linked repo. + specification : str + Framework specification for the site and builds. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + if framework is None: + raise AppwriteException('Missing required parameter: "framework"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['name'] = name + api_params['framework'] = framework + api_params['enabled'] = enabled + api_params['logging'] = logging + api_params['timeout'] = timeout + api_params['installCommand'] = install_command + api_params['buildCommand'] = build_command + api_params['outputDirectory'] = output_directory + api_params['buildRuntime'] = build_runtime + api_params['adapter'] = adapter + api_params['fallbackFile'] = fallback_file + api_params['installationId'] = installation_id + api_params['providerRepositoryId'] = provider_repository_id + api_params['providerBranch'] = provider_branch + api_params['providerSilentMode'] = provider_silent_mode + api_params['providerRootDirectory'] = provider_root_directory + api_params['specification'] = specification + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete(self, site_id: str) -> Dict[str, Any]: + """ + Delete a site by its unique ID. + + Parameters + ---------- + site_id : str + Site ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + api_path = api_path.replace('{siteId}', site_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_site_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site. + + Parameters + ---------- + site_id : str + Site ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployment' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['deploymentId'] = deployment_id + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_deployments(self, site_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all the site's code deployments. You can use the query params to filter your results. + + Parameters + ---------- + site_id : str + Site ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + }, api_params) + + def create_deployment(self, site_id: str, code: InputFile, activate: bool, install_command: str = None, build_command: str = None, output_directory: str = None, on_progress = None) -> Dict[str, Any]: + """ + Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID. + + Parameters + ---------- + site_id : str + Site ID. + code : InputFile + Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. + activate : bool + Automatically activate the deployment when it is finished building. + install_command : str + Install Commands. + build_command : str + Build Commands. + output_directory : str + Output Directory. + on_progress : callable, optional + Optional callback for upload progress + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if code is None: + raise AppwriteException('Missing required parameter: "code"') + + if activate is None: + raise AppwriteException('Missing required parameter: "activate"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['installCommand'] = install_command + api_params['buildCommand'] = build_command + api_params['outputDirectory'] = output_directory + api_params['code'] = str(code).lower() if type(code) is bool else code + api_params['activate'] = str(activate).lower() if type(activate) is bool else activate + + param_name = 'code' + + + upload_id = '' + + return self.client.chunked_upload(api_path, { + 'content-type': 'multipart/form-data', + }, api_params, param_name, on_progress, upload_id) + + def create_duplicate_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + + Parameters + ---------- + site_id : str + Site ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments/duplicate' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['deploymentId'] = deployment_id + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_template_deployment(self, site_id: str, repository: str, owner: str, root_directory: str, version: str, activate: bool = None) -> Dict[str, Any]: + """ + Create a deployment based on a template. + + Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. + + Parameters + ---------- + site_id : str + Site ID. + repository : str + Repository name of the template. + owner : str + The name of the owner of the template. + root_directory : str + Path to site code in the template repo. + version : str + Version (tag) for the repo linked to the site template. + activate : bool + Automatically activate the deployment when it is finished building. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments/template' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if repository is None: + raise AppwriteException('Missing required parameter: "repository"') + + if owner is None: + raise AppwriteException('Missing required parameter: "owner"') + + if root_directory is None: + raise AppwriteException('Missing required parameter: "root_directory"') + + if version is None: + raise AppwriteException('Missing required parameter: "version"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['repository'] = repository + api_params['owner'] = owner + api_params['rootDirectory'] = root_directory + api_params['version'] = version + api_params['activate'] = activate + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_vcs_deployment(self, site_id: str, type: VCSDeploymentType, reference: str, activate: bool = None) -> Dict[str, Any]: + """ + Create a deployment when a site is connected to VCS. + + This endpoint lets you create deployment from a branch, commit, or a tag. + + Parameters + ---------- + site_id : str + Site ID. + type : VCSDeploymentType + Type of reference passed. Allowed values are: branch, commit + reference : str + VCS reference to create deployment from. Depending on type this can be: branch name, commit hash + activate : bool + Automatically activate the deployment when it is finished building. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments/vcs' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + if reference is None: + raise AppwriteException('Missing required parameter: "reference"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['type'] = type + api_params['reference'] = reference + api_params['activate'] = activate + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Get a site deployment by its unique ID. + + Parameters + ---------- + site_id : str + Site ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments/{deploymentId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{deploymentId}', deployment_id) + + + return self.client.call('get', api_path, { + }, api_params) + + def delete_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Delete a site deployment by its unique ID. + + Parameters + ---------- + site_id : str + Site ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments/{deploymentId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{deploymentId}', deployment_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_deployment_download(self, site_id: str, deployment_id: str, type: DeploymentDownloadType = None) -> bytes: + """ + Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + + Parameters + ---------- + site_id : str + Site ID. + deployment_id : str + Deployment ID. + type : DeploymentDownloadType + Deployment file to download. Can be: "source", "output". + + Returns + ------- + bytes + Response as bytes + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments/{deploymentId}/download' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{deploymentId}', deployment_id) + + api_params['type'] = type + + return self.client.call('get', api_path, { + }, api_params) + + def update_deployment_status(self, site_id: str, deployment_id: str) -> Dict[str, Any]: + """ + Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + + Parameters + ---------- + site_id : str + Site ID. + deployment_id : str + Deployment ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/deployments/{deploymentId}/status' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if deployment_id is None: + raise AppwriteException('Missing required parameter: "deployment_id"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{deploymentId}', deployment_id) + + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_logs(self, site_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get a list of all site logs. You can use the query params to filter your results. + + Parameters + ---------- + site_id : str + Site ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/logs' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + }, api_params) + + def get_log(self, site_id: str, log_id: str) -> Dict[str, Any]: + """ + Get a site request log by its unique ID. + + Parameters + ---------- + site_id : str + Site ID. + log_id : str + Log ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/logs/{logId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if log_id is None: + raise AppwriteException('Missing required parameter: "log_id"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{logId}', log_id) + + + return self.client.call('get', api_path, { + }, api_params) + + def delete_log(self, site_id: str, log_id: str) -> Dict[str, Any]: + """ + Delete a site log by its unique ID. + + Parameters + ---------- + site_id : str + Site ID. + log_id : str + Log ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/logs/{logId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if log_id is None: + raise AppwriteException('Missing required parameter: "log_id"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{logId}', log_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_variables(self, site_id: str) -> Dict[str, Any]: + """ + Get a list of all variables of a specific site. + + Parameters + ---------- + site_id : str + Site unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/variables' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + api_path = api_path.replace('{siteId}', site_id) + + + return self.client.call('get', api_path, { + }, api_params) + + def create_variable(self, site_id: str, key: str, value: str, secret: bool = None) -> Dict[str, Any]: + """ + Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. + + Parameters + ---------- + site_id : str + Site unique ID. + key : str + Variable key. Max length: 255 chars. + value : str + Variable value. Max length: 8192 chars. + secret : bool + Secret variables can be updated or deleted, but only sites can read them during build and runtime. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/variables' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if value is None: + raise AppwriteException('Missing required parameter: "value"') + + api_path = api_path.replace('{siteId}', site_id) + + api_params['key'] = key + api_params['value'] = value + api_params['secret'] = secret + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: + """ + Get a variable by its unique ID. + + Parameters + ---------- + site_id : str + Site unique ID. + variable_id : str + Variable unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/variables/{variableId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if variable_id is None: + raise AppwriteException('Missing required parameter: "variable_id"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{variableId}', variable_id) + + + return self.client.call('get', api_path, { + }, api_params) + + def update_variable(self, site_id: str, variable_id: str, key: str, value: str = None, secret: bool = None) -> Dict[str, Any]: + """ + Update variable by its unique ID. + + Parameters + ---------- + site_id : str + Site unique ID. + variable_id : str + Variable unique ID. + key : str + Variable key. Max length: 255 chars. + value : str + Variable value. Max length: 8192 chars. + secret : bool + Secret variables can be updated or deleted, but only sites can read them during build and runtime. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/variables/{variableId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if variable_id is None: + raise AppwriteException('Missing required parameter: "variable_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{variableId}', variable_id) + + api_params['key'] = key + api_params['value'] = value + api_params['secret'] = secret + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: + """ + Delete a variable by its unique ID. + + Parameters + ---------- + site_id : str + Site unique ID. + variable_id : str + Variable unique ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/sites/{siteId}/variables/{variableId}' + api_params = {} + if site_id is None: + raise AppwriteException('Missing required parameter: "site_id"') + + if variable_id is None: + raise AppwriteException('Missing required parameter: "variable_id"') + + api_path = api_path.replace('{siteId}', site_id) + api_path = api_path.replace('{variableId}', variable_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 610e11e..22198eb 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -447,7 +447,7 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def get_file_download(self, bucket_id: str, file_id: str) -> bytes: + def get_file_download(self, bucket_id: str, file_id: str, token: str = None) -> bytes: """ Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. @@ -457,6 +457,8 @@ def get_file_download(self, bucket_id: str, file_id: str) -> bytes: Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). file_id : str File ID. + token : str + File token for accessing this file. Returns ------- @@ -480,11 +482,12 @@ def get_file_download(self, bucket_id: str, file_id: str) -> bytes: api_path = api_path.replace('{bucketId}', bucket_id) api_path = api_path.replace('{fileId}', file_id) + api_params['token'] = token return self.client.call('get', api_path, { }, api_params) - def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> bytes: + def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None, token: str = None) -> bytes: """ Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. @@ -501,7 +504,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he gravity : ImageGravity Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right quality : float - Preview image quality. Pass an integer between 0 to 100. Defaults to 100. + Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. border_width : float Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. border_color : str @@ -516,6 +519,8 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. output : ImageFormat Output format type (jpeg, jpg, png, gif and webp). + token : str + File token for accessing this file. Returns ------- @@ -550,11 +555,12 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he api_params['rotation'] = rotation api_params['background'] = background api_params['output'] = output + api_params['token'] = token return self.client.call('get', api_path, { }, api_params) - def get_file_view(self, bucket_id: str, file_id: str) -> bytes: + def get_file_view(self, bucket_id: str, file_id: str, token: str = None) -> bytes: """ Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. @@ -564,6 +570,8 @@ def get_file_view(self, bucket_id: str, file_id: str) -> bytes: Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). file_id : str File ID. + token : str + File token for accessing this file. Returns ------- @@ -587,6 +595,7 @@ def get_file_view(self, bucket_id: str, file_id: str) -> bytes: api_path = api_path.replace('{bucketId}', bucket_id) api_path = api_path.replace('{fileId}', file_id) + api_params['token'] = token return self.client.call('get', api_path, { }, api_params) diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 778cd07..808dc2a 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -189,7 +189,7 @@ def list_memberships(self, team_id: str, queries: List[str] = None, search: str team_id : str Team ID. queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles search : str Search term to filter your list results. Max length: 256 chars. diff --git a/appwrite/services/tokens.py b/appwrite/services/tokens.py new file mode 100644 index 0000000..01f1177 --- /dev/null +++ b/appwrite/services/tokens.py @@ -0,0 +1,187 @@ +from ..service import Service +from typing import List, Dict, Any +from ..exception import AppwriteException + +class Tokens(Service): + + def __init__(self, client) -> None: + super(Tokens, self).__init__(client) + + def list(self, bucket_id: str, file_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + List all the tokens created for a specific file or bucket. You can use the query params to filter your results. + + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File unique ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/tokens/buckets/{bucketId}/files/{fileId}' + api_params = {} + if bucket_id is None: + raise AppwriteException('Missing required parameter: "bucket_id"') + + if file_id is None: + raise AppwriteException('Missing required parameter: "file_id"') + + api_path = api_path.replace('{bucketId}', bucket_id) + api_path = api_path.replace('{fileId}', file_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + }, api_params) + + def create_file_token(self, bucket_id: str, file_id: str, expire: str = None) -> Dict[str, Any]: + """ + Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter. + + Parameters + ---------- + bucket_id : str + Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + file_id : str + File unique ID. + expire : str + Token expiry date + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/tokens/buckets/{bucketId}/files/{fileId}' + api_params = {} + if bucket_id is None: + raise AppwriteException('Missing required parameter: "bucket_id"') + + if file_id is None: + raise AppwriteException('Missing required parameter: "file_id"') + + api_path = api_path.replace('{bucketId}', bucket_id) + api_path = api_path.replace('{fileId}', file_id) + + api_params['expire'] = expire + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get(self, token_id: str) -> Dict[str, Any]: + """ + Get a token by its unique ID. + + Parameters + ---------- + token_id : str + Token ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/tokens/{tokenId}' + api_params = {} + if token_id is None: + raise AppwriteException('Missing required parameter: "token_id"') + + api_path = api_path.replace('{tokenId}', token_id) + + + return self.client.call('get', api_path, { + }, api_params) + + def update(self, token_id: str, expire: str = None) -> Dict[str, Any]: + """ + Update a token by its unique ID. Use this endpoint to update a token's expiry date. + + Parameters + ---------- + token_id : str + Token unique ID. + expire : str + File token expiry date + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/tokens/{tokenId}' + api_params = {} + if token_id is None: + raise AppwriteException('Missing required parameter: "token_id"') + + api_path = api_path.replace('{tokenId}', token_id) + + api_params['expire'] = expire + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete(self, token_id: str) -> Dict[str, Any]: + """ + Delete a token by its unique ID. + + Parameters + ---------- + token_id : str + Token ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/tokens/{tokenId}' + api_params = {} + if token_id is None: + raise AppwriteException('Missing required parameter: "token_id"') + + api_path = api_path.replace('{tokenId}', token_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 532c69f..703a6bf 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -741,7 +741,7 @@ def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def list_memberships(self, user_id: str) -> Dict[str, Any]: + def list_memberships(self, user_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get the user membership list by its unique ID. @@ -749,6 +749,10 @@ def list_memberships(self, user_id: str) -> Dict[str, Any]: ---------- user_id : str User ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles + search : str + Search term to filter your list results. Max length: 256 chars. Returns ------- @@ -768,6 +772,8 @@ def list_memberships(self, user_id: str) -> Dict[str, Any]: api_path = api_path.replace('{userId}', user_id) + api_params['queries'] = queries + api_params['search'] = search return self.client.call('get', api_path, { }, api_params) diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index c7ae77f..ff11b8b 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -13,5 +13,5 @@ result = avatars.get_browser( code = Browser.AVANT_BROWSER, width = 0, # optional height = 0, # optional - quality = 0 # optional + quality = -1 # optional ) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 160636d..286f4d3 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -13,5 +13,5 @@ result = avatars.get_credit_card( code = CreditCard.AMERICAN_EXPRESS, width = 0, # optional height = 0, # optional - quality = 0 # optional + quality = -1 # optional ) diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 844dbb6..6365a78 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -13,5 +13,5 @@ result = avatars.get_flag( code = Flag.AFGHANISTAN, width = 0, # optional height = 0, # optional - quality = 0 # optional + quality = -1 # optional ) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 1eaf024..1a8500b 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -3,8 +3,9 @@ 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 +client.set_key('<YOUR_API_KEY>') # Your secret API key +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token databases = Databases(client) diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index 1178a0f..7c6ef24 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -3,8 +3,7 @@ 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 +client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index fe78b5e..f7bb455 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -15,5 +15,6 @@ result = databases.create_index( key = '', type = IndexType.KEY, attributes = [], - orders = [] # optional + orders = [], # optional + lengths = [] # optional ) diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-duplicate-deployment.md similarity index 90% rename from docs/examples/functions/create-build.md rename to docs/examples/functions/create-duplicate-deployment.md index 3d784b0..79315e4 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -8,7 +8,7 @@ client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) -result = functions.create_build( +result = functions.create_duplicate_deployment( function_id = '<FUNCTION_ID>', deployment_id = '<DEPLOYMENT_ID>', build_id = '<BUILD_ID>' # optional diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md new file mode 100644 index 0000000..6083cc1 --- /dev/null +++ b/docs/examples/functions/create-template-deployment.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +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_template_deployment( + function_id = '<FUNCTION_ID>', + repository = '<REPOSITORY>', + owner = '<OWNER>', + root_directory = '<ROOT_DIRECTORY>', + version = '<VERSION>', + activate = False # optional +) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 84c286f..2089830 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -11,5 +11,6 @@ functions = Functions(client) result = functions.create_variable( function_id = '<FUNCTION_ID>', key = '<KEY>', - value = '<VALUE>' + value = '<VALUE>', + secret = False # optional ) diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000..4004bae --- /dev/null +++ b/docs/examples/functions/create-vcs-deployment.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.enums import VCSDeploymentType + +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_vcs_deployment( + function_id = '<FUNCTION_ID>', + type = VCSDeploymentType.BRANCH, + reference = '<REFERENCE>', + activate = False # optional +) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 68d6e99..8758e27 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -27,9 +27,5 @@ result = functions.create( 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_version = '<TEMPLATE_VERSION>', # optional specification = '' # optional ) diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 8cc16fa..1b0673c 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -10,5 +10,6 @@ functions = Functions(client) result = functions.get_deployment_download( function_id = '<FUNCTION_ID>', - deployment_id = '<DEPLOYMENT_ID>' + deployment_id = '<DEPLOYMENT_ID>', + type = DeploymentDownloadType.SOURCE # optional ) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index e83f727..300fc0e 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -10,6 +10,5 @@ functions = Functions(client) result = functions.list_executions( function_id = '<FUNCTION_ID>', - queries = [], # optional - search = '<SEARCH>' # optional + queries = [] # optional ) diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-status.md similarity index 90% rename from docs/examples/functions/update-deployment-build.md rename to docs/examples/functions/update-deployment-status.md index ef2b8a6..6c6a8bf 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-status.md @@ -8,7 +8,7 @@ client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) -result = functions.update_deployment_build( +result = functions.update_deployment_status( function_id = '<FUNCTION_ID>', deployment_id = '<DEPLOYMENT_ID>' ) diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-function-deployment.md similarity index 89% rename from docs/examples/functions/update-deployment.md rename to docs/examples/functions/update-function-deployment.md index 6b96434..da14309 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -8,7 +8,7 @@ client.set_key('<YOUR_API_KEY>') # Your secret API key functions = Functions(client) -result = functions.update_deployment( +result = functions.update_function_deployment( function_id = '<FUNCTION_ID>', deployment_id = '<DEPLOYMENT_ID>' ) diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index e333ec1..f8bcc03 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -12,5 +12,6 @@ result = functions.update_variable( function_id = '<FUNCTION_ID>', variable_id = '<VARIABLE_ID>', key = '<KEY>', - value = '<VALUE>' # optional + value = '<VALUE>', # optional + secret = False # optional ) diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md new file mode 100644 index 0000000..de6472c --- /dev/null +++ b/docs/examples/sites/create-deployment.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites +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 + +sites = Sites(client) + +result = sites.create_deployment( + site_id = '<SITE_ID>', + code = InputFile.from_path('file.png'), + activate = False, + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>' # optional +) diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000..d79ab9d --- /dev/null +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.create_duplicate_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md new file mode 100644 index 0000000..ac05f9e --- /dev/null +++ b/docs/examples/sites/create-template-deployment.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.create_template_deployment( + site_id = '<SITE_ID>', + repository = '<REPOSITORY>', + owner = '<OWNER>', + root_directory = '<ROOT_DIRECTORY>', + version = '<VERSION>', + activate = False # optional +) diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md new file mode 100644 index 0000000..739beff --- /dev/null +++ b/docs/examples/sites/create-variable.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.create_variable( + site_id = '<SITE_ID>', + key = '<KEY>', + value = '<VALUE>', + secret = False # optional +) diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000..089e6c8 --- /dev/null +++ b/docs/examples/sites/create-vcs-deployment.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.enums import VCSDeploymentType + +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 + +sites = Sites(client) + +result = sites.create_vcs_deployment( + site_id = '<SITE_ID>', + type = VCSDeploymentType.BRANCH, + reference = '<REFERENCE>', + activate = False # optional +) diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md new file mode 100644 index 0000000..4950cd2 --- /dev/null +++ b/docs/examples/sites/create.md @@ -0,0 +1,32 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.enums import +from appwrite.enums import + +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 + +sites = Sites(client) + +result = sites.create( + site_id = '<SITE_ID>', + name = '<NAME>', + framework = .ANALOG, + build_runtime = .NODE_14_5, + enabled = False, # optional + logging = False, # optional + timeout = 1, # optional + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>', # optional + adapter = .STATIC, # optional + installation_id = '<INSTALLATION_ID>', # optional + fallback_file = '<FALLBACK_FILE>', # 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 + specification = '' # optional +) diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md new file mode 100644 index 0000000..029730a --- /dev/null +++ b/docs/examples/sites/delete-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.delete_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md new file mode 100644 index 0000000..0b516e6 --- /dev/null +++ b/docs/examples/sites/delete-log.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.delete_log( + site_id = '<SITE_ID>', + log_id = '<LOG_ID>' +) diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md new file mode 100644 index 0000000..c078813 --- /dev/null +++ b/docs/examples/sites/delete-variable.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.delete_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>' +) diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md new file mode 100644 index 0000000..60670e6 --- /dev/null +++ b/docs/examples/sites/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.delete( + site_id = '<SITE_ID>' +) diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md new file mode 100644 index 0000000..d6af564 --- /dev/null +++ b/docs/examples/sites/get-deployment-download.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.get_deployment_download( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>', + type = DeploymentDownloadType.SOURCE # optional +) diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md new file mode 100644 index 0000000..c4ee1de --- /dev/null +++ b/docs/examples/sites/get-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.get_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md new file mode 100644 index 0000000..ae5d8ac --- /dev/null +++ b/docs/examples/sites/get-log.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.get_log( + site_id = '<SITE_ID>', + log_id = '<LOG_ID>' +) diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md new file mode 100644 index 0000000..7f5f0f6 --- /dev/null +++ b/docs/examples/sites/get-variable.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.get_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>' +) diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md new file mode 100644 index 0000000..f9532a0 --- /dev/null +++ b/docs/examples/sites/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.get( + site_id = '<SITE_ID>' +) diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md new file mode 100644 index 0000000..15ec24d --- /dev/null +++ b/docs/examples/sites/list-deployments.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.list_deployments( + site_id = '<SITE_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md new file mode 100644 index 0000000..6e37646 --- /dev/null +++ b/docs/examples/sites/list-frameworks.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.list_frameworks() diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md new file mode 100644 index 0000000..d3a9a19 --- /dev/null +++ b/docs/examples/sites/list-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.list_logs( + site_id = '<SITE_ID>', + queries = [] # optional +) diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md new file mode 100644 index 0000000..93b713c --- /dev/null +++ b/docs/examples/sites/list-specifications.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.list_specifications() diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md new file mode 100644 index 0000000..5ff78e6 --- /dev/null +++ b/docs/examples/sites/list-variables.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.list_variables( + site_id = '<SITE_ID>' +) diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md new file mode 100644 index 0000000..1b344e1 --- /dev/null +++ b/docs/examples/sites/list.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.list( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md new file mode 100644 index 0000000..492ee4f --- /dev/null +++ b/docs/examples/sites/update-deployment-status.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.update_deployment_status( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md new file mode 100644 index 0000000..69014bb --- /dev/null +++ b/docs/examples/sites/update-site-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.update_site_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md new file mode 100644 index 0000000..973f7f2 --- /dev/null +++ b/docs/examples/sites/update-variable.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +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 + +sites = Sites(client) + +result = sites.update_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>', + key = '<KEY>', + value = '<VALUE>', # optional + secret = False # optional +) diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md new file mode 100644 index 0000000..7d2d286 --- /dev/null +++ b/docs/examples/sites/update.md @@ -0,0 +1,31 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.enums import + +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 + +sites = Sites(client) + +result = sites.update( + site_id = '<SITE_ID>', + name = '<NAME>', + framework = .ANALOG, + enabled = False, # optional + logging = False, # optional + timeout = 1, # optional + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>', # optional + build_runtime = .NODE_14_5, # optional + adapter = .STATIC, # optional + fallback_file = '<FALLBACK_FILE>', # 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 + specification = '' # optional +) diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index d21db63..411abf8 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -10,5 +10,6 @@ storage = Storage(client) result = storage.get_file_download( bucket_id = '<BUCKET_ID>', - file_id = '<FILE_ID>' + file_id = '<FILE_ID>', + token = '<TOKEN>' # optional ) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 20939b2..47e3f23 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -14,12 +14,13 @@ result = storage.get_file_preview( width = 0, # optional height = 0, # optional gravity = ImageGravity.CENTER, # optional - quality = 0, # optional + quality = -1, # optional border_width = 0, # optional border_color = '', # optional border_radius = 0, # optional opacity = 0, # optional rotation = -360, # optional background = '', # optional - output = ImageFormat.JPG # optional + output = ImageFormat.JPG, # optional + token = '<TOKEN>' # optional ) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index bf70d13..85cbad7 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -10,5 +10,6 @@ storage = Storage(client) result = storage.get_file_view( bucket_id = '<BUCKET_ID>', - file_id = '<FILE_ID>' + file_id = '<FILE_ID>', + token = '<TOKEN>' # optional ) diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md new file mode 100644 index 0000000..f835a0e --- /dev/null +++ b/docs/examples/tokens/create-file-token.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +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 + +tokens = Tokens(client) + +result = tokens.create_file_token( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + expire = '' # optional +) diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md new file mode 100644 index 0000000..4761932 --- /dev/null +++ b/docs/examples/tokens/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +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 + +tokens = Tokens(client) + +result = tokens.delete( + token_id = '<TOKEN_ID>' +) diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md new file mode 100644 index 0000000..0d6abb8 --- /dev/null +++ b/docs/examples/tokens/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +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 + +tokens = Tokens(client) + +result = tokens.get( + token_id = '<TOKEN_ID>' +) diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md new file mode 100644 index 0000000..2694650 --- /dev/null +++ b/docs/examples/tokens/list.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +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 + +tokens = Tokens(client) + +result = tokens.list( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + queries = [] # optional +) diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md new file mode 100644 index 0000000..18b0444 --- /dev/null +++ b/docs/examples/tokens/update.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +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 + +tokens = Tokens(client) + +result = tokens.update( + token_id = '<TOKEN_ID>', + expire = '' # optional +) diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 9e3b005..c0d2f2a 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -9,5 +9,7 @@ client.set_key('<YOUR_API_KEY>') # Your secret API key users = Users(client) result = users.list_memberships( - user_id = '<USER_ID>' + user_id = '<USER_ID>', + queries = [], # optional + search = '<SEARCH>' # optional ) diff --git a/setup.py b/setup.py index 7c9c69d..ee37257 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '10.1.0-rc.1', + version = '10.2.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/10.1.0-rc.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/10.2.0.tar.gz', install_requires=[ 'requests', ], From 580d8c2f8e10cd454c0c98e0dcebb59ca8c7e798 Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Sun, 18 May 2025 07:37:01 +0000 Subject: [PATCH 54/60] chore: bump to next major versions --- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index bda3b80..b7ab483 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/10.2.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/11.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '10.2.0', + 'x-sdk-version': '11.0.0', 'X-Appwrite-Response-Format' : '1.7.0', } diff --git a/setup.py b/setup.py index ee37257..5c6270f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '10.2.0', + version = '11.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/10.2.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/11.0.0.tar.gz', install_requires=[ 'requests', ], From fdc15888c96f3b0dbe804cb5a7260e0c2093afe3 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Fri, 18 Jul 2025 12:50:24 +1200 Subject: [PATCH 55/60] Add inc/dec --- README.md | 2 +- appwrite/client.py | 4 +- appwrite/enums/build_runtime.py | 2 + appwrite/enums/image_format.py | 1 + appwrite/enums/runtime.py | 2 + appwrite/services/databases.py | 181 +++++++++++++++++- appwrite/services/tokens.py | 2 +- appwrite/services/users.py | 2 +- docs/examples/databases/create-document.md | 1 + .../databases/decrement-document-attribute.md | 18 ++ .../databases/increment-document-attribute.md | 18 ++ docs/examples/databases/upsert-document.md | 17 ++ docs/examples/databases/upsert-documents.md | 2 +- setup.py | 4 +- 14 files changed, 246 insertions(+), 10 deletions(-) create mode 100644 docs/examples/databases/decrement-document-attribute.md create mode 100644 docs/examples/databases/increment-document-attribute.md create mode 100644 docs/examples/databases/upsert-document.md diff --git a/README.md b/README.md index 2efa745..a68a5ae 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite/client.py b/appwrite/client.py index b7ab483..ed4d4b5 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/11.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/11.1.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '11.0.0', + 'x-sdk-version': '11.1.0', 'X-Appwrite-Response-Format' : '1.7.0', } diff --git a/appwrite/enums/build_runtime.py b/appwrite/enums/build_runtime.py index 9ba151b..aded697 100644 --- a/appwrite/enums/build_runtime.py +++ b/appwrite/enums/build_runtime.py @@ -38,6 +38,7 @@ class BuildRuntime(Enum): DART_3_1 = "dart-3.1" DART_3_3 = "dart-3.3" DART_3_5 = "dart-3.5" + DART_3_8 = "dart-3.8" DOTNET_6_0 = "dotnet-6.0" DOTNET_7_0 = "dotnet-7.0" DOTNET_8_0 = "dotnet-8.0" @@ -64,3 +65,4 @@ class BuildRuntime(Enum): FLUTTER_3_24 = "flutter-3.24" FLUTTER_3_27 = "flutter-3.27" FLUTTER_3_29 = "flutter-3.29" + FLUTTER_3_32 = "flutter-3.32" diff --git a/appwrite/enums/image_format.py b/appwrite/enums/image_format.py index 33c6c99..332f646 100644 --- a/appwrite/enums/image_format.py +++ b/appwrite/enums/image_format.py @@ -7,3 +7,4 @@ class ImageFormat(Enum): WEBP = "webp" HEIC = "heic" AVIF = "avif" + GIF = "gif" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index df2cb34..b0e307a 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -38,6 +38,7 @@ class Runtime(Enum): DART_3_1 = "dart-3.1" DART_3_3 = "dart-3.3" DART_3_5 = "dart-3.5" + DART_3_8 = "dart-3.8" DOTNET_6_0 = "dotnet-6.0" DOTNET_7_0 = "dotnet-7.0" DOTNET_8_0 = "dotnet-8.0" @@ -64,3 +65,4 @@ class Runtime(Enum): FLUTTER_3_24 = "flutter-3.24" FLUTTER_3_27 = "flutter-3.27" FLUTTER_3_29 = "flutter-3.29" + FLUTTER_3_32 = "flutter-3.32" diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index b798f7c..b7e1843 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -1812,6 +1812,8 @@ def create_document(self, database_id: str, collection_id: str, document_id: str def create_documents(self, database_id: str, collection_id: str, documents: List[dict]) -> Dict[str, Any]: """ + **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. + Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. Parameters @@ -1854,10 +1856,11 @@ def create_documents(self, database_id: str, collection_id: str, documents: List 'content-type': 'application/json', }, api_params) - def upsert_documents(self, database_id: str, collection_id: str, documents: List[dict] = None) -> Dict[str, Any]: + def upsert_documents(self, database_id: str, collection_id: str, documents: List[dict]) -> Dict[str, Any]: """ - Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. + Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. Parameters ---------- @@ -1887,6 +1890,9 @@ def upsert_documents(self, database_id: str, collection_id: str, documents: List if collection_id is None: raise AppwriteException('Missing required parameter: "collection_id"') + if documents is None: + raise AppwriteException('Missing required parameter: "documents"') + api_path = api_path.replace('{databaseId}', database_id) api_path = api_path.replace('{collectionId}', collection_id) @@ -1898,6 +1904,8 @@ def upsert_documents(self, database_id: str, collection_id: str, documents: List def update_documents(self, database_id: str, collection_id: str, data: dict = None, queries: List[str] = None) -> Dict[str, Any]: """ + **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. + Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. Parameters @@ -1942,6 +1950,8 @@ def update_documents(self, database_id: str, collection_id: str, data: dict = No def delete_documents(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: """ + **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. + Bulk delete documents using queries, if no queries are passed then all documents are deleted. Parameters @@ -2027,6 +2037,61 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q return self.client.call('get', api_path, { }, api_params) + def upsert_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None) -> Dict[str, Any]: + """ + **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. + + Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + document_id : str + Document ID. + data : dict + Document data as JSON object. Include all required attributes of the document to be created or updated. + permissions : List[str] + An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if collection_id is None: + raise AppwriteException('Missing required parameter: "collection_id"') + + if document_id is None: + raise AppwriteException('Missing required parameter: "document_id"') + + if data is None: + raise AppwriteException('Missing required parameter: "data"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{collectionId}', collection_id) + api_path = api_path.replace('{documentId}', document_id) + + api_params['data'] = data + api_params['permissions'] = permissions + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: List[str] = None) -> Dict[str, Any]: """ Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. @@ -2121,6 +2186,118 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) + def decrement_document_attribute(self, database_id: str, collection_id: str, document_id: str, attribute: str, value: float = None, min: float = None) -> Dict[str, Any]: + """ + Decrement a specific attribute of a document by a given value. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + document_id : str + Document ID. + attribute : str + Attribute key. + value : float + Value to decrement the attribute by. The value must be a number. + min : float + Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if collection_id is None: + raise AppwriteException('Missing required parameter: "collection_id"') + + if document_id is None: + raise AppwriteException('Missing required parameter: "document_id"') + + if attribute is None: + raise AppwriteException('Missing required parameter: "attribute"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{collectionId}', collection_id) + api_path = api_path.replace('{documentId}', document_id) + api_path = api_path.replace('{attribute}', attribute) + + api_params['value'] = value + api_params['min'] = min + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def increment_document_attribute(self, database_id: str, collection_id: str, document_id: str, attribute: str, value: float = None, max: float = None) -> Dict[str, Any]: + """ + Increment a specific attribute of a document by a given value. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. + document_id : str + Document ID. + attribute : str + Attribute key. + value : float + Value to increment the attribute by. The value must be a number. + max : float + Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if collection_id is None: + raise AppwriteException('Missing required parameter: "collection_id"') + + if document_id is None: + raise AppwriteException('Missing required parameter: "document_id"') + + if attribute is None: + raise AppwriteException('Missing required parameter: "attribute"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{collectionId}', collection_id) + api_path = api_path.replace('{documentId}', document_id) + api_path = api_path.replace('{attribute}', attribute) + + api_params['value'] = value + api_params['max'] = max + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + def list_indexes(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: """ List indexes in the collection. diff --git a/appwrite/services/tokens.py b/appwrite/services/tokens.py index 01f1177..7ec7f4f 100644 --- a/appwrite/services/tokens.py +++ b/appwrite/services/tokens.py @@ -49,7 +49,7 @@ def list(self, bucket_id: str, file_id: str, queries: List[str] = None) -> Dict[ def create_file_token(self, bucket_id: str, file_id: str, expire: str = None) -> Dict[str, Any]: """ - Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter. + Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. Parameters ---------- diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 703a6bf..694657f 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -1345,7 +1345,7 @@ def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any user_id : str User ID. queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType Returns ------- diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 1a8500b..3d6cba1 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -3,6 +3,7 @@ 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_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 diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000..397bdd4 --- /dev/null +++ b/docs/examples/databases/decrement-document-attribute.md @@ -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 +) diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000..d5700e0 --- /dev/null +++ b/docs/examples/databases/increment-document-attribute.md @@ -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 +) diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md new file mode 100644 index 0000000..c491ea4 --- /dev/null +++ b/docs/examples/databases/upsert-document.md @@ -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.upsert_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = {}, + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 9972064..5136d5f 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -11,5 +11,5 @@ databases = Databases(client) result = databases.upsert_documents( database_id = '<DATABASE_ID>', collection_id = '<COLLECTION_ID>', - documents = [] # optional + documents = [] ) diff --git a/setup.py b/setup.py index 5c6270f..18c78cc 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '11.0.0', + version = '11.1.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/11.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/11.1.0.tar.gz', install_requires=[ 'requests', ], From f3b858e0e5430c1df8b512ceb0c6f6671550a44f Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Tue, 22 Jul 2025 16:16:48 +0000 Subject: [PATCH 56/60] chore: regenerate --- README.md | 4 +- appwrite/client.py | 6 +- appwrite/services/account.py | 35 + appwrite/services/avatars.py | 7 + appwrite/services/databases.py | 257 +- appwrite/services/functions.py | 24 + appwrite/services/graphql.py | 2 + appwrite/services/health.py | 14 + appwrite/services/messaging.py | 46 + appwrite/services/sites.py | 23 + appwrite/services/storage.py | 13 + appwrite/services/tables.py | 2331 +++++++++++++++++ appwrite/services/teams.py | 13 + appwrite/services/tokens.py | 5 + appwrite/services/users.py | 42 + docs/examples/databases/create-document.md | 1 - docs/examples/databases/create-documents.md | 1 + docs/examples/databases/upsert-document.md | 7 +- docs/examples/databases/upsert-documents.md | 5 +- docs/examples/tables/create-boolean-column.md | 18 + .../examples/tables/create-datetime-column.md | 18 + docs/examples/tables/create-email-column.md | 18 + docs/examples/tables/create-enum-column.md | 19 + docs/examples/tables/create-float-column.md | 20 + docs/examples/tables/create-index.md | 20 + docs/examples/tables/create-integer-column.md | 20 + docs/examples/tables/create-ip-column.md | 18 + .../tables/create-relationship-column.md | 21 + docs/examples/tables/create-row.md | 18 + docs/examples/tables/create-rows.md | 15 + docs/examples/tables/create-string-column.md | 20 + docs/examples/tables/create-url-column.md | 18 + docs/examples/tables/create.md | 18 + docs/examples/tables/decrement-row-column.md | 18 + docs/examples/tables/delete-column.md | 15 + docs/examples/tables/delete-index.md | 15 + docs/examples/tables/delete-row.md | 15 + docs/examples/tables/delete-rows.md | 15 + docs/examples/tables/delete.md | 14 + docs/examples/tables/get-column.md | 15 + docs/examples/tables/get-index.md | 15 + docs/examples/tables/get-row.md | 16 + docs/examples/tables/get.md | 14 + docs/examples/tables/increment-row-column.md | 18 + docs/examples/tables/list-columns.md | 15 + docs/examples/tables/list-indexes.md | 15 + docs/examples/tables/list-rows.md | 15 + docs/examples/tables/list.md | 15 + docs/examples/tables/update-boolean-column.md | 18 + .../examples/tables/update-datetime-column.md | 18 + docs/examples/tables/update-email-column.md | 18 + docs/examples/tables/update-enum-column.md | 19 + docs/examples/tables/update-float-column.md | 20 + docs/examples/tables/update-integer-column.md | 20 + docs/examples/tables/update-ip-column.md | 18 + .../tables/update-relationship-column.md | 17 + docs/examples/tables/update-row.md | 17 + docs/examples/tables/update-rows.md | 16 + docs/examples/tables/update-string-column.md | 19 + docs/examples/tables/update-url-column.md | 18 + docs/examples/tables/update.md | 18 + docs/examples/tables/upsert-row.md | 16 + docs/examples/tables/upsert-rows.md | 14 + setup.py | 4 +- 64 files changed, 3515 insertions(+), 82 deletions(-) create mode 100644 appwrite/services/tables.py create mode 100644 docs/examples/tables/create-boolean-column.md create mode 100644 docs/examples/tables/create-datetime-column.md create mode 100644 docs/examples/tables/create-email-column.md create mode 100644 docs/examples/tables/create-enum-column.md create mode 100644 docs/examples/tables/create-float-column.md create mode 100644 docs/examples/tables/create-index.md create mode 100644 docs/examples/tables/create-integer-column.md create mode 100644 docs/examples/tables/create-ip-column.md create mode 100644 docs/examples/tables/create-relationship-column.md create mode 100644 docs/examples/tables/create-row.md create mode 100644 docs/examples/tables/create-rows.md create mode 100644 docs/examples/tables/create-string-column.md create mode 100644 docs/examples/tables/create-url-column.md create mode 100644 docs/examples/tables/create.md create mode 100644 docs/examples/tables/decrement-row-column.md create mode 100644 docs/examples/tables/delete-column.md create mode 100644 docs/examples/tables/delete-index.md create mode 100644 docs/examples/tables/delete-row.md create mode 100644 docs/examples/tables/delete-rows.md create mode 100644 docs/examples/tables/delete.md create mode 100644 docs/examples/tables/get-column.md create mode 100644 docs/examples/tables/get-index.md create mode 100644 docs/examples/tables/get-row.md create mode 100644 docs/examples/tables/get.md create mode 100644 docs/examples/tables/increment-row-column.md create mode 100644 docs/examples/tables/list-columns.md create mode 100644 docs/examples/tables/list-indexes.md create mode 100644 docs/examples/tables/list-rows.md create mode 100644 docs/examples/tables/list.md create mode 100644 docs/examples/tables/update-boolean-column.md create mode 100644 docs/examples/tables/update-datetime-column.md create mode 100644 docs/examples/tables/update-email-column.md create mode 100644 docs/examples/tables/update-enum-column.md create mode 100644 docs/examples/tables/update-float-column.md create mode 100644 docs/examples/tables/update-integer-column.md create mode 100644 docs/examples/tables/update-ip-column.md create mode 100644 docs/examples/tables/update-relationship-column.md create mode 100644 docs/examples/tables/update-row.md create mode 100644 docs/examples/tables/update-rows.md create mode 100644 docs/examples/tables/update-string-column.md create mode 100644 docs/examples/tables/update-url-column.md create mode 100644 docs/examples/tables/update.md create mode 100644 docs/examples/tables/upsert-row.md create mode 100644 docs/examples/tables/upsert-rows.md diff --git a/README.md b/README.md index a68a5ae..a2dea19 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** +**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite/client.py b/appwrite/client.py index ed4d4b5..93897d8 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,12 +14,12 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/11.1.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/12.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '11.1.0', - 'X-Appwrite-Response-Format' : '1.7.0', + 'x-sdk-version': '12.0.0', + 'X-Appwrite-Response-Format' : '1.8.0', } def set_self_signed(self, status=True): diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 9dd3c5e..8b67abe 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -35,6 +35,7 @@ def create(self, user_id: str, email: str, password: str, name: str = None) -> D """ Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). + Parameters ---------- user_id : str @@ -84,6 +85,7 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]: This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + Parameters ---------- email : str @@ -122,6 +124,7 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]: """ Get the list of identities for the currently logged in user. + Parameters ---------- queries : List[str] @@ -150,6 +153,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: """ Delete an identity by its unique ID. + Parameters ---------- identity_id : str @@ -204,6 +208,7 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]: """ Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. + Parameters ---------- queries : List[str] @@ -232,6 +237,7 @@ def update_mfa(self, mfa: bool) -> Dict[str, Any]: """ Enable or disable MFA on an account. + Parameters ---------- mfa : bool @@ -264,6 +270,7 @@ def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: """ Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. + Parameters ---------- type : AuthenticatorType @@ -296,6 +303,7 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[st """ Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. + Parameters ---------- type : AuthenticatorType @@ -334,6 +342,7 @@ def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: """ Delete an authenticator for a user by ID. + Parameters ---------- type : AuthenticatorType @@ -366,6 +375,7 @@ def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]: """ Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. + Parameters ---------- factor : AuthenticationFactor @@ -398,6 +408,7 @@ def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]: """ Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. + Parameters ---------- challenge_id : str @@ -522,6 +533,7 @@ def update_name(self, name: str) -> Dict[str, Any]: """ Update currently logged in user account name. + Parameters ---------- name : str @@ -554,6 +566,7 @@ def update_password(self, password: str, old_password: str = None) -> Dict[str, """ Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. + Parameters ---------- password : str @@ -589,6 +602,7 @@ def update_phone(self, phone: str, password: str) -> Dict[str, Any]: """ Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. + Parameters ---------- phone : str @@ -648,6 +662,7 @@ def update_prefs(self, prefs: dict) -> Dict[str, Any]: """ Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. + Parameters ---------- prefs : dict @@ -680,6 +695,7 @@ def create_recovery(self, email: str, url: str) -> Dict[str, Any]: """ Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. + Parameters ---------- email : str @@ -720,6 +736,7 @@ def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str, Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + Parameters ---------- user_id : str @@ -831,6 +848,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str, A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- email : str @@ -869,6 +887,9 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + .. deprecated:: + This API has been deprecated. + Parameters ---------- user_id : str @@ -907,6 +928,9 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + .. deprecated:: + This API has been deprecated. + Parameters ---------- user_id : str @@ -945,6 +969,7 @@ def create_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters ---------- user_id : str @@ -983,6 +1008,7 @@ def get_session(self, session_id: str) -> Dict[str, Any]: """ Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. + Parameters ---------- session_id : str @@ -1014,6 +1040,7 @@ def update_session(self, session_id: str) -> Dict[str, Any]: """ Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. + Parameters ---------- session_id : str @@ -1046,6 +1073,7 @@ def delete_session(self, session_id: str) -> Dict[str, Any]: """ Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. + Parameters ---------- session_id : str @@ -1102,6 +1130,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1146,6 +1175,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1194,6 +1224,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- provider : OAuthProvider @@ -1236,6 +1267,7 @@ def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]: A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1277,6 +1309,7 @@ def create_verification(self, url: str) -> Dict[str, Any]: Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + Parameters ---------- url : str @@ -1309,6 +1342,7 @@ def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. + Parameters ---------- user_id : str @@ -1369,6 +1403,7 @@ def update_phone_verification(self, user_id: str, secret: str) -> Dict[str, Any] """ Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. + Parameters ---------- user_id : str diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 6ee1d4f..2bd32f7 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -16,6 +16,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : Browser @@ -59,6 +60,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : CreditCard @@ -101,6 +103,7 @@ def get_favicon(self, url: str) -> bytes: This endpoint does not follow HTTP redirects. + Parameters ---------- url : str @@ -135,6 +138,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : Flag @@ -179,6 +183,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte This endpoint does not follow HTTP redirects. + Parameters ---------- url : str @@ -221,6 +226,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- name : str @@ -259,6 +265,7 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download: Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. + Parameters ---------- text : str diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index b7e1843..20ddd16 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -14,6 +14,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. + Parameters ---------- queries : List[str] @@ -46,6 +47,7 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Create a new Database. + Parameters ---------- database_id : str @@ -87,6 +89,7 @@ def get(self, database_id: str) -> Dict[str, Any]: """ Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. + Parameters ---------- database_id : str @@ -118,6 +121,7 @@ def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, """ Update a database by its unique ID. + Parameters ---------- database_id : str @@ -159,6 +163,7 @@ def delete(self, database_id: str) -> Dict[str, Any]: """ Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. + Parameters ---------- database_id : str @@ -191,6 +196,9 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: """ Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.list` instead. + Parameters ---------- database_id : str @@ -228,6 +236,9 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per """ Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create` instead. + Parameters ---------- database_id : str @@ -281,6 +292,9 @@ def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any] """ Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.get` instead. + Parameters ---------- database_id : str @@ -318,6 +332,9 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per """ Update a collection by its unique ID. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update` instead. + Parameters ---------- database_id : str @@ -371,6 +388,9 @@ def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, A """ Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.delete` instead. + Parameters ---------- database_id : str @@ -409,12 +429,15 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st """ List attributes in the collection. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.list_columns` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. queries : List[str] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error @@ -450,12 +473,15 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st Create a boolean attribute. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_boolean_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -506,12 +532,15 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st """ Update a boolean attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_boolean_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). key : str Attribute Key. required : bool @@ -562,12 +591,15 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s """ Create a date time attribute according to the ISO 8601 standard. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_datetime_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). key : str Attribute Key. required : bool @@ -618,12 +650,15 @@ def update_datetime_attribute(self, database_id: str, collection_id: str, key: s """ Update a date time attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_datetime_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool @@ -675,12 +710,15 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, Create an email attribute. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_email_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool @@ -732,12 +770,15 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, Update an email attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_email_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool @@ -745,7 +786,7 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, default : str Default value for attribute when not provided. Cannot be set when attribute is required. new_key : str - New attribute key. + New Attribute Key. Returns ------- @@ -786,19 +827,22 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: """ - Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. + Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_enum_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. elements : List[str] - Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. + Array of enum values. required : bool Is attribute required? default : str @@ -852,22 +896,25 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, Update an enum attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_enum_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. elements : List[str] - Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. + Updated list of enum values. required : bool Is attribute required? default : str Default value for attribute when not provided. Cannot be set when attribute is required. new_key : str - New attribute key. + New Attribute Key. Returns ------- @@ -915,22 +962,25 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, Create a float attribute. Optionally, minimum and maximum values can be provided. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_float_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool Is attribute required? min : float - Minimum value to enforce on new documents + Minimum value. max : float - Maximum value to enforce on new documents + Maximum value. default : float - Default value for attribute when not provided. Cannot be set when attribute is required. + Default value. Cannot be set when required. array : bool Is attribute an array? @@ -978,24 +1028,27 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, Update a float attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_float_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool Is attribute required? default : float - Default value for attribute when not provided. Cannot be set when attribute is required. + Default value. Cannot be set when required. min : float - Minimum value to enforce on new documents + Minimum value. max : float - Maximum value to enforce on new documents + Maximum value. new_key : str - New attribute key. + New Attribute Key. Returns ------- @@ -1041,22 +1094,25 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st Create an integer attribute. Optionally, minimum and maximum values can be provided. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_integer_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool Is attribute required? min : float - Minimum value to enforce on new documents + Minimum value max : float - Maximum value to enforce on new documents + Maximum value default : float - Default value for attribute when not provided. Cannot be set when attribute is required. + Default value. Cannot be set when attribute is required. array : bool Is attribute an array? @@ -1104,24 +1160,27 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st Update an integer attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_integer_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool Is attribute required? default : float - Default value for attribute when not provided. Cannot be set when attribute is required. + Default value. Cannot be set when attribute is required. min : float - Minimum value to enforce on new documents + Minimum value max : float - Maximum value to enforce on new documents + Maximum value new_key : str - New attribute key. + New Attribute Key. Returns ------- @@ -1167,18 +1226,21 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re Create IP address attribute. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_ip_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool Is attribute required? default : str - Default value for attribute when not provided. Cannot be set when attribute is required. + Default value. Cannot be set when attribute is required. array : bool Is attribute an array? @@ -1224,20 +1286,23 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re Update an ip attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_ip_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool Is attribute required? default : str - Default value for attribute when not provided. Cannot be set when attribute is required. + Default value. Cannot be set when attribute is required. new_key : str - New attribute key. + New Attribute Key. Returns ------- @@ -1281,14 +1346,17 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_relationship_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. related_collection_id : str - Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Related Collection ID. type : RelationshipType Relation type two_way : bool @@ -1344,12 +1412,15 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str Create a string attribute. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_string_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. size : float @@ -1410,12 +1481,15 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str Update a string attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_string_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -1425,7 +1499,7 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str size : float Maximum size of the string attribute. new_key : str - New attribute key. + New Attribute Key. Returns ------- @@ -1470,12 +1544,15 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r Create a URL attribute. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_url_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool @@ -1527,12 +1604,15 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r Update an url attribute. Changing the `default` value will not update already existing documents. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_url_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. required : bool @@ -1540,7 +1620,7 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r default : str Default value for attribute when not provided. Cannot be set when attribute is required. new_key : str - New attribute key. + New Attribute Key. Returns ------- @@ -1583,12 +1663,15 @@ def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[ """ Get attribute by ID. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.get_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. @@ -1626,12 +1709,15 @@ def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Di """ Deletes an attribute. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.delete_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. @@ -1671,18 +1757,21 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_relationship_column` instead. + Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. key : str Attribute Key. on_delete : RelationMutate Constraints option new_key : str - New attribute key. + New Attribute Key. Returns ------- @@ -1721,6 +1810,9 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str """ Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.list_rows` instead. + Parameters ---------- database_id : str @@ -1761,6 +1853,9 @@ def create_document(self, database_id: str, collection_id: str, document_id: str """ Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_row` instead. + Parameters ---------- database_id : str @@ -1816,6 +1911,9 @@ def create_documents(self, database_id: str, collection_id: str, documents: List Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_row` instead. + Parameters ---------- database_id : str @@ -1856,11 +1954,15 @@ def create_documents(self, database_id: str, collection_id: str, documents: List 'content-type': 'application/json', }, api_params) - def upsert_documents(self, database_id: str, collection_id: str, documents: List[dict]) -> Dict[str, Any]: + def upsert_documents(self, database_id: str, collection_id: str) -> Dict[str, Any]: """ **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + + + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.upsert_rows` instead. Parameters ---------- @@ -1868,8 +1970,6 @@ def upsert_documents(self, database_id: str, collection_id: str, documents: List Database ID. collection_id : str Collection ID. - documents : List[dict] - Array of document data as JSON objects. May contain partial documents. Returns ------- @@ -1890,13 +1990,9 @@ def upsert_documents(self, database_id: str, collection_id: str, documents: List if collection_id is None: raise AppwriteException('Missing required parameter: "collection_id"') - if documents is None: - raise AppwriteException('Missing required parameter: "documents"') - api_path = api_path.replace('{databaseId}', database_id) api_path = api_path.replace('{collectionId}', collection_id) - api_params['documents'] = documents return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -1908,6 +2004,9 @@ def update_documents(self, database_id: str, collection_id: str, data: dict = No Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_rows` instead. + Parameters ---------- database_id : str @@ -1954,6 +2053,9 @@ def delete_documents(self, database_id: str, collection_id: str, queries: List[s Bulk delete documents using queries, if no queries are passed then all documents are deleted. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.delete_rows` instead. + Parameters ---------- database_id : str @@ -1995,6 +2097,9 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q """ Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.get_row` instead. + Parameters ---------- database_id : str @@ -2037,12 +2142,15 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q return self.client.call('get', api_path, { }, api_params) - def upsert_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None) -> Dict[str, Any]: + def upsert_document(self, database_id: str, collection_id: str, document_id: str) -> Dict[str, Any]: """ **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.upsert_row` instead. + Parameters ---------- database_id : str @@ -2051,10 +2159,6 @@ def upsert_document(self, database_id: str, collection_id: str, document_id: str Collection ID. document_id : str Document ID. - data : dict - Document data as JSON object. Include all required attributes of the document to be created or updated. - permissions : List[str] - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). Returns ------- @@ -2078,15 +2182,10 @@ def upsert_document(self, database_id: str, collection_id: str, document_id: str if document_id is None: raise AppwriteException('Missing required parameter: "document_id"') - if data is None: - raise AppwriteException('Missing required parameter: "data"') - api_path = api_path.replace('{databaseId}', database_id) api_path = api_path.replace('{collectionId}', collection_id) api_path = api_path.replace('{documentId}', document_id) - api_params['data'] = data - api_params['permissions'] = permissions return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -2096,6 +2195,9 @@ def update_document(self, database_id: str, collection_id: str, document_id: str """ Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.update_row` instead. + Parameters ---------- database_id : str @@ -2146,6 +2248,9 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str """ Delete a document by its unique ID. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.delete_row` instead. + Parameters ---------- database_id : str @@ -2190,6 +2295,9 @@ def decrement_document_attribute(self, database_id: str, collection_id: str, doc """ Decrement a specific attribute of a document by a given value. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.decrement_row_column` instead. + Parameters ---------- database_id : str @@ -2201,7 +2309,7 @@ def decrement_document_attribute(self, database_id: str, collection_id: str, doc attribute : str Attribute key. value : float - Value to decrement the attribute by. The value must be a number. + Value to increment the attribute by. The value must be a number. min : float Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. @@ -2246,6 +2354,9 @@ def increment_document_attribute(self, database_id: str, collection_id: str, doc """ Increment a specific attribute of a document by a given value. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.increment_row_column` instead. + Parameters ---------- database_id : str @@ -2302,6 +2413,9 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] """ List indexes in the collection. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.list_indexes` instead. + Parameters ---------- database_id : str @@ -2343,6 +2457,9 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be `key`, `fulltext`, and `unique`. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.create_index` instead. + Parameters ---------- database_id : str @@ -2405,6 +2522,9 @@ def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, """ Get index by ID. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.get_index` instead. + Parameters ---------- database_id : str @@ -2448,6 +2568,9 @@ def delete_index(self, database_id: str, collection_id: str, key: str) -> Dict[s """ Delete an index. + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tables.delete_index` instead. + Parameters ---------- database_id : str diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 9dce425..3dd2459 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -16,6 +16,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's functions. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -47,6 +48,7 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st """ Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. + Parameters ---------- function_id : str @@ -178,6 +180,7 @@ def get(self, function_id: str) -> Dict[str, Any]: """ Get a function by its unique ID. + Parameters ---------- function_id : str @@ -209,6 +212,7 @@ def update(self, function_id: str, name: str, runtime: Runtime = None, execute: """ Update function by its unique ID. + Parameters ---------- function_id : str @@ -295,6 +299,7 @@ def delete(self, function_id: str) -> Dict[str, Any]: """ Delete a function by its unique ID. + Parameters ---------- function_id : str @@ -327,6 +332,7 @@ def update_function_deployment(self, function_id: str, deployment_id: str) -> Di """ Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function. + Parameters ---------- function_id : str @@ -365,6 +371,7 @@ def list_deployments(self, function_id: str, queries: List[str] = None, search: """ Get a list of all the function's code deployments. You can use the query params to filter your results. + Parameters ---------- function_id : str @@ -406,6 +413,7 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e Use the "command" param to set the entrypoint used to execute your code. + Parameters ---------- function_id : str @@ -463,6 +471,7 @@ def create_duplicate_deployment(self, function_id: str, deployment_id: str, buil """ Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + Parameters ---------- function_id : str @@ -506,6 +515,7 @@ def create_template_deployment(self, function_id: str, repository: str, owner: s Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. + Parameters ---------- function_id : str @@ -567,6 +577,7 @@ def create_vcs_deployment(self, function_id: str, type: VCSDeploymentType, refer This endpoint lets you create deployment from a branch, commit, or a tag. + Parameters ---------- function_id : str @@ -614,6 +625,7 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any] """ Get a function deployment by its unique ID. + Parameters ---------- function_id : str @@ -651,6 +663,7 @@ def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, A """ Delete a code deployment by its unique ID. + Parameters ---------- function_id : str @@ -689,6 +702,7 @@ def get_deployment_download(self, function_id: str, deployment_id: str, type: De """ Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + Parameters ---------- function_id : str @@ -729,6 +743,7 @@ def update_deployment_status(self, function_id: str, deployment_id: str) -> Dict """ Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + Parameters ---------- function_id : str @@ -767,6 +782,7 @@ def list_executions(self, function_id: str, queries: List[str] = None) -> Dict[s """ Get a list of all the current user function execution logs. You can use the query params to filter your results. + Parameters ---------- function_id : str @@ -801,6 +817,7 @@ def create_execution(self, function_id: str, body: str = None, xasync: bool = No """ Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. + Parameters ---------- function_id : str @@ -851,6 +868,7 @@ def get_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: """ Get a function execution log by its unique ID. + Parameters ---------- function_id : str @@ -888,6 +906,7 @@ def delete_execution(self, function_id: str, execution_id: str) -> Dict[str, Any """ Delete a function execution by its unique ID. + Parameters ---------- function_id : str @@ -926,6 +945,7 @@ def list_variables(self, function_id: str) -> Dict[str, Any]: """ Get a list of all variables of a specific function. + Parameters ---------- function_id : str @@ -957,6 +977,7 @@ def create_variable(self, function_id: str, key: str, value: str, secret: bool = """ Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. + Parameters ---------- function_id : str @@ -1004,6 +1025,7 @@ def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: """ Get a variable by its unique ID. + Parameters ---------- function_id : str @@ -1041,6 +1063,7 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s """ Update variable by its unique ID. + Parameters ---------- function_id : str @@ -1091,6 +1114,7 @@ def delete_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: """ Delete a variable by its unique ID. + Parameters ---------- function_id : str diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 22ca3aa..69ad4e0 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -11,6 +11,7 @@ def query(self, query: dict) -> Dict[str, Any]: """ Execute a GraphQL mutation. + Parameters ---------- query : dict @@ -44,6 +45,7 @@ def mutation(self, query: dict) -> Dict[str, Any]: """ Execute a GraphQL mutation. + Parameters ---------- query : dict diff --git a/appwrite/services/health.py b/appwrite/services/health.py index dd1d183..665fd1e 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -75,6 +75,7 @@ def get_certificate(self, domain: str = None) -> Dict[str, Any]: """ Get the SSL certificate for a domain + Parameters ---------- domain : str @@ -145,6 +146,7 @@ def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of builds that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -173,6 +175,7 @@ def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -201,6 +204,7 @@ def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict """ Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- name : str @@ -232,6 +236,7 @@ def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -261,6 +266,7 @@ def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any] Returns the amount of failed jobs in a given queue. + Parameters ---------- name : Name @@ -295,6 +301,7 @@ def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -323,6 +330,7 @@ def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of logs that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -351,6 +359,7 @@ def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of mails that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -379,6 +388,7 @@ def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of messages that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -407,6 +417,7 @@ def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -435,6 +446,7 @@ def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. + Parameters ---------- threshold : float @@ -463,6 +475,7 @@ def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -491,6 +504,7 @@ def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 639a820..153a1f7 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -13,6 +13,7 @@ def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[s """ Get a list of all messages from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -44,6 +45,7 @@ def create_email(self, message_id: str, subject: str, content: str, topics: List """ Create a new email message. + Parameters ---------- message_id : str @@ -116,6 +118,7 @@ def update_email(self, message_id: str, topics: List[str] = None, users: List[st Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -181,6 +184,7 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi """ Create a new push notification. + Parameters ---------- message_id : str @@ -268,6 +272,7 @@ def update_push(self, message_id: str, topics: List[str] = None, users: List[str Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -354,6 +359,7 @@ def create_sms(self, message_id: str, content: str, topics: List[str] = None, us """ Create a new SMS message. + Parameters ---------- message_id : str @@ -408,6 +414,7 @@ def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -459,6 +466,7 @@ def get_message(self, message_id: str) -> Dict[str, Any]: Get a message by its unique ID. + Parameters ---------- message_id : str @@ -490,6 +498,7 @@ def delete(self, message_id: str) -> Dict[str, Any]: """ Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message. + Parameters ---------- message_id : str @@ -522,6 +531,7 @@ def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[ """ Get the message activity logs listed by its unique ID. + Parameters ---------- message_id : str @@ -556,6 +566,7 @@ def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, """ Get a list of the targets associated with a message. + Parameters ---------- message_id : str @@ -590,6 +601,7 @@ def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[ """ Get a list of all providers from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -621,6 +633,7 @@ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None """ Create a new Apple Push Notification service provider. + Parameters ---------- provider_id : str @@ -677,6 +690,7 @@ def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool """ Update a Apple Push Notification service provider by its unique ID. + Parameters ---------- provider_id : str @@ -730,6 +744,7 @@ def create_fcm_provider(self, provider_id: str, name: str, service_account_json: """ Create a new Firebase Cloud Messaging provider. + Parameters ---------- provider_id : str @@ -774,6 +789,7 @@ def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool """ Update a Firebase Cloud Messaging provider by its unique ID. + Parameters ---------- provider_id : str @@ -815,6 +831,7 @@ def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = No """ Create a new Mailgun provider. + Parameters ---------- provider_id : str @@ -877,6 +894,7 @@ def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: s """ Update a Mailgun provider by its unique ID. + Parameters ---------- provider_id : str @@ -936,6 +954,7 @@ def create_msg91_provider(self, provider_id: str, name: str, template_id: str = """ Create a new MSG91 provider. + Parameters ---------- provider_id : str @@ -986,6 +1005,7 @@ def update_msg91_provider(self, provider_id: str, name: str = None, enabled: boo """ Update a MSG91 provider by its unique ID. + Parameters ---------- provider_id : str @@ -1033,6 +1053,7 @@ def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = N """ Create a new Sendgrid provider. + Parameters ---------- provider_id : str @@ -1089,6 +1110,7 @@ def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: """ Update a Sendgrid provider by its unique ID. + Parameters ---------- provider_id : str @@ -1142,6 +1164,7 @@ def create_smtp_provider(self, provider_id: str, name: str, host: str, port: flo """ Create a new SMTP provider. + Parameters ---------- provider_id : str @@ -1219,6 +1242,7 @@ def update_smtp_provider(self, provider_id: str, name: str = None, host: str = N """ Update a SMTP provider by its unique ID. + Parameters ---------- provider_id : str @@ -1290,6 +1314,7 @@ def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = Non """ Create a new Telesign provider. + Parameters ---------- provider_id : str @@ -1340,6 +1365,7 @@ def update_telesign_provider(self, provider_id: str, name: str = None, enabled: """ Update a Telesign provider by its unique ID. + Parameters ---------- provider_id : str @@ -1387,6 +1413,7 @@ def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = No """ Create a new Textmagic provider. + Parameters ---------- provider_id : str @@ -1437,6 +1464,7 @@ def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: """ Update a Textmagic provider by its unique ID. + Parameters ---------- provider_id : str @@ -1484,6 +1512,7 @@ def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, """ Create a new Twilio provider. + Parameters ---------- provider_id : str @@ -1534,6 +1563,7 @@ def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bo """ Update a Twilio provider by its unique ID. + Parameters ---------- provider_id : str @@ -1581,6 +1611,7 @@ def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, """ Create a new Vonage provider. + Parameters ---------- provider_id : str @@ -1631,6 +1662,7 @@ def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bo """ Update a Vonage provider by its unique ID. + Parameters ---------- provider_id : str @@ -1679,6 +1711,7 @@ def get_provider(self, provider_id: str) -> Dict[str, Any]: Get a provider by its unique ID. + Parameters ---------- provider_id : str @@ -1710,6 +1743,7 @@ def delete_provider(self, provider_id: str) -> Dict[str, Any]: """ Delete a provider by its unique ID. + Parameters ---------- provider_id : str @@ -1742,6 +1776,7 @@ def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dic """ Get the provider activity logs listed by its unique ID. + Parameters ---------- provider_id : str @@ -1776,6 +1811,7 @@ def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> """ Get the subscriber activity logs listed by its unique ID. + Parameters ---------- subscriber_id : str @@ -1810,6 +1846,7 @@ def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str """ Get a list of all topics from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -1841,6 +1878,7 @@ def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None) -> """ Create a new topic. + Parameters ---------- topic_id : str @@ -1883,6 +1921,7 @@ def get_topic(self, topic_id: str) -> Dict[str, Any]: Get a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1915,6 +1954,7 @@ def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = N Update a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1953,6 +1993,7 @@ def delete_topic(self, topic_id: str) -> Dict[str, Any]: """ Delete a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1985,6 +2026,7 @@ def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, """ Get the topic activity logs listed by its unique ID. + Parameters ---------- topic_id : str @@ -2019,6 +2061,7 @@ def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str """ Get a list of all subscribers from the current Appwrite project. + Parameters ---------- topic_id : str @@ -2056,6 +2099,7 @@ def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str) - """ Create a new subscriber. + Parameters ---------- topic_id : str @@ -2101,6 +2145,7 @@ def get_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: Get a subscriber by its unique ID. + Parameters ---------- topic_id : str @@ -2138,6 +2183,7 @@ def delete_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any] """ Delete a subscriber by its unique ID. + Parameters ---------- topic_id : str diff --git a/appwrite/services/sites.py b/appwrite/services/sites.py index bcb7597..857cabe 100644 --- a/appwrite/services/sites.py +++ b/appwrite/services/sites.py @@ -17,6 +17,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's sites. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -48,6 +49,7 @@ def create(self, site_id: str, name: str, framework: Framework, build_runtime: B """ Create a new site. + Parameters ---------- site_id : str @@ -182,6 +184,7 @@ def get(self, site_id: str) -> Dict[str, Any]: """ Get a site by its unique ID. + Parameters ---------- site_id : str @@ -213,6 +216,7 @@ def update(self, site_id: str, name: str, framework: Framework, enabled: bool = """ Update site by its unique ID. + Parameters ---------- site_id : str @@ -302,6 +306,7 @@ def delete(self, site_id: str) -> Dict[str, Any]: """ Delete a site by its unique ID. + Parameters ---------- site_id : str @@ -334,6 +339,7 @@ def update_site_deployment(self, site_id: str, deployment_id: str) -> Dict[str, """ Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site. + Parameters ---------- site_id : str @@ -372,6 +378,7 @@ def list_deployments(self, site_id: str, queries: List[str] = None, search: str """ Get a list of all the site's code deployments. You can use the query params to filter your results. + Parameters ---------- site_id : str @@ -409,6 +416,7 @@ def create_deployment(self, site_id: str, code: InputFile, activate: bool, insta """ Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID. + Parameters ---------- site_id : str @@ -469,6 +477,7 @@ def create_duplicate_deployment(self, site_id: str, deployment_id: str) -> Dict[ """ Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + Parameters ---------- site_id : str @@ -509,6 +518,7 @@ def create_template_deployment(self, site_id: str, repository: str, owner: str, Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. + Parameters ---------- site_id : str @@ -570,6 +580,7 @@ def create_vcs_deployment(self, site_id: str, type: VCSDeploymentType, reference This endpoint lets you create deployment from a branch, commit, or a tag. + Parameters ---------- site_id : str @@ -617,6 +628,7 @@ def get_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: """ Get a site deployment by its unique ID. + Parameters ---------- site_id : str @@ -654,6 +666,7 @@ def delete_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: """ Delete a site deployment by its unique ID. + Parameters ---------- site_id : str @@ -692,6 +705,7 @@ def get_deployment_download(self, site_id: str, deployment_id: str, type: Deploy """ Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + Parameters ---------- site_id : str @@ -732,6 +746,7 @@ def update_deployment_status(self, site_id: str, deployment_id: str) -> Dict[str """ Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + Parameters ---------- site_id : str @@ -770,6 +785,7 @@ def list_logs(self, site_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get a list of all site logs. You can use the query params to filter your results. + Parameters ---------- site_id : str @@ -804,6 +820,7 @@ def get_log(self, site_id: str, log_id: str) -> Dict[str, Any]: """ Get a site request log by its unique ID. + Parameters ---------- site_id : str @@ -841,6 +858,7 @@ def delete_log(self, site_id: str, log_id: str) -> Dict[str, Any]: """ Delete a site log by its unique ID. + Parameters ---------- site_id : str @@ -879,6 +897,7 @@ def list_variables(self, site_id: str) -> Dict[str, Any]: """ Get a list of all variables of a specific site. + Parameters ---------- site_id : str @@ -910,6 +929,7 @@ def create_variable(self, site_id: str, key: str, value: str, secret: bool = Non """ Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. + Parameters ---------- site_id : str @@ -957,6 +977,7 @@ def get_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: """ Get a variable by its unique ID. + Parameters ---------- site_id : str @@ -994,6 +1015,7 @@ def update_variable(self, site_id: str, variable_id: str, key: str, value: str = """ Update variable by its unique ID. + Parameters ---------- site_id : str @@ -1044,6 +1066,7 @@ def delete_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: """ Delete a variable by its unique ID. + Parameters ---------- site_id : str diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 22198eb..e970187 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -15,6 +15,7 @@ def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[st """ Get a list of all the storage buckets. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -46,6 +47,7 @@ def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None """ Create a new storage bucket. + Parameters ---------- bucket_id : str @@ -108,6 +110,7 @@ def get_bucket(self, bucket_id: str) -> Dict[str, Any]: """ Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata. + Parameters ---------- bucket_id : str @@ -139,6 +142,7 @@ def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None """ Update a storage bucket by its unique ID. + Parameters ---------- bucket_id : str @@ -201,6 +205,7 @@ def delete_bucket(self, bucket_id: str) -> Dict[str, Any]: """ Delete a storage bucket by its unique ID. + Parameters ---------- bucket_id : str @@ -233,6 +238,7 @@ def list_files(self, bucket_id: str, queries: List[str] = None, search: str = No """ Get a list of all the user files. You can use the query params to filter your results. + Parameters ---------- bucket_id : str @@ -277,6 +283,7 @@ def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. + Parameters ---------- bucket_id : str @@ -332,6 +339,7 @@ def get_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. + Parameters ---------- bucket_id : str @@ -369,6 +377,7 @@ def update_file(self, bucket_id: str, file_id: str, name: str = None, permission """ Update a file by its unique ID. Only users with write permissions have access to update this resource. + Parameters ---------- bucket_id : str @@ -413,6 +422,7 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Delete a file by its unique ID. Only users with write permissions have access to delete this resource. + Parameters ---------- bucket_id : str @@ -451,6 +461,7 @@ def get_file_download(self, bucket_id: str, file_id: str, token: str = None) -> """ Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + Parameters ---------- bucket_id : str @@ -491,6 +502,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he """ Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. + Parameters ---------- bucket_id : str @@ -564,6 +576,7 @@ def get_file_view(self, bucket_id: str, file_id: str, token: str = None) -> byte """ Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. + Parameters ---------- bucket_id : str diff --git a/appwrite/services/tables.py b/appwrite/services/tables.py new file mode 100644 index 0000000..f54cd5b --- /dev/null +++ b/appwrite/services/tables.py @@ -0,0 +1,2331 @@ +from ..service import Service +from typing import List, Dict, Any +from ..exception import AppwriteException +from ..enums.relationship_type import RelationshipType; +from ..enums.relation_mutate import RelationMutate; +from ..enums.index_type import IndexType; + +class Tables(Service): + + def __init__(self, client) -> None: + super(Tables, self).__init__(client) + + def list(self, database_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + """ + Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results. + + + Parameters + ---------- + database_id : str + Database ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, rowSecurity + search : str + Search term to filter your list results. Max length: 256 chars. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + api_path = api_path.replace('{databaseId}', database_id) + + api_params['queries'] = queries + api_params['search'] = search + + return self.client.call('get', api_path, { + }, api_params) + + def create(self, database_id: str, table_id: str, name: str, permissions: List[str] = None, row_security: bool = None, enabled: bool = None) -> Dict[str, Any]: + """ + Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Table name. Max length: 128 chars. + permissions : List[str] + An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + row_security : bool + Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). + enabled : bool + Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + api_path = api_path.replace('{databaseId}', database_id) + + api_params['tableId'] = table_id + api_params['name'] = name + api_params['permissions'] = permissions + api_params['rowSecurity'] = row_security + api_params['enabled'] = enabled + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get(self, database_id: str, table_id: str) -> Dict[str, Any]: + """ + Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + + return self.client.call('get', api_path, { + }, api_params) + + def update(self, database_id: str, table_id: str, name: str, permissions: List[str] = None, row_security: bool = None, enabled: bool = None) -> Dict[str, Any]: + """ + Update a table by its unique ID. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + name : str + Table name. Max length: 128 chars. + permissions : List[str] + An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + row_security : bool + Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + enabled : bool + Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if name is None: + raise AppwriteException('Missing required parameter: "name"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['name'] = name + api_params['permissions'] = permissions + api_params['rowSecurity'] = row_security + api_params['enabled'] = enabled + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete(self, database_id: str, table_id: str) -> Dict[str, Any]: + """ + Delete a table by its unique ID. Only users with write permissions have access to delete this resource. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_columns(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + List attributes in the collection. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + }, api_params) + + def create_boolean_column(self, database_id: str, table_id: str, key: str, required: bool, default: bool = None, array: bool = None) -> Dict[str, Any]: + """ + Create a boolean column. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + key : str + Column Key. + required : bool + Is column required? + default : bool + Default value for column when not provided. Cannot be set when column is required. + array : bool + Is column an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/boolean' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['required'] = required + api_params['default'] = default + api_params['array'] = array + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_boolean_column(self, database_id: str, table_id: str, key: str, required: bool, default: bool, new_key: str = None) -> Dict[str, Any]: + """ + Update a boolean column. Changing the `default` value will not update already existing rows. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + key : str + Column Key. + required : bool + Is column required? + default : bool + Default value for column when not provided. Cannot be set when column is required. + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/boolean/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['required'] = required + api_params['default'] = default + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_datetime_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create a date time column according to the ISO 8601 standard. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : str + Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. + array : bool + Is column an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/datetime' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['required'] = required + api_params['default'] = default + api_params['array'] = array + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_datetime_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update a date time column. Changing the `default` value will not update already existing rows. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/datetime/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['required'] = required + api_params['default'] = default + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_email_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create an email column. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + array : bool + Is column an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/email' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['required'] = required + api_params['default'] = default + api_params['array'] = array + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_email_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update an email column. Changing the `default` value will not update already existing rows. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/email/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['required'] = required + api_params['default'] = default + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_enum_column(self, database_id: str, table_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + elements : List[str] + Array of enum values. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + array : bool + Is column an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/enum' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if elements is None: + raise AppwriteException('Missing required parameter: "elements"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['elements'] = elements + api_params['required'] = required + api_params['default'] = default + api_params['array'] = array + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_enum_column(self, database_id: str, table_id: str, key: str, elements: List[str], required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update an enum column. Changing the `default` value will not update already existing rows. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + elements : List[str] + Updated list of enum values. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/enum/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if elements is None: + raise AppwriteException('Missing required parameter: "elements"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['elements'] = elements + api_params['required'] = required + api_params['default'] = default + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_float_column(self, database_id: str, table_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: + """ + Create a float column. Optionally, minimum and maximum values can be provided. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + min : float + Minimum value + max : float + Maximum value + default : float + Default value. Cannot be set when required. + array : bool + Is column an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/float' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['required'] = required + api_params['min'] = min + api_params['max'] = max + api_params['default'] = default + api_params['array'] = array + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_float_column(self, database_id: str, table_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: + """ + Update a float column. Changing the `default` value will not update already existing rows. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : float + Default value. Cannot be set when required. + min : float + Minimum value + max : float + Maximum value + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/float/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['required'] = required + api_params['min'] = min + api_params['max'] = max + api_params['default'] = default + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_integer_column(self, database_id: str, table_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: + """ + Create an integer column. Optionally, minimum and maximum values can be provided. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + min : float + Minimum value + max : float + Maximum value + default : float + Default value. Cannot be set when column is required. + array : bool + Is column an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/integer' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['required'] = required + api_params['min'] = min + api_params['max'] = max + api_params['default'] = default + api_params['array'] = array + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_integer_column(self, database_id: str, table_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: + """ + Update an integer column. Changing the `default` value will not update already existing rows. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : float + Default value. Cannot be set when column is required. + min : float + Minimum value + max : float + Maximum value + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/integer/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['required'] = required + api_params['min'] = min + api_params['max'] = max + api_params['default'] = default + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_ip_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create IP address column. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : str + Default value. Cannot be set when column is required. + array : bool + Is column an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/ip' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['required'] = required + api_params['default'] = default + api_params['array'] = array + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_ip_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update an ip column. Changing the `default` value will not update already existing rows. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : str + Default value. Cannot be set when column is required. + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/ip/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['required'] = required + api_params['default'] = default + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_relationship_column(self, database_id: str, table_id: str, related_table_id: str, type: RelationshipType, two_way: bool = None, key: str = None, two_way_key: str = None, on_delete: RelationMutate = None) -> Dict[str, Any]: + """ + Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + related_table_id : str + Related Table ID. + type : RelationshipType + Relation type + two_way : bool + Is Two Way? + key : str + Column Key. + two_way_key : str + Two Way Column Key. + on_delete : RelationMutate + Constraints option + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/relationship' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if related_table_id is None: + raise AppwriteException('Missing required parameter: "related_table_id"') + + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['relatedTableId'] = related_table_id + api_params['type'] = type + api_params['twoWay'] = two_way + api_params['key'] = key + api_params['twoWayKey'] = two_way_key + api_params['onDelete'] = on_delete + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_string_column(self, database_id: str, table_id: str, key: str, size: float, required: bool, default: str = None, array: bool = None, encrypt: bool = None) -> Dict[str, Any]: + """ + Create a string column. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + key : str + Column Key. + size : float + Attribute size for text attributes, in number of characters. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + array : bool + Is column an array? + encrypt : bool + Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/string' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if size is None: + raise AppwriteException('Missing required parameter: "size"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['size'] = size + api_params['required'] = required + api_params['default'] = default + api_params['array'] = array + api_params['encrypt'] = encrypt + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_string_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, size: float = None, new_key: str = None) -> Dict[str, Any]: + """ + Update a string column. Changing the `default` value will not update already existing rows. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + key : str + Column Key. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + size : float + Maximum size of the string column. + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/string/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['required'] = required + api_params['default'] = default + api_params['size'] = size + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_url_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + """ + Create a URL column. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + array : bool + Is column an array? + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/url' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['required'] = required + api_params['default'] = default + api_params['array'] = array + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_url_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + """ + Update an url column. Changing the `default` value will not update already existing rows. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + required : bool + Is column required? + default : str + Default value for column when not provided. Cannot be set when column is required. + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/url/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if required is None: + raise AppwriteException('Missing required parameter: "required"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['required'] = required + api_params['default'] = default + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_column(self, database_id: str, table_id: str, key: str) -> Dict[str, Any]: + """ + Get column by ID. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + + return self.client.call('get', api_path, { + }, api_params) + + def delete_column(self, database_id: str, table_id: str, key: str) -> Dict[str, Any]: + """ + Deletes a column. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_relationship_column(self, database_id: str, table_id: str, key: str, on_delete: RelationMutate = None, new_key: str = None) -> Dict[str, Any]: + """ + Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + key : str + Column Key. + on_delete : RelationMutate + Constraints option + new_key : str + New Column Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/columns/{key}/relationship' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + api_params['onDelete'] = on_delete + api_params['newKey'] = new_key + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_indexes(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + List indexes in the collection. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/indexes' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + }, api_params) + + def create_index(self, database_id: str, table_id: str, key: str, type: IndexType, columns: List[str], orders: List[str] = None, lengths: List[float] = None) -> Dict[str, Any]: + """ + Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. + Attributes can be `key`, `fulltext`, and `unique`. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + key : str + Index Key. + type : IndexType + Index type. + columns : List[str] + Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. + orders : List[str] + Array of index orders. Maximum of 100 orders are allowed. + lengths : List[float] + Length of index. Maximum of 100 + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/indexes' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + if type is None: + raise AppwriteException('Missing required parameter: "type"') + + if columns is None: + raise AppwriteException('Missing required parameter: "columns"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['key'] = key + api_params['type'] = type + api_params['columns'] = columns + api_params['orders'] = orders + api_params['lengths'] = lengths + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_index(self, database_id: str, table_id: str, key: str) -> Dict[str, Any]: + """ + Get index by ID. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + key : str + Index Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/indexes/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + + return self.client.call('get', api_path, { + }, api_params) + + def delete_index(self, database_id: str, table_id: str, key: str) -> Dict[str, Any]: + """ + Delete an index. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + key : str + Index Key. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/indexes/{key}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if key is None: + raise AppwriteException('Missing required parameter: "key"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{key}', key) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def list_rows(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get a list of all the user's rows in a given table. You can use the query params to filter your results. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + }, api_params) + + def create_row(self, database_id: str, table_id: str, row_id: str, data: dict, permissions: List[str] = None) -> Dict[str, Any]: + """ + Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). Make sure to define columns before creating rows. + row_id : str + Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + data : dict + Row data as JSON object. + permissions : List[str] + An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if row_id is None: + raise AppwriteException('Missing required parameter: "row_id"') + + if data is None: + raise AppwriteException('Missing required parameter: "data"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['rowId'] = row_id + api_params['data'] = data + api_params['permissions'] = permissions + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def create_rows(self, database_id: str, table_id: str, rows: List[dict]) -> Dict[str, Any]: + """ + Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). Make sure to define columns before creating rows. + rows : List[dict] + Array of documents data as JSON objects. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if rows is None: + raise AppwriteException('Missing required parameter: "rows"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['rows'] = rows + + return self.client.call('post', api_path, { + 'content-type': 'application/json', + }, api_params) + + def upsert_rows(self, database_id: str, table_id: str) -> Dict[str, Any]: + """ + Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. + + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_rows(self, database_id: str, table_id: str, data: dict = None, queries: List[str] = None) -> Dict[str, Any]: + """ + Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + data : dict + Row data as JSON object. Include only column and value pairs to be updated. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['data'] = data + api_params['queries'] = queries + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_rows(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Bulk delete rows using queries, if no queries are passed then all rows are deleted. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + + api_params['queries'] = queries + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def get_row(self, database_id: str, table_id: str, row_id: str, queries: List[str] = None) -> Dict[str, Any]: + """ + Get a row by its unique ID. This endpoint response returns a JSON object with the row data. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + row_id : str + Row ID. + queries : List[str] + Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if row_id is None: + raise AppwriteException('Missing required parameter: "row_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{rowId}', row_id) + + api_params['queries'] = queries + + return self.client.call('get', api_path, { + }, api_params) + + def upsert_row(self, database_id: str, table_id: str, row_id: str) -> Dict[str, Any]: + """ + Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + row_id : str + Row ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if row_id is None: + raise AppwriteException('Missing required parameter: "row_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{rowId}', row_id) + + + return self.client.call('put', api_path, { + 'content-type': 'application/json', + }, api_params) + + def update_row(self, database_id: str, table_id: str, row_id: str, data: dict = None, permissions: List[str] = None) -> Dict[str, Any]: + """ + Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + row_id : str + Row ID. + data : dict + Row data as JSON object. Include only columns and value pairs to be updated. + permissions : List[str] + An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if row_id is None: + raise AppwriteException('Missing required parameter: "row_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{rowId}', row_id) + + api_params['data'] = data + api_params['permissions'] = permissions + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def delete_row(self, database_id: str, table_id: str, row_id: str) -> Dict[str, Any]: + """ + Delete a row by its unique ID. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). + row_id : str + Row ID. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if row_id is None: + raise AppwriteException('Missing required parameter: "row_id"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{rowId}', row_id) + + + return self.client.call('delete', api_path, { + 'content-type': 'application/json', + }, api_params) + + def decrement_row_column(self, database_id: str, table_id: str, row_id: str, column: str, value: float = None, min: float = None) -> Dict[str, Any]: + """ + Decrement a specific column of a row by a given value. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + row_id : str + Row ID. + column : str + Column key. + value : float + Value to increment the column by. The value must be a number. + min : float + Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if row_id is None: + raise AppwriteException('Missing required parameter: "row_id"') + + if column is None: + raise AppwriteException('Missing required parameter: "column"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{rowId}', row_id) + api_path = api_path.replace('{column}', column) + + api_params['value'] = value + api_params['min'] = min + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) + + def increment_row_column(self, database_id: str, table_id: str, row_id: str, column: str, value: float = None, max: float = None) -> Dict[str, Any]: + """ + Increment a specific column of a row by a given value. + + + Parameters + ---------- + database_id : str + Database ID. + table_id : str + Table ID. + row_id : str + Row ID. + column : str + Column key. + value : float + Value to increment the column by. The value must be a number. + max : float + Maximum value for the column. If the current value is greater than this value, an error will be thrown. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment' + api_params = {} + if database_id is None: + raise AppwriteException('Missing required parameter: "database_id"') + + if table_id is None: + raise AppwriteException('Missing required parameter: "table_id"') + + if row_id is None: + raise AppwriteException('Missing required parameter: "row_id"') + + if column is None: + raise AppwriteException('Missing required parameter: "column"') + + api_path = api_path.replace('{databaseId}', database_id) + api_path = api_path.replace('{tableId}', table_id) + api_path = api_path.replace('{rowId}', row_id) + api_path = api_path.replace('{column}', column) + + api_params['value'] = value + api_params['max'] = max + + return self.client.call('patch', api_path, { + 'content-type': 'application/json', + }, api_params) diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 808dc2a..50e0297 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -11,6 +11,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. + Parameters ---------- queries : List[str] @@ -42,6 +43,7 @@ def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, """ Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. + Parameters ---------- team_id : str @@ -83,6 +85,7 @@ def get(self, team_id: str) -> Dict[str, Any]: """ Get a team by its ID. All team members have read access for this resource. + Parameters ---------- team_id : str @@ -114,6 +117,7 @@ def update_name(self, team_id: str, name: str) -> Dict[str, Any]: """ Update the team's name by its unique ID. + Parameters ---------- team_id : str @@ -152,6 +156,7 @@ def delete(self, team_id: str) -> Dict[str, Any]: """ Delete a team using its ID. Only team members with the owner role can delete the team. + Parameters ---------- team_id : str @@ -184,6 +189,7 @@ def list_memberships(self, team_id: str, queries: List[str] = None, search: str """ Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. + Parameters ---------- team_id : str @@ -228,6 +234,7 @@ def create_membership(self, team_id: str, roles: List[str], email: str = None, u Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. + Parameters ---------- team_id : str @@ -281,6 +288,7 @@ def get_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: """ Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. + Parameters ---------- team_id : str @@ -319,6 +327,7 @@ def update_membership(self, team_id: str, membership_id: str, roles: List[str]) Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). + Parameters ---------- team_id : str @@ -363,6 +372,7 @@ def delete_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: """ This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted. + Parameters ---------- team_id : str @@ -404,6 +414,7 @@ def update_membership_status(self, team_id: str, membership_id: str, user_id: st If the request is successful, a session for the user is automatically created. + Parameters ---------- team_id : str @@ -454,6 +465,7 @@ def get_prefs(self, team_id: str) -> Dict[str, Any]: """ Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). + Parameters ---------- team_id : str @@ -485,6 +497,7 @@ def update_prefs(self, team_id: str, prefs: dict) -> Dict[str, Any]: """ Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. + Parameters ---------- team_id : str diff --git a/appwrite/services/tokens.py b/appwrite/services/tokens.py index 7ec7f4f..93ba739 100644 --- a/appwrite/services/tokens.py +++ b/appwrite/services/tokens.py @@ -11,6 +11,7 @@ def list(self, bucket_id: str, file_id: str, queries: List[str] = None) -> Dict[ """ List all the tokens created for a specific file or bucket. You can use the query params to filter your results. + Parameters ---------- bucket_id : str @@ -51,6 +52,7 @@ def create_file_token(self, bucket_id: str, file_id: str, expire: str = None) -> """ Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. + Parameters ---------- bucket_id : str @@ -92,6 +94,7 @@ def get(self, token_id: str) -> Dict[str, Any]: """ Get a token by its unique ID. + Parameters ---------- token_id : str @@ -123,6 +126,7 @@ def update(self, token_id: str, expire: str = None) -> Dict[str, Any]: """ Update a token by its unique ID. Use this endpoint to update a token's expiry date. + Parameters ---------- token_id : str @@ -158,6 +162,7 @@ def delete(self, token_id: str) -> Dict[str, Any]: """ Delete a token by its unique ID. + Parameters ---------- token_id : str diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 694657f..1af4e41 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -14,6 +14,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's users. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -45,6 +46,7 @@ def create(self, user_id: str, email: str = None, phone: str = None, password: s """ Create a new user. + Parameters ---------- user_id : str @@ -89,6 +91,7 @@ def create_argon2_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -136,6 +139,7 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -183,6 +187,7 @@ def list_identities(self, queries: List[str] = None, search: str = None) -> Dict """ Get identities for all users. + Parameters ---------- queries : List[str] @@ -214,6 +219,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: """ Delete an identity by its unique ID. + Parameters ---------- identity_id : str @@ -246,6 +252,7 @@ def create_md5_user(self, user_id: str, email: str, password: str, name: str = N """ Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -293,6 +300,7 @@ def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -340,6 +348,7 @@ def create_scrypt_user(self, user_id: str, email: str, password: str, password_s """ Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -417,6 +426,7 @@ def create_scrypt_modified_user(self, user_id: str, email: str, password: str, p """ Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -482,6 +492,7 @@ def create_sha_user(self, user_id: str, email: str, password: str, password_vers """ Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -532,6 +543,7 @@ def get(self, user_id: str) -> Dict[str, Any]: """ Get a user by its unique ID. + Parameters ---------- user_id : str @@ -563,6 +575,7 @@ def delete(self, user_id: str) -> Dict[str, Any]: """ Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. + Parameters ---------- user_id : str @@ -595,6 +608,7 @@ def update_email(self, user_id: str, email: str) -> Dict[str, Any]: """ Update the user email by its unique ID. + Parameters ---------- user_id : str @@ -633,6 +647,7 @@ def create_jwt(self, user_id: str, session_id: str = None, duration: float = Non """ Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. + Parameters ---------- user_id : str @@ -673,6 +688,7 @@ def update_labels(self, user_id: str, labels: List[str]) -> Dict[str, Any]: Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. + Parameters ---------- user_id : str @@ -711,6 +727,7 @@ def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get the user activity logs list by its unique ID. + Parameters ---------- user_id : str @@ -745,6 +762,7 @@ def list_memberships(self, user_id: str, queries: List[str] = None, search: str """ Get the user membership list by its unique ID. + Parameters ---------- user_id : str @@ -782,6 +800,7 @@ def update_mfa(self, user_id: str, mfa: bool) -> Dict[str, Any]: """ Enable or disable MFA on a user account. + Parameters ---------- user_id : str @@ -820,6 +839,7 @@ def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType) -> Dic """ Delete an authenticator app. + Parameters ---------- user_id : str @@ -858,6 +878,7 @@ def list_mfa_factors(self, user_id: str) -> Dict[str, Any]: """ List the factors available on the account to be used as a MFA challange. + Parameters ---------- user_id : str @@ -889,6 +910,7 @@ def get_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. + Parameters ---------- user_id : str @@ -920,6 +942,7 @@ def update_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. + Parameters ---------- user_id : str @@ -952,6 +975,7 @@ def create_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. + Parameters ---------- user_id : str @@ -984,6 +1008,7 @@ def update_name(self, user_id: str, name: str) -> Dict[str, Any]: """ Update the user name by its unique ID. + Parameters ---------- user_id : str @@ -1022,6 +1047,7 @@ def update_password(self, user_id: str, password: str) -> Dict[str, Any]: """ Update the user password by its unique ID. + Parameters ---------- user_id : str @@ -1060,6 +1086,7 @@ def update_phone(self, user_id: str, number: str) -> Dict[str, Any]: """ Update the user phone by its unique ID. + Parameters ---------- user_id : str @@ -1098,6 +1125,7 @@ def get_prefs(self, user_id: str) -> Dict[str, Any]: """ Get the user preferences by its unique ID. + Parameters ---------- user_id : str @@ -1129,6 +1157,7 @@ def update_prefs(self, user_id: str, prefs: dict) -> Dict[str, Any]: """ Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. + Parameters ---------- user_id : str @@ -1167,6 +1196,7 @@ def list_sessions(self, user_id: str) -> Dict[str, Any]: """ Get the user sessions list by its unique ID. + Parameters ---------- user_id : str @@ -1200,6 +1230,7 @@ def create_session(self, user_id: str) -> Dict[str, Any]: If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint. + Parameters ---------- user_id : str @@ -1232,6 +1263,7 @@ def delete_sessions(self, user_id: str) -> Dict[str, Any]: """ Delete all user's sessions by using the user's unique ID. + Parameters ---------- user_id : str @@ -1264,6 +1296,7 @@ def delete_session(self, user_id: str, session_id: str) -> Dict[str, Any]: """ Delete a user sessions by its unique ID. + Parameters ---------- user_id : str @@ -1302,6 +1335,7 @@ def update_status(self, user_id: str, status: bool) -> Dict[str, Any]: """ Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. + Parameters ---------- user_id : str @@ -1340,6 +1374,7 @@ def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any """ List the messaging targets that are associated with a user. + Parameters ---------- user_id : str @@ -1374,6 +1409,7 @@ def create_target(self, user_id: str, target_id: str, provider_type: MessagingPr """ Create a messaging target. + Parameters ---------- user_id : str @@ -1430,6 +1466,7 @@ def get_target(self, user_id: str, target_id: str) -> Dict[str, Any]: """ Get a user's push notification target by ID. + Parameters ---------- user_id : str @@ -1467,6 +1504,7 @@ def update_target(self, user_id: str, target_id: str, identifier: str = None, pr """ Update a messaging target. + Parameters ---------- user_id : str @@ -1514,6 +1552,7 @@ def delete_target(self, user_id: str, target_id: str) -> Dict[str, Any]: """ Delete a messaging target. + Parameters ---------- user_id : str @@ -1553,6 +1592,7 @@ def create_token(self, user_id: str, length: float = None, expire: float = None) Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. + Parameters ---------- user_id : str @@ -1591,6 +1631,7 @@ def update_email_verification(self, user_id: str, email_verification: bool) -> D """ Update the user email verification status by its unique ID. + Parameters ---------- user_id : str @@ -1629,6 +1670,7 @@ def update_phone_verification(self, user_id: str, phone_verification: bool) -> D """ Update the user phone verification status by its unique ID. + Parameters ---------- user_id : str diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 3d6cba1..1a8500b 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -3,7 +3,6 @@ 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_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 diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index 7c6ef24..27ad6e8 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -3,6 +3,7 @@ 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) diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index c491ea4..8711e44 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -3,15 +3,14 @@ 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 +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>', - data = {}, - permissions = ["read("any")"] # optional + document_id = '<DOCUMENT_ID>' ) diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 5136d5f..79888c8 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -3,13 +3,12 @@ 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_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>', - documents = [] + collection_id = '<COLLECTION_ID>' ) diff --git a/docs/examples/tables/create-boolean-column.md b/docs/examples/tables/create-boolean-column.md new file mode 100644 index 0000000..cfbaa3b --- /dev/null +++ b/docs/examples/tables/create-boolean-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_boolean_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = False, # optional + array = False # optional +) diff --git a/docs/examples/tables/create-datetime-column.md b/docs/examples/tables/create-datetime-column.md new file mode 100644 index 0000000..a9f76b5 --- /dev/null +++ b/docs/examples/tables/create-datetime-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_datetime_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '', # optional + array = False # optional +) diff --git a/docs/examples/tables/create-email-column.md b/docs/examples/tables/create-email-column.md new file mode 100644 index 0000000..73ac0fa --- /dev/null +++ b/docs/examples/tables/create-email-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_email_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = 'email@example.com', # optional + array = False # optional +) diff --git a/docs/examples/tables/create-enum-column.md b/docs/examples/tables/create-enum-column.md new file mode 100644 index 0000000..2013c39 --- /dev/null +++ b/docs/examples/tables/create-enum-column.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_enum_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + elements = [], + required = False, + default = '<DEFAULT>', # optional + array = False # optional +) diff --git a/docs/examples/tables/create-float-column.md b/docs/examples/tables/create-float-column.md new file mode 100644 index 0000000..a56a196 --- /dev/null +++ b/docs/examples/tables/create-float-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_float_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + min = None, # optional + max = None, # optional + default = None, # optional + array = False # optional +) diff --git a/docs/examples/tables/create-index.md b/docs/examples/tables/create-index.md new file mode 100644 index 0000000..69086af --- /dev/null +++ b/docs/examples/tables/create-index.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables +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 + +tables = Tables(client) + +result = tables.create_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + type = IndexType.KEY, + columns = [], + orders = [], # optional + lengths = [] # optional +) diff --git a/docs/examples/tables/create-integer-column.md b/docs/examples/tables/create-integer-column.md new file mode 100644 index 0000000..d52b14b --- /dev/null +++ b/docs/examples/tables/create-integer-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_integer_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + min = None, # optional + max = None, # optional + default = None, # optional + array = False # optional +) diff --git a/docs/examples/tables/create-ip-column.md b/docs/examples/tables/create-ip-column.md new file mode 100644 index 0000000..b5c7ef5 --- /dev/null +++ b/docs/examples/tables/create-ip-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_ip_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '', # optional + array = False # optional +) diff --git a/docs/examples/tables/create-relationship-column.md b/docs/examples/tables/create-relationship-column.md new file mode 100644 index 0000000..187271f --- /dev/null +++ b/docs/examples/tables/create-relationship-column.md @@ -0,0 +1,21 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables +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 + +tables = Tables(client) + +result = tables.create_relationship_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + related_table_id = '<RELATED_TABLE_ID>', + type = RelationshipType.ONETOONE, + two_way = False, # optional + key = '', # optional + two_way_key = '', # optional + on_delete = RelationMutate.CASCADE # optional +) diff --git a/docs/examples/tables/create-row.md b/docs/examples/tables/create-row.md new file mode 100644 index 0000000..8850a97 --- /dev/null +++ b/docs/examples/tables/create-row.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +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 + +tables = Tables(client) + +result = tables.create_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + data = {}, + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/tables/create-rows.md b/docs/examples/tables/create-rows.md new file mode 100644 index 0000000..3fae165 --- /dev/null +++ b/docs/examples/tables/create-rows.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +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 + +tables = Tables(client) + +result = tables.create_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + rows = [] +) diff --git a/docs/examples/tables/create-string-column.md b/docs/examples/tables/create-string-column.md new file mode 100644 index 0000000..1308fea --- /dev/null +++ b/docs/examples/tables/create-string-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_string_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + size = 1, + required = False, + default = '<DEFAULT>', # optional + array = False, # optional + encrypt = False # optional +) diff --git a/docs/examples/tables/create-url-column.md b/docs/examples/tables/create-url-column.md new file mode 100644 index 0000000..f15c3e0 --- /dev/null +++ b/docs/examples/tables/create-url-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create_url_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = 'https://example.com', # optional + array = False # optional +) diff --git a/docs/examples/tables/create.md b/docs/examples/tables/create.md new file mode 100644 index 0000000..3a02843 --- /dev/null +++ b/docs/examples/tables/create.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.create( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + name = '<NAME>', + permissions = ["read("any")"], # optional + row_security = False, # optional + enabled = False # optional +) diff --git a/docs/examples/tables/decrement-row-column.md b/docs/examples/tables/decrement-row-column.md new file mode 100644 index 0000000..bf027d6 --- /dev/null +++ b/docs/examples/tables/decrement-row-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.decrement_row_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + column = '', + value = None, # optional + min = None # optional +) diff --git a/docs/examples/tables/delete-column.md b/docs/examples/tables/delete-column.md new file mode 100644 index 0000000..cf2dd6d --- /dev/null +++ b/docs/examples/tables/delete-column.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.delete_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '' +) diff --git a/docs/examples/tables/delete-index.md b/docs/examples/tables/delete-index.md new file mode 100644 index 0000000..5f78d1c --- /dev/null +++ b/docs/examples/tables/delete-index.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.delete_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '' +) diff --git a/docs/examples/tables/delete-row.md b/docs/examples/tables/delete-row.md new file mode 100644 index 0000000..40a8b09 --- /dev/null +++ b/docs/examples/tables/delete-row.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +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 + +tables = Tables(client) + +result = tables.delete_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>' +) diff --git a/docs/examples/tables/delete-rows.md b/docs/examples/tables/delete-rows.md new file mode 100644 index 0000000..236aea1 --- /dev/null +++ b/docs/examples/tables/delete-rows.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.delete_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [] # optional +) diff --git a/docs/examples/tables/delete.md b/docs/examples/tables/delete.md new file mode 100644 index 0000000..de48bfc --- /dev/null +++ b/docs/examples/tables/delete.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.delete( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>' +) diff --git a/docs/examples/tables/get-column.md b/docs/examples/tables/get-column.md new file mode 100644 index 0000000..4bd4617 --- /dev/null +++ b/docs/examples/tables/get-column.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.get_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '' +) diff --git a/docs/examples/tables/get-index.md b/docs/examples/tables/get-index.md new file mode 100644 index 0000000..cf88017 --- /dev/null +++ b/docs/examples/tables/get-index.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.get_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '' +) diff --git a/docs/examples/tables/get-row.md b/docs/examples/tables/get-row.md new file mode 100644 index 0000000..25fefb2 --- /dev/null +++ b/docs/examples/tables/get-row.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +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 + +tables = Tables(client) + +result = tables.get_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + queries = [] # optional +) diff --git a/docs/examples/tables/get.md b/docs/examples/tables/get.md new file mode 100644 index 0000000..789410c --- /dev/null +++ b/docs/examples/tables/get.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.get( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>' +) diff --git a/docs/examples/tables/increment-row-column.md b/docs/examples/tables/increment-row-column.md new file mode 100644 index 0000000..cfb9230 --- /dev/null +++ b/docs/examples/tables/increment-row-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.increment_row_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + column = '', + value = None, # optional + max = None # optional +) diff --git a/docs/examples/tables/list-columns.md b/docs/examples/tables/list-columns.md new file mode 100644 index 0000000..d9c5b16 --- /dev/null +++ b/docs/examples/tables/list-columns.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.list_columns( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [] # optional +) diff --git a/docs/examples/tables/list-indexes.md b/docs/examples/tables/list-indexes.md new file mode 100644 index 0000000..0b0bb58 --- /dev/null +++ b/docs/examples/tables/list-indexes.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.list_indexes( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [] # optional +) diff --git a/docs/examples/tables/list-rows.md b/docs/examples/tables/list-rows.md new file mode 100644 index 0000000..2ece6f6 --- /dev/null +++ b/docs/examples/tables/list-rows.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +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 + +tables = Tables(client) + +result = tables.list_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [] # optional +) diff --git a/docs/examples/tables/list.md b/docs/examples/tables/list.md new file mode 100644 index 0000000..55a99e9 --- /dev/null +++ b/docs/examples/tables/list.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.list( + database_id = '<DATABASE_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/tables/update-boolean-column.md b/docs/examples/tables/update-boolean-column.md new file mode 100644 index 0000000..1bc7a4a --- /dev/null +++ b/docs/examples/tables/update-boolean-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_boolean_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = False, + new_key = '' # optional +) diff --git a/docs/examples/tables/update-datetime-column.md b/docs/examples/tables/update-datetime-column.md new file mode 100644 index 0000000..157ff44 --- /dev/null +++ b/docs/examples/tables/update-datetime-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_datetime_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '', + new_key = '' # optional +) diff --git a/docs/examples/tables/update-email-column.md b/docs/examples/tables/update-email-column.md new file mode 100644 index 0000000..8b9e4ca --- /dev/null +++ b/docs/examples/tables/update-email-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_email_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = 'email@example.com', + new_key = '' # optional +) diff --git a/docs/examples/tables/update-enum-column.md b/docs/examples/tables/update-enum-column.md new file mode 100644 index 0000000..b46971b --- /dev/null +++ b/docs/examples/tables/update-enum-column.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_enum_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + elements = [], + required = False, + default = '<DEFAULT>', + new_key = '' # optional +) diff --git a/docs/examples/tables/update-float-column.md b/docs/examples/tables/update-float-column.md new file mode 100644 index 0000000..243a26f --- /dev/null +++ b/docs/examples/tables/update-float-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_float_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = None, + min = None, # optional + max = None, # optional + new_key = '' # optional +) diff --git a/docs/examples/tables/update-integer-column.md b/docs/examples/tables/update-integer-column.md new file mode 100644 index 0000000..99b55c1 --- /dev/null +++ b/docs/examples/tables/update-integer-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_integer_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = None, + min = None, # optional + max = None, # optional + new_key = '' # optional +) diff --git a/docs/examples/tables/update-ip-column.md b/docs/examples/tables/update-ip-column.md new file mode 100644 index 0000000..2fb470a --- /dev/null +++ b/docs/examples/tables/update-ip-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_ip_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '', + new_key = '' # optional +) diff --git a/docs/examples/tables/update-relationship-column.md b/docs/examples/tables/update-relationship-column.md new file mode 100644 index 0000000..35a307c --- /dev/null +++ b/docs/examples/tables/update-relationship-column.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_relationship_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + on_delete = RelationMutate.CASCADE, # optional + new_key = '' # optional +) diff --git a/docs/examples/tables/update-row.md b/docs/examples/tables/update-row.md new file mode 100644 index 0000000..4a71fc9 --- /dev/null +++ b/docs/examples/tables/update-row.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +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 + +tables = Tables(client) + +result = tables.update_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + data = {}, # optional + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/tables/update-rows.md b/docs/examples/tables/update-rows.md new file mode 100644 index 0000000..a834346 --- /dev/null +++ b/docs/examples/tables/update-rows.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + data = {}, # optional + queries = [] # optional +) diff --git a/docs/examples/tables/update-string-column.md b/docs/examples/tables/update-string-column.md new file mode 100644 index 0000000..252c264 --- /dev/null +++ b/docs/examples/tables/update-string-column.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_string_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '<DEFAULT>', + size = 1, # optional + new_key = '' # optional +) diff --git a/docs/examples/tables/update-url-column.md b/docs/examples/tables/update-url-column.md new file mode 100644 index 0000000..235e2f3 --- /dev/null +++ b/docs/examples/tables/update-url-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update_url_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = 'https://example.com', + new_key = '' # optional +) diff --git a/docs/examples/tables/update.md b/docs/examples/tables/update.md new file mode 100644 index 0000000..c567bd5 --- /dev/null +++ b/docs/examples/tables/update.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables = Tables(client) + +result = tables.update( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + name = '<NAME>', + permissions = ["read("any")"], # optional + row_security = False, # optional + enabled = False # optional +) diff --git a/docs/examples/tables/upsert-row.md b/docs/examples/tables/upsert-row.md new file mode 100644 index 0000000..e418708 --- /dev/null +++ b/docs/examples/tables/upsert-row.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +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 + +tables = Tables(client) + +result = tables.upsert_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>' +) diff --git a/docs/examples/tables/upsert-rows.md b/docs/examples/tables/upsert-rows.md new file mode 100644 index 0000000..85c2e94 --- /dev/null +++ b/docs/examples/tables/upsert-rows.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.tables import Tables + +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 + +tables = Tables(client) + +result = tables.upsert_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>' +) diff --git a/setup.py b/setup.py index 18c78cc..f0bb253 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '11.1.0', + version = '12.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/11.1.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/12.0.0.tar.gz', install_requires=[ 'requests', ], From 8344f2d14ec919a4b40eb9d445c6e13ba992e16c Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Thu, 24 Jul 2025 06:43:18 +0000 Subject: [PATCH 57/60] chore: regen to 1.7.x --- README.md | 4 +- appwrite/client.py | 6 +- appwrite/services/account.py | 4 - appwrite/services/databases.py | 207 +- appwrite/services/tables.py | 2331 ----------------- docs/examples/databases/create-document.md | 3 +- docs/examples/databases/create-documents.md | 2 +- docs/examples/databases/upsert-document.md | 7 +- docs/examples/databases/upsert-documents.md | 5 +- docs/examples/tables/create-boolean-column.md | 18 - .../examples/tables/create-datetime-column.md | 18 - docs/examples/tables/create-email-column.md | 18 - docs/examples/tables/create-enum-column.md | 19 - docs/examples/tables/create-float-column.md | 20 - docs/examples/tables/create-index.md | 20 - docs/examples/tables/create-integer-column.md | 20 - docs/examples/tables/create-ip-column.md | 18 - .../tables/create-relationship-column.md | 21 - docs/examples/tables/create-row.md | 18 - docs/examples/tables/create-rows.md | 15 - docs/examples/tables/create-string-column.md | 20 - docs/examples/tables/create-url-column.md | 18 - docs/examples/tables/create.md | 18 - docs/examples/tables/decrement-row-column.md | 18 - docs/examples/tables/delete-column.md | 15 - docs/examples/tables/delete-index.md | 15 - docs/examples/tables/delete-row.md | 15 - docs/examples/tables/delete-rows.md | 15 - docs/examples/tables/delete.md | 14 - docs/examples/tables/get-column.md | 15 - docs/examples/tables/get-index.md | 15 - docs/examples/tables/get-row.md | 16 - docs/examples/tables/get.md | 14 - docs/examples/tables/increment-row-column.md | 18 - docs/examples/tables/list-columns.md | 15 - docs/examples/tables/list-indexes.md | 15 - docs/examples/tables/list-rows.md | 15 - docs/examples/tables/list.md | 15 - docs/examples/tables/update-boolean-column.md | 18 - .../examples/tables/update-datetime-column.md | 18 - docs/examples/tables/update-email-column.md | 18 - docs/examples/tables/update-enum-column.md | 19 - docs/examples/tables/update-float-column.md | 20 - docs/examples/tables/update-integer-column.md | 20 - docs/examples/tables/update-ip-column.md | 18 - .../tables/update-relationship-column.md | 17 - docs/examples/tables/update-row.md | 17 - docs/examples/tables/update-rows.md | 16 - docs/examples/tables/update-string-column.md | 19 - docs/examples/tables/update-url-column.md | 18 - docs/examples/tables/update.md | 18 - docs/examples/tables/upsert-row.md | 16 - docs/examples/tables/upsert-rows.md | 14 - setup.py | 4 +- 54 files changed, 83 insertions(+), 3247 deletions(-) delete mode 100644 appwrite/services/tables.py delete mode 100644 docs/examples/tables/create-boolean-column.md delete mode 100644 docs/examples/tables/create-datetime-column.md delete mode 100644 docs/examples/tables/create-email-column.md delete mode 100644 docs/examples/tables/create-enum-column.md delete mode 100644 docs/examples/tables/create-float-column.md delete mode 100644 docs/examples/tables/create-index.md delete mode 100644 docs/examples/tables/create-integer-column.md delete mode 100644 docs/examples/tables/create-ip-column.md delete mode 100644 docs/examples/tables/create-relationship-column.md delete mode 100644 docs/examples/tables/create-row.md delete mode 100644 docs/examples/tables/create-rows.md delete mode 100644 docs/examples/tables/create-string-column.md delete mode 100644 docs/examples/tables/create-url-column.md delete mode 100644 docs/examples/tables/create.md delete mode 100644 docs/examples/tables/decrement-row-column.md delete mode 100644 docs/examples/tables/delete-column.md delete mode 100644 docs/examples/tables/delete-index.md delete mode 100644 docs/examples/tables/delete-row.md delete mode 100644 docs/examples/tables/delete-rows.md delete mode 100644 docs/examples/tables/delete.md delete mode 100644 docs/examples/tables/get-column.md delete mode 100644 docs/examples/tables/get-index.md delete mode 100644 docs/examples/tables/get-row.md delete mode 100644 docs/examples/tables/get.md delete mode 100644 docs/examples/tables/increment-row-column.md delete mode 100644 docs/examples/tables/list-columns.md delete mode 100644 docs/examples/tables/list-indexes.md delete mode 100644 docs/examples/tables/list-rows.md delete mode 100644 docs/examples/tables/list.md delete mode 100644 docs/examples/tables/update-boolean-column.md delete mode 100644 docs/examples/tables/update-datetime-column.md delete mode 100644 docs/examples/tables/update-email-column.md delete mode 100644 docs/examples/tables/update-enum-column.md delete mode 100644 docs/examples/tables/update-float-column.md delete mode 100644 docs/examples/tables/update-integer-column.md delete mode 100644 docs/examples/tables/update-ip-column.md delete mode 100644 docs/examples/tables/update-relationship-column.md delete mode 100644 docs/examples/tables/update-row.md delete mode 100644 docs/examples/tables/update-rows.md delete mode 100644 docs/examples/tables/update-string-column.md delete mode 100644 docs/examples/tables/update-url-column.md delete mode 100644 docs/examples/tables/update.md delete mode 100644 docs/examples/tables/upsert-row.md delete mode 100644 docs/examples/tables/upsert-rows.md diff --git a/README.md b/README.md index a2dea19..a68a5ae 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** +**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite/client.py b/appwrite/client.py index 93897d8..b7ab483 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,12 +14,12 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/12.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/11.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '12.0.0', - 'X-Appwrite-Response-Format' : '1.8.0', + 'x-sdk-version': '11.0.0', + 'X-Appwrite-Response-Format' : '1.7.0', } def set_self_signed(self, status=True): diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 8b67abe..6062ad4 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -887,8 +887,6 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. - .. deprecated:: - This API has been deprecated. Parameters ---------- @@ -928,8 +926,6 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. - .. deprecated:: - This API has been deprecated. Parameters ---------- diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 20ddd16..40b7372 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -196,8 +196,6 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: """ Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.list` instead. Parameters ---------- @@ -236,8 +234,6 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per """ Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create` instead. Parameters ---------- @@ -292,8 +288,6 @@ def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any] """ Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.get` instead. Parameters ---------- @@ -332,8 +326,6 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per """ Update a collection by its unique ID. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update` instead. Parameters ---------- @@ -388,8 +380,6 @@ def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, A """ Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.delete` instead. Parameters ---------- @@ -429,15 +419,13 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st """ List attributes in the collection. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.list_columns` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). queries : List[str] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error @@ -473,15 +461,13 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st Create a boolean attribute. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_boolean_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -532,15 +518,13 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st """ Update a boolean attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_boolean_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -591,15 +575,13 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s """ Create a date time attribute according to the ISO 8601 standard. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_datetime_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -650,15 +632,13 @@ def update_datetime_attribute(self, database_id: str, collection_id: str, key: s """ Update a date time attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_datetime_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -710,15 +690,13 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, Create an email attribute. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_email_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -770,15 +748,13 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, Update an email attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_email_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -786,7 +762,7 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, default : str Default value for attribute when not provided. Cannot be set when attribute is required. new_key : str - New Attribute Key. + New attribute key. Returns ------- @@ -827,22 +803,20 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: """ - Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. + Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_enum_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. elements : List[str] - Array of enum values. + Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. required : bool Is attribute required? default : str @@ -896,25 +870,23 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, Update an enum attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_enum_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. elements : List[str] - Updated list of enum values. + Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. required : bool Is attribute required? default : str Default value for attribute when not provided. Cannot be set when attribute is required. new_key : str - New Attribute Key. + New attribute key. Returns ------- @@ -962,25 +934,23 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, Create a float attribute. Optionally, minimum and maximum values can be provided. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_float_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool Is attribute required? min : float - Minimum value. + Minimum value to enforce on new documents max : float - Maximum value. + Maximum value to enforce on new documents default : float - Default value. Cannot be set when required. + Default value for attribute when not provided. Cannot be set when attribute is required. array : bool Is attribute an array? @@ -1028,27 +998,25 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, Update a float attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_float_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool Is attribute required? default : float - Default value. Cannot be set when required. + Default value for attribute when not provided. Cannot be set when attribute is required. min : float - Minimum value. + Minimum value to enforce on new documents max : float - Maximum value. + Maximum value to enforce on new documents new_key : str - New Attribute Key. + New attribute key. Returns ------- @@ -1094,25 +1062,23 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st Create an integer attribute. Optionally, minimum and maximum values can be provided. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_integer_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool Is attribute required? min : float - Minimum value + Minimum value to enforce on new documents max : float - Maximum value + Maximum value to enforce on new documents default : float - Default value. Cannot be set when attribute is required. + Default value for attribute when not provided. Cannot be set when attribute is required. array : bool Is attribute an array? @@ -1160,27 +1126,25 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st Update an integer attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_integer_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool Is attribute required? default : float - Default value. Cannot be set when attribute is required. + Default value for attribute when not provided. Cannot be set when attribute is required. min : float - Minimum value + Minimum value to enforce on new documents max : float - Maximum value + Maximum value to enforce on new documents new_key : str - New Attribute Key. + New attribute key. Returns ------- @@ -1226,21 +1190,19 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re Create IP address attribute. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_ip_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool Is attribute required? default : str - Default value. Cannot be set when attribute is required. + Default value for attribute when not provided. Cannot be set when attribute is required. array : bool Is attribute an array? @@ -1286,23 +1248,21 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re Update an ip attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_ip_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool Is attribute required? default : str - Default value. Cannot be set when attribute is required. + Default value for attribute when not provided. Cannot be set when attribute is required. new_key : str - New Attribute Key. + New attribute key. Returns ------- @@ -1346,17 +1306,15 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_relationship_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). related_collection_id : str - Related Collection ID. + Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). type : RelationshipType Relation type two_way : bool @@ -1412,15 +1370,13 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str Create a string attribute. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_string_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. size : float @@ -1481,15 +1437,13 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str Update a string attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_string_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -1499,7 +1453,7 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str size : float Maximum size of the string attribute. new_key : str - New Attribute Key. + New attribute key. Returns ------- @@ -1544,15 +1498,13 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r Create a URL attribute. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_url_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -1604,15 +1556,13 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r Update an url attribute. Changing the `default` value will not update already existing documents. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_url_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. required : bool @@ -1620,7 +1570,7 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r default : str Default value for attribute when not provided. Cannot be set when attribute is required. new_key : str - New Attribute Key. + New attribute key. Returns ------- @@ -1663,15 +1613,13 @@ def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[ """ Get attribute by ID. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.get_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. @@ -1709,15 +1657,13 @@ def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Di """ Deletes an attribute. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.delete_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. @@ -1757,21 +1703,19 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_relationship_column` instead. Parameters ---------- database_id : str Database ID. collection_id : str - Collection ID. + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). key : str Attribute Key. on_delete : RelationMutate Constraints option new_key : str - New Attribute Key. + New attribute key. Returns ------- @@ -1810,8 +1754,6 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str """ Get a list of all the user's documents in a given collection. You can use the query params to filter your results. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.list_rows` instead. Parameters ---------- @@ -1853,8 +1795,6 @@ def create_document(self, database_id: str, collection_id: str, document_id: str """ Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_row` instead. Parameters ---------- @@ -1911,8 +1851,6 @@ def create_documents(self, database_id: str, collection_id: str, documents: List Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_row` instead. Parameters ---------- @@ -1954,15 +1892,13 @@ def create_documents(self, database_id: str, collection_id: str, documents: List 'content-type': 'application/json', }, api_params) - def upsert_documents(self, database_id: str, collection_id: str) -> Dict[str, Any]: + def upsert_documents(self, database_id: str, collection_id: str, documents: List[dict]) -> Dict[str, Any]: """ **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.upsert_rows` instead. Parameters ---------- @@ -1970,6 +1906,8 @@ def upsert_documents(self, database_id: str, collection_id: str) -> Dict[str, An Database ID. collection_id : str Collection ID. + documents : List[dict] + Array of document data as JSON objects. May contain partial documents. Returns ------- @@ -1990,9 +1928,13 @@ def upsert_documents(self, database_id: str, collection_id: str) -> Dict[str, An if collection_id is None: raise AppwriteException('Missing required parameter: "collection_id"') + if documents is None: + raise AppwriteException('Missing required parameter: "documents"') + api_path = api_path.replace('{databaseId}', database_id) api_path = api_path.replace('{collectionId}', collection_id) + api_params['documents'] = documents return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -2004,8 +1946,6 @@ def update_documents(self, database_id: str, collection_id: str, data: dict = No Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_rows` instead. Parameters ---------- @@ -2053,8 +1993,6 @@ def delete_documents(self, database_id: str, collection_id: str, queries: List[s Bulk delete documents using queries, if no queries are passed then all documents are deleted. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.delete_rows` instead. Parameters ---------- @@ -2097,8 +2035,6 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q """ Get a document by its unique ID. This endpoint response returns a JSON object with the document data. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.get_row` instead. Parameters ---------- @@ -2142,14 +2078,12 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q return self.client.call('get', api_path, { }, api_params) - def upsert_document(self, database_id: str, collection_id: str, document_id: str) -> Dict[str, Any]: + def upsert_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None) -> Dict[str, Any]: """ **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.upsert_row` instead. Parameters ---------- @@ -2159,6 +2093,10 @@ def upsert_document(self, database_id: str, collection_id: str, document_id: str Collection ID. document_id : str Document ID. + data : dict + Document data as JSON object. Include all required attributes of the document to be created or updated. + permissions : List[str] + An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). Returns ------- @@ -2182,10 +2120,15 @@ def upsert_document(self, database_id: str, collection_id: str, document_id: str if document_id is None: raise AppwriteException('Missing required parameter: "document_id"') + if data is None: + raise AppwriteException('Missing required parameter: "data"') + api_path = api_path.replace('{databaseId}', database_id) api_path = api_path.replace('{collectionId}', collection_id) api_path = api_path.replace('{documentId}', document_id) + api_params['data'] = data + api_params['permissions'] = permissions return self.client.call('put', api_path, { 'content-type': 'application/json', @@ -2195,8 +2138,6 @@ def update_document(self, database_id: str, collection_id: str, document_id: str """ Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.update_row` instead. Parameters ---------- @@ -2248,8 +2189,6 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str """ Delete a document by its unique ID. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.delete_row` instead. Parameters ---------- @@ -2295,8 +2234,6 @@ def decrement_document_attribute(self, database_id: str, collection_id: str, doc """ Decrement a specific attribute of a document by a given value. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.decrement_row_column` instead. Parameters ---------- @@ -2309,7 +2246,7 @@ def decrement_document_attribute(self, database_id: str, collection_id: str, doc attribute : str Attribute key. value : float - Value to increment the attribute by. The value must be a number. + Value to decrement the attribute by. The value must be a number. min : float Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. @@ -2354,8 +2291,6 @@ def increment_document_attribute(self, database_id: str, collection_id: str, doc """ Increment a specific attribute of a document by a given value. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.increment_row_column` instead. Parameters ---------- @@ -2413,8 +2348,6 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] """ List indexes in the collection. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.list_indexes` instead. Parameters ---------- @@ -2457,8 +2390,6 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be `key`, `fulltext`, and `unique`. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.create_index` instead. Parameters ---------- @@ -2522,8 +2453,6 @@ def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, """ Get index by ID. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.get_index` instead. Parameters ---------- @@ -2568,8 +2497,6 @@ def delete_index(self, database_id: str, collection_id: str, key: str) -> Dict[s """ Delete an index. - .. deprecated::1.8.0 - This API has been deprecated since 1.8.0. Please use `tables.delete_index` instead. Parameters ---------- diff --git a/appwrite/services/tables.py b/appwrite/services/tables.py deleted file mode 100644 index f54cd5b..0000000 --- a/appwrite/services/tables.py +++ /dev/null @@ -1,2331 +0,0 @@ -from ..service import Service -from typing import List, Dict, Any -from ..exception import AppwriteException -from ..enums.relationship_type import RelationshipType; -from ..enums.relation_mutate import RelationMutate; -from ..enums.index_type import IndexType; - -class Tables(Service): - - def __init__(self, client) -> None: - super(Tables, self).__init__(client) - - def list(self, database_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: - """ - Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results. - - - Parameters - ---------- - database_id : str - Database ID. - queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, rowSecurity - search : str - Search term to filter your list results. Max length: 256 chars. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - api_path = api_path.replace('{databaseId}', database_id) - - api_params['queries'] = queries - api_params['search'] = search - - return self.client.call('get', api_path, { - }, api_params) - - def create(self, database_id: str, table_id: str, name: str, permissions: List[str] = None, row_security: bool = None, enabled: bool = None) -> Dict[str, Any]: - """ - Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - name : str - Table name. Max length: 128 chars. - permissions : List[str] - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - row_security : bool - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). - enabled : bool - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - api_path = api_path.replace('{databaseId}', database_id) - - api_params['tableId'] = table_id - api_params['name'] = name - api_params['permissions'] = permissions - api_params['rowSecurity'] = row_security - api_params['enabled'] = enabled - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get(self, database_id: str, table_id: str) -> Dict[str, Any]: - """ - Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - - return self.client.call('get', api_path, { - }, api_params) - - def update(self, database_id: str, table_id: str, name: str, permissions: List[str] = None, row_security: bool = None, enabled: bool = None) -> Dict[str, Any]: - """ - Update a table by its unique ID. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - name : str - Table name. Max length: 128 chars. - permissions : List[str] - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - row_security : bool - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - enabled : bool - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if name is None: - raise AppwriteException('Missing required parameter: "name"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['name'] = name - api_params['permissions'] = permissions - api_params['rowSecurity'] = row_security - api_params['enabled'] = enabled - - return self.client.call('put', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete(self, database_id: str, table_id: str) -> Dict[str, Any]: - """ - Delete a table by its unique ID. Only users with write permissions have access to delete this resource. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_columns(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: - """ - List attributes in the collection. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - }, api_params) - - def create_boolean_column(self, database_id: str, table_id: str, key: str, required: bool, default: bool = None, array: bool = None) -> Dict[str, Any]: - """ - Create a boolean column. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - key : str - Column Key. - required : bool - Is column required? - default : bool - Default value for column when not provided. Cannot be set when column is required. - array : bool - Is column an array? - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/boolean' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['required'] = required - api_params['default'] = default - api_params['array'] = array - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_boolean_column(self, database_id: str, table_id: str, key: str, required: bool, default: bool, new_key: str = None) -> Dict[str, Any]: - """ - Update a boolean column. Changing the `default` value will not update already existing rows. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - key : str - Column Key. - required : bool - Is column required? - default : bool - Default value for column when not provided. Cannot be set when column is required. - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/boolean/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['required'] = required - api_params['default'] = default - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_datetime_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: - """ - Create a date time column according to the ISO 8601 standard. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : str - Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. - array : bool - Is column an array? - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/datetime' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['required'] = required - api_params['default'] = default - api_params['array'] = array - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_datetime_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: - """ - Update a date time column. Changing the `default` value will not update already existing rows. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/datetime/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['required'] = required - api_params['default'] = default - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_email_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: - """ - Create an email column. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - array : bool - Is column an array? - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/email' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['required'] = required - api_params['default'] = default - api_params['array'] = array - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_email_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: - """ - Update an email column. Changing the `default` value will not update already existing rows. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/email/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['required'] = required - api_params['default'] = default - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_enum_column(self, database_id: str, table_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: - """ - Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - elements : List[str] - Array of enum values. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - array : bool - Is column an array? - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/enum' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if elements is None: - raise AppwriteException('Missing required parameter: "elements"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['elements'] = elements - api_params['required'] = required - api_params['default'] = default - api_params['array'] = array - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_enum_column(self, database_id: str, table_id: str, key: str, elements: List[str], required: bool, default: str, new_key: str = None) -> Dict[str, Any]: - """ - Update an enum column. Changing the `default` value will not update already existing rows. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - elements : List[str] - Updated list of enum values. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/enum/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if elements is None: - raise AppwriteException('Missing required parameter: "elements"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['elements'] = elements - api_params['required'] = required - api_params['default'] = default - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_float_column(self, database_id: str, table_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: - """ - Create a float column. Optionally, minimum and maximum values can be provided. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - min : float - Minimum value - max : float - Maximum value - default : float - Default value. Cannot be set when required. - array : bool - Is column an array? - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/float' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['required'] = required - api_params['min'] = min - api_params['max'] = max - api_params['default'] = default - api_params['array'] = array - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_float_column(self, database_id: str, table_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: - """ - Update a float column. Changing the `default` value will not update already existing rows. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : float - Default value. Cannot be set when required. - min : float - Minimum value - max : float - Maximum value - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/float/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['required'] = required - api_params['min'] = min - api_params['max'] = max - api_params['default'] = default - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_integer_column(self, database_id: str, table_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: - """ - Create an integer column. Optionally, minimum and maximum values can be provided. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - min : float - Minimum value - max : float - Maximum value - default : float - Default value. Cannot be set when column is required. - array : bool - Is column an array? - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/integer' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['required'] = required - api_params['min'] = min - api_params['max'] = max - api_params['default'] = default - api_params['array'] = array - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_integer_column(self, database_id: str, table_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: - """ - Update an integer column. Changing the `default` value will not update already existing rows. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : float - Default value. Cannot be set when column is required. - min : float - Minimum value - max : float - Maximum value - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/integer/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['required'] = required - api_params['min'] = min - api_params['max'] = max - api_params['default'] = default - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_ip_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: - """ - Create IP address column. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : str - Default value. Cannot be set when column is required. - array : bool - Is column an array? - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/ip' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['required'] = required - api_params['default'] = default - api_params['array'] = array - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_ip_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: - """ - Update an ip column. Changing the `default` value will not update already existing rows. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : str - Default value. Cannot be set when column is required. - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/ip/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['required'] = required - api_params['default'] = default - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_relationship_column(self, database_id: str, table_id: str, related_table_id: str, type: RelationshipType, two_way: bool = None, key: str = None, two_way_key: str = None, on_delete: RelationMutate = None) -> Dict[str, Any]: - """ - Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - related_table_id : str - Related Table ID. - type : RelationshipType - Relation type - two_way : bool - Is Two Way? - key : str - Column Key. - two_way_key : str - Two Way Column Key. - on_delete : RelationMutate - Constraints option - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/relationship' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if related_table_id is None: - raise AppwriteException('Missing required parameter: "related_table_id"') - - if type is None: - raise AppwriteException('Missing required parameter: "type"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['relatedTableId'] = related_table_id - api_params['type'] = type - api_params['twoWay'] = two_way - api_params['key'] = key - api_params['twoWayKey'] = two_way_key - api_params['onDelete'] = on_delete - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_string_column(self, database_id: str, table_id: str, key: str, size: float, required: bool, default: str = None, array: bool = None, encrypt: bool = None) -> Dict[str, Any]: - """ - Create a string column. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - key : str - Column Key. - size : float - Attribute size for text attributes, in number of characters. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - array : bool - Is column an array? - encrypt : bool - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/string' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if size is None: - raise AppwriteException('Missing required parameter: "size"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['size'] = size - api_params['required'] = required - api_params['default'] = default - api_params['array'] = array - api_params['encrypt'] = encrypt - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_string_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, size: float = None, new_key: str = None) -> Dict[str, Any]: - """ - Update a string column. Changing the `default` value will not update already existing rows. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - key : str - Column Key. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - size : float - Maximum size of the string column. - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/string/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['required'] = required - api_params['default'] = default - api_params['size'] = size - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_url_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: - """ - Create a URL column. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - array : bool - Is column an array? - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/url' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['required'] = required - api_params['default'] = default - api_params['array'] = array - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_url_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: - """ - Update an url column. Changing the `default` value will not update already existing rows. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - required : bool - Is column required? - default : str - Default value for column when not provided. Cannot be set when column is required. - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/url/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if required is None: - raise AppwriteException('Missing required parameter: "required"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['required'] = required - api_params['default'] = default - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_column(self, database_id: str, table_id: str, key: str) -> Dict[str, Any]: - """ - Get column by ID. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - - return self.client.call('get', api_path, { - }, api_params) - - def delete_column(self, database_id: str, table_id: str, key: str) -> Dict[str, Any]: - """ - Deletes a column. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_relationship_column(self, database_id: str, table_id: str, key: str, on_delete: RelationMutate = None, new_key: str = None) -> Dict[str, Any]: - """ - Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - key : str - Column Key. - on_delete : RelationMutate - Constraints option - new_key : str - New Column Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/columns/{key}/relationship' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - api_params['onDelete'] = on_delete - api_params['newKey'] = new_key - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_indexes(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: - """ - List indexes in the collection. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/indexes' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - }, api_params) - - def create_index(self, database_id: str, table_id: str, key: str, type: IndexType, columns: List[str], orders: List[str] = None, lengths: List[float] = None) -> Dict[str, Any]: - """ - Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. - Attributes can be `key`, `fulltext`, and `unique`. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - key : str - Index Key. - type : IndexType - Index type. - columns : List[str] - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. - orders : List[str] - Array of index orders. Maximum of 100 orders are allowed. - lengths : List[float] - Length of index. Maximum of 100 - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/indexes' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - if type is None: - raise AppwriteException('Missing required parameter: "type"') - - if columns is None: - raise AppwriteException('Missing required parameter: "columns"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['key'] = key - api_params['type'] = type - api_params['columns'] = columns - api_params['orders'] = orders - api_params['lengths'] = lengths - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_index(self, database_id: str, table_id: str, key: str) -> Dict[str, Any]: - """ - Get index by ID. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - key : str - Index Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/indexes/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - - return self.client.call('get', api_path, { - }, api_params) - - def delete_index(self, database_id: str, table_id: str, key: str) -> Dict[str, Any]: - """ - Delete an index. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - key : str - Index Key. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/indexes/{key}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if key is None: - raise AppwriteException('Missing required parameter: "key"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{key}', key) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def list_rows(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: - """ - Get a list of all the user's rows in a given table. You can use the query params to filter your results. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - }, api_params) - - def create_row(self, database_id: str, table_id: str, row_id: str, data: dict, permissions: List[str] = None) -> Dict[str, Any]: - """ - Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). Make sure to define columns before creating rows. - row_id : str - Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - data : dict - Row data as JSON object. - permissions : List[str] - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if row_id is None: - raise AppwriteException('Missing required parameter: "row_id"') - - if data is None: - raise AppwriteException('Missing required parameter: "data"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['rowId'] = row_id - api_params['data'] = data - api_params['permissions'] = permissions - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def create_rows(self, database_id: str, table_id: str, rows: List[dict]) -> Dict[str, Any]: - """ - Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). Make sure to define columns before creating rows. - rows : List[dict] - Array of documents data as JSON objects. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if rows is None: - raise AppwriteException('Missing required parameter: "rows"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['rows'] = rows - - return self.client.call('post', api_path, { - 'content-type': 'application/json', - }, api_params) - - def upsert_rows(self, database_id: str, table_id: str) -> Dict[str, Any]: - """ - Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. - - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - - return self.client.call('put', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_rows(self, database_id: str, table_id: str, data: dict = None, queries: List[str] = None) -> Dict[str, Any]: - """ - Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - data : dict - Row data as JSON object. Include only column and value pairs to be updated. - queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['data'] = data - api_params['queries'] = queries - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete_rows(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: - """ - Bulk delete rows using queries, if no queries are passed then all rows are deleted. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - - api_params['queries'] = queries - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def get_row(self, database_id: str, table_id: str, row_id: str, queries: List[str] = None) -> Dict[str, Any]: - """ - Get a row by its unique ID. This endpoint response returns a JSON object with the row data. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - row_id : str - Row ID. - queries : List[str] - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if row_id is None: - raise AppwriteException('Missing required parameter: "row_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{rowId}', row_id) - - api_params['queries'] = queries - - return self.client.call('get', api_path, { - }, api_params) - - def upsert_row(self, database_id: str, table_id: str, row_id: str) -> Dict[str, Any]: - """ - Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateTable) API or directly from your database console. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - row_id : str - Row ID. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if row_id is None: - raise AppwriteException('Missing required parameter: "row_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{rowId}', row_id) - - - return self.client.call('put', api_path, { - 'content-type': 'application/json', - }, api_params) - - def update_row(self, database_id: str, table_id: str, row_id: str, data: dict = None, permissions: List[str] = None) -> Dict[str, Any]: - """ - Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - row_id : str - Row ID. - data : dict - Row data as JSON object. Include only columns and value pairs to be updated. - permissions : List[str] - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if row_id is None: - raise AppwriteException('Missing required parameter: "row_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{rowId}', row_id) - - api_params['data'] = data - api_params['permissions'] = permissions - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def delete_row(self, database_id: str, table_id: str, row_id: str) -> Dict[str, Any]: - """ - Delete a row by its unique ID. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tables#tablesCreate). - row_id : str - Row ID. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if row_id is None: - raise AppwriteException('Missing required parameter: "row_id"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{rowId}', row_id) - - - return self.client.call('delete', api_path, { - 'content-type': 'application/json', - }, api_params) - - def decrement_row_column(self, database_id: str, table_id: str, row_id: str, column: str, value: float = None, min: float = None) -> Dict[str, Any]: - """ - Decrement a specific column of a row by a given value. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - row_id : str - Row ID. - column : str - Column key. - value : float - Value to increment the column by. The value must be a number. - min : float - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if row_id is None: - raise AppwriteException('Missing required parameter: "row_id"') - - if column is None: - raise AppwriteException('Missing required parameter: "column"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{rowId}', row_id) - api_path = api_path.replace('{column}', column) - - api_params['value'] = value - api_params['min'] = min - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) - - def increment_row_column(self, database_id: str, table_id: str, row_id: str, column: str, value: float = None, max: float = None) -> Dict[str, Any]: - """ - Increment a specific column of a row by a given value. - - - Parameters - ---------- - database_id : str - Database ID. - table_id : str - Table ID. - row_id : str - Row ID. - column : str - Column key. - value : float - Value to increment the column by. The value must be a number. - max : float - Maximum value for the column. If the current value is greater than this value, an error will be thrown. - - Returns - ------- - Dict[str, Any] - API response as a dictionary - - Raises - ------ - AppwriteException - If API request fails - """ - - api_path = '/databases/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment' - api_params = {} - if database_id is None: - raise AppwriteException('Missing required parameter: "database_id"') - - if table_id is None: - raise AppwriteException('Missing required parameter: "table_id"') - - if row_id is None: - raise AppwriteException('Missing required parameter: "row_id"') - - if column is None: - raise AppwriteException('Missing required parameter: "column"') - - api_path = api_path.replace('{databaseId}', database_id) - api_path = api_path.replace('{tableId}', table_id) - api_path = api_path.replace('{rowId}', row_id) - api_path = api_path.replace('{column}', column) - - api_params['value'] = value - api_params['max'] = max - - return self.client.call('patch', api_path, { - 'content-type': 'application/json', - }, api_params) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 1a8500b..1eaf024 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -3,9 +3,8 @@ 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 -client.set_key('<YOUR_API_KEY>') # Your secret API key -client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token databases = Databases(client) diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index 27ad6e8..1b94e51 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -3,7 +3,7 @@ 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_project('<YOUR_PROJECT_ID>') # Your project ID client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 8711e44..c491ea4 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -3,14 +3,15 @@ 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 -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>' + document_id = '<DOCUMENT_ID>', + data = {}, + permissions = ["read("any")"] # optional ) diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 79888c8..5136d5f 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -3,12 +3,13 @@ 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_project('<YOUR_PROJECT_ID>') # Your project ID 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>' + collection_id = '<COLLECTION_ID>', + documents = [] ) diff --git a/docs/examples/tables/create-boolean-column.md b/docs/examples/tables/create-boolean-column.md deleted file mode 100644 index cfbaa3b..0000000 --- a/docs/examples/tables/create-boolean-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_boolean_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = False, # optional - array = False # optional -) diff --git a/docs/examples/tables/create-datetime-column.md b/docs/examples/tables/create-datetime-column.md deleted file mode 100644 index a9f76b5..0000000 --- a/docs/examples/tables/create-datetime-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_datetime_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = '', # optional - array = False # optional -) diff --git a/docs/examples/tables/create-email-column.md b/docs/examples/tables/create-email-column.md deleted file mode 100644 index 73ac0fa..0000000 --- a/docs/examples/tables/create-email-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_email_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = 'email@example.com', # optional - array = False # optional -) diff --git a/docs/examples/tables/create-enum-column.md b/docs/examples/tables/create-enum-column.md deleted file mode 100644 index 2013c39..0000000 --- a/docs/examples/tables/create-enum-column.md +++ /dev/null @@ -1,19 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_enum_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - elements = [], - required = False, - default = '<DEFAULT>', # optional - array = False # optional -) diff --git a/docs/examples/tables/create-float-column.md b/docs/examples/tables/create-float-column.md deleted file mode 100644 index a56a196..0000000 --- a/docs/examples/tables/create-float-column.md +++ /dev/null @@ -1,20 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_float_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - min = None, # optional - max = None, # optional - default = None, # optional - array = False # optional -) diff --git a/docs/examples/tables/create-index.md b/docs/examples/tables/create-index.md deleted file mode 100644 index 69086af..0000000 --- a/docs/examples/tables/create-index.md +++ /dev/null @@ -1,20 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables -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 - -tables = Tables(client) - -result = tables.create_index( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - type = IndexType.KEY, - columns = [], - orders = [], # optional - lengths = [] # optional -) diff --git a/docs/examples/tables/create-integer-column.md b/docs/examples/tables/create-integer-column.md deleted file mode 100644 index d52b14b..0000000 --- a/docs/examples/tables/create-integer-column.md +++ /dev/null @@ -1,20 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_integer_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - min = None, # optional - max = None, # optional - default = None, # optional - array = False # optional -) diff --git a/docs/examples/tables/create-ip-column.md b/docs/examples/tables/create-ip-column.md deleted file mode 100644 index b5c7ef5..0000000 --- a/docs/examples/tables/create-ip-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_ip_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = '', # optional - array = False # optional -) diff --git a/docs/examples/tables/create-relationship-column.md b/docs/examples/tables/create-relationship-column.md deleted file mode 100644 index 187271f..0000000 --- a/docs/examples/tables/create-relationship-column.md +++ /dev/null @@ -1,21 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables -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 - -tables = Tables(client) - -result = tables.create_relationship_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - related_table_id = '<RELATED_TABLE_ID>', - type = RelationshipType.ONETOONE, - two_way = False, # optional - key = '', # optional - two_way_key = '', # optional - on_delete = RelationMutate.CASCADE # optional -) diff --git a/docs/examples/tables/create-row.md b/docs/examples/tables/create-row.md deleted file mode 100644 index 8850a97..0000000 --- a/docs/examples/tables/create-row.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -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 - -tables = Tables(client) - -result = tables.create_row( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - row_id = '<ROW_ID>', - data = {}, - permissions = ["read("any")"] # optional -) diff --git a/docs/examples/tables/create-rows.md b/docs/examples/tables/create-rows.md deleted file mode 100644 index 3fae165..0000000 --- a/docs/examples/tables/create-rows.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -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 - -tables = Tables(client) - -result = tables.create_rows( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - rows = [] -) diff --git a/docs/examples/tables/create-string-column.md b/docs/examples/tables/create-string-column.md deleted file mode 100644 index 1308fea..0000000 --- a/docs/examples/tables/create-string-column.md +++ /dev/null @@ -1,20 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_string_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - size = 1, - required = False, - default = '<DEFAULT>', # optional - array = False, # optional - encrypt = False # optional -) diff --git a/docs/examples/tables/create-url-column.md b/docs/examples/tables/create-url-column.md deleted file mode 100644 index f15c3e0..0000000 --- a/docs/examples/tables/create-url-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create_url_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = 'https://example.com', # optional - array = False # optional -) diff --git a/docs/examples/tables/create.md b/docs/examples/tables/create.md deleted file mode 100644 index 3a02843..0000000 --- a/docs/examples/tables/create.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.create( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - name = '<NAME>', - permissions = ["read("any")"], # optional - row_security = False, # optional - enabled = False # optional -) diff --git a/docs/examples/tables/decrement-row-column.md b/docs/examples/tables/decrement-row-column.md deleted file mode 100644 index bf027d6..0000000 --- a/docs/examples/tables/decrement-row-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.decrement_row_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - row_id = '<ROW_ID>', - column = '', - value = None, # optional - min = None # optional -) diff --git a/docs/examples/tables/delete-column.md b/docs/examples/tables/delete-column.md deleted file mode 100644 index cf2dd6d..0000000 --- a/docs/examples/tables/delete-column.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.delete_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '' -) diff --git a/docs/examples/tables/delete-index.md b/docs/examples/tables/delete-index.md deleted file mode 100644 index 5f78d1c..0000000 --- a/docs/examples/tables/delete-index.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.delete_index( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '' -) diff --git a/docs/examples/tables/delete-row.md b/docs/examples/tables/delete-row.md deleted file mode 100644 index 40a8b09..0000000 --- a/docs/examples/tables/delete-row.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -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 - -tables = Tables(client) - -result = tables.delete_row( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - row_id = '<ROW_ID>' -) diff --git a/docs/examples/tables/delete-rows.md b/docs/examples/tables/delete-rows.md deleted file mode 100644 index 236aea1..0000000 --- a/docs/examples/tables/delete-rows.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.delete_rows( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - queries = [] # optional -) diff --git a/docs/examples/tables/delete.md b/docs/examples/tables/delete.md deleted file mode 100644 index de48bfc..0000000 --- a/docs/examples/tables/delete.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.delete( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>' -) diff --git a/docs/examples/tables/get-column.md b/docs/examples/tables/get-column.md deleted file mode 100644 index 4bd4617..0000000 --- a/docs/examples/tables/get-column.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.get_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '' -) diff --git a/docs/examples/tables/get-index.md b/docs/examples/tables/get-index.md deleted file mode 100644 index cf88017..0000000 --- a/docs/examples/tables/get-index.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.get_index( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '' -) diff --git a/docs/examples/tables/get-row.md b/docs/examples/tables/get-row.md deleted file mode 100644 index 25fefb2..0000000 --- a/docs/examples/tables/get-row.md +++ /dev/null @@ -1,16 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -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 - -tables = Tables(client) - -result = tables.get_row( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - row_id = '<ROW_ID>', - queries = [] # optional -) diff --git a/docs/examples/tables/get.md b/docs/examples/tables/get.md deleted file mode 100644 index 789410c..0000000 --- a/docs/examples/tables/get.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.get( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>' -) diff --git a/docs/examples/tables/increment-row-column.md b/docs/examples/tables/increment-row-column.md deleted file mode 100644 index cfb9230..0000000 --- a/docs/examples/tables/increment-row-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.increment_row_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - row_id = '<ROW_ID>', - column = '', - value = None, # optional - max = None # optional -) diff --git a/docs/examples/tables/list-columns.md b/docs/examples/tables/list-columns.md deleted file mode 100644 index d9c5b16..0000000 --- a/docs/examples/tables/list-columns.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.list_columns( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - queries = [] # optional -) diff --git a/docs/examples/tables/list-indexes.md b/docs/examples/tables/list-indexes.md deleted file mode 100644 index 0b0bb58..0000000 --- a/docs/examples/tables/list-indexes.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.list_indexes( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - queries = [] # optional -) diff --git a/docs/examples/tables/list-rows.md b/docs/examples/tables/list-rows.md deleted file mode 100644 index 2ece6f6..0000000 --- a/docs/examples/tables/list-rows.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -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 - -tables = Tables(client) - -result = tables.list_rows( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - queries = [] # optional -) diff --git a/docs/examples/tables/list.md b/docs/examples/tables/list.md deleted file mode 100644 index 55a99e9..0000000 --- a/docs/examples/tables/list.md +++ /dev/null @@ -1,15 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.list( - database_id = '<DATABASE_ID>', - queries = [], # optional - search = '<SEARCH>' # optional -) diff --git a/docs/examples/tables/update-boolean-column.md b/docs/examples/tables/update-boolean-column.md deleted file mode 100644 index 1bc7a4a..0000000 --- a/docs/examples/tables/update-boolean-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_boolean_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = False, - new_key = '' # optional -) diff --git a/docs/examples/tables/update-datetime-column.md b/docs/examples/tables/update-datetime-column.md deleted file mode 100644 index 157ff44..0000000 --- a/docs/examples/tables/update-datetime-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_datetime_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = '', - new_key = '' # optional -) diff --git a/docs/examples/tables/update-email-column.md b/docs/examples/tables/update-email-column.md deleted file mode 100644 index 8b9e4ca..0000000 --- a/docs/examples/tables/update-email-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_email_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = 'email@example.com', - new_key = '' # optional -) diff --git a/docs/examples/tables/update-enum-column.md b/docs/examples/tables/update-enum-column.md deleted file mode 100644 index b46971b..0000000 --- a/docs/examples/tables/update-enum-column.md +++ /dev/null @@ -1,19 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_enum_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - elements = [], - required = False, - default = '<DEFAULT>', - new_key = '' # optional -) diff --git a/docs/examples/tables/update-float-column.md b/docs/examples/tables/update-float-column.md deleted file mode 100644 index 243a26f..0000000 --- a/docs/examples/tables/update-float-column.md +++ /dev/null @@ -1,20 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_float_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = None, - min = None, # optional - max = None, # optional - new_key = '' # optional -) diff --git a/docs/examples/tables/update-integer-column.md b/docs/examples/tables/update-integer-column.md deleted file mode 100644 index 99b55c1..0000000 --- a/docs/examples/tables/update-integer-column.md +++ /dev/null @@ -1,20 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_integer_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = None, - min = None, # optional - max = None, # optional - new_key = '' # optional -) diff --git a/docs/examples/tables/update-ip-column.md b/docs/examples/tables/update-ip-column.md deleted file mode 100644 index 2fb470a..0000000 --- a/docs/examples/tables/update-ip-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_ip_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = '', - new_key = '' # optional -) diff --git a/docs/examples/tables/update-relationship-column.md b/docs/examples/tables/update-relationship-column.md deleted file mode 100644 index 35a307c..0000000 --- a/docs/examples/tables/update-relationship-column.md +++ /dev/null @@ -1,17 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_relationship_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - on_delete = RelationMutate.CASCADE, # optional - new_key = '' # optional -) diff --git a/docs/examples/tables/update-row.md b/docs/examples/tables/update-row.md deleted file mode 100644 index 4a71fc9..0000000 --- a/docs/examples/tables/update-row.md +++ /dev/null @@ -1,17 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -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 - -tables = Tables(client) - -result = tables.update_row( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - row_id = '<ROW_ID>', - data = {}, # optional - permissions = ["read("any")"] # optional -) diff --git a/docs/examples/tables/update-rows.md b/docs/examples/tables/update-rows.md deleted file mode 100644 index a834346..0000000 --- a/docs/examples/tables/update-rows.md +++ /dev/null @@ -1,16 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_rows( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - data = {}, # optional - queries = [] # optional -) diff --git a/docs/examples/tables/update-string-column.md b/docs/examples/tables/update-string-column.md deleted file mode 100644 index 252c264..0000000 --- a/docs/examples/tables/update-string-column.md +++ /dev/null @@ -1,19 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_string_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = '<DEFAULT>', - size = 1, # optional - new_key = '' # optional -) diff --git a/docs/examples/tables/update-url-column.md b/docs/examples/tables/update-url-column.md deleted file mode 100644 index 235e2f3..0000000 --- a/docs/examples/tables/update-url-column.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update_url_column( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - key = '', - required = False, - default = 'https://example.com', - new_key = '' # optional -) diff --git a/docs/examples/tables/update.md b/docs/examples/tables/update.md deleted file mode 100644 index c567bd5..0000000 --- a/docs/examples/tables/update.md +++ /dev/null @@ -1,18 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -client = Client() -client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint -client.set_project('<YOUR_PROJECT_ID>') # Your project ID -client.set_key('<YOUR_API_KEY>') # Your secret API key - -tables = Tables(client) - -result = tables.update( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - name = '<NAME>', - permissions = ["read("any")"], # optional - row_security = False, # optional - enabled = False # optional -) diff --git a/docs/examples/tables/upsert-row.md b/docs/examples/tables/upsert-row.md deleted file mode 100644 index e418708..0000000 --- a/docs/examples/tables/upsert-row.md +++ /dev/null @@ -1,16 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -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 - -tables = Tables(client) - -result = tables.upsert_row( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>', - row_id = '<ROW_ID>' -) diff --git a/docs/examples/tables/upsert-rows.md b/docs/examples/tables/upsert-rows.md deleted file mode 100644 index 85c2e94..0000000 --- a/docs/examples/tables/upsert-rows.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.tables import Tables - -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 - -tables = Tables(client) - -result = tables.upsert_rows( - database_id = '<DATABASE_ID>', - table_id = '<TABLE_ID>' -) diff --git a/setup.py b/setup.py index f0bb253..5c6270f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '12.0.0', + version = '11.0.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/12.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/11.0.0.tar.gz', install_requires=[ 'requests', ], From d1111d5eb3b2e1b51f45303b6423ab766ac9b79d Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Thu, 24 Jul 2025 10:38:43 +0000 Subject: [PATCH 58/60] chore: changelog --- CHANGELOG.md | 8 +++++- appwrite/services/account.py | 31 --------------------- appwrite/services/avatars.py | 7 ----- appwrite/services/databases.py | 49 ---------------------------------- appwrite/services/functions.py | 24 ----------------- appwrite/services/graphql.py | 2 -- appwrite/services/health.py | 14 ---------- appwrite/services/messaging.py | 46 ------------------------------- appwrite/services/sites.py | 23 ---------------- appwrite/services/storage.py | 13 --------- appwrite/services/teams.py | 13 --------- appwrite/services/tokens.py | 5 ---- appwrite/services/users.py | 42 ----------------------------- 13 files changed, 7 insertions(+), 270 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa4d35e..510e270 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,7 @@ -# Change Log \ No newline at end of file +# Change Log + +## 11.1.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `dart38` and `flutter332` support to runtime models +* Add `gif` support to `ImageFormat` enum diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 6062ad4..9dd3c5e 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -35,7 +35,6 @@ def create(self, user_id: str, email: str, password: str, name: str = None) -> D """ Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). - Parameters ---------- user_id : str @@ -85,7 +84,6 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]: This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. - Parameters ---------- email : str @@ -124,7 +122,6 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]: """ Get the list of identities for the currently logged in user. - Parameters ---------- queries : List[str] @@ -153,7 +150,6 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: """ Delete an identity by its unique ID. - Parameters ---------- identity_id : str @@ -208,7 +204,6 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]: """ Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. - Parameters ---------- queries : List[str] @@ -237,7 +232,6 @@ def update_mfa(self, mfa: bool) -> Dict[str, Any]: """ Enable or disable MFA on an account. - Parameters ---------- mfa : bool @@ -270,7 +264,6 @@ def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: """ Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. - Parameters ---------- type : AuthenticatorType @@ -303,7 +296,6 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[st """ Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. - Parameters ---------- type : AuthenticatorType @@ -342,7 +334,6 @@ def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: """ Delete an authenticator for a user by ID. - Parameters ---------- type : AuthenticatorType @@ -375,7 +366,6 @@ def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]: """ Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. - Parameters ---------- factor : AuthenticationFactor @@ -408,7 +398,6 @@ def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]: """ Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. - Parameters ---------- challenge_id : str @@ -533,7 +522,6 @@ def update_name(self, name: str) -> Dict[str, Any]: """ Update currently logged in user account name. - Parameters ---------- name : str @@ -566,7 +554,6 @@ def update_password(self, password: str, old_password: str = None) -> Dict[str, """ Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. - Parameters ---------- password : str @@ -602,7 +589,6 @@ def update_phone(self, phone: str, password: str) -> Dict[str, Any]: """ Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. - Parameters ---------- phone : str @@ -662,7 +648,6 @@ def update_prefs(self, prefs: dict) -> Dict[str, Any]: """ Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. - Parameters ---------- prefs : dict @@ -695,7 +680,6 @@ def create_recovery(self, email: str, url: str) -> Dict[str, Any]: """ Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. - Parameters ---------- email : str @@ -736,7 +720,6 @@ def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str, Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. - Parameters ---------- user_id : str @@ -848,7 +831,6 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str, A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). - Parameters ---------- email : str @@ -887,7 +869,6 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. - Parameters ---------- user_id : str @@ -926,7 +907,6 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. - Parameters ---------- user_id : str @@ -965,7 +945,6 @@ def create_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. - Parameters ---------- user_id : str @@ -1004,7 +983,6 @@ def get_session(self, session_id: str) -> Dict[str, Any]: """ Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. - Parameters ---------- session_id : str @@ -1036,7 +1014,6 @@ def update_session(self, session_id: str) -> Dict[str, Any]: """ Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. - Parameters ---------- session_id : str @@ -1069,7 +1046,6 @@ def delete_session(self, session_id: str) -> Dict[str, Any]: """ Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. - Parameters ---------- session_id : str @@ -1126,7 +1102,6 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). - Parameters ---------- user_id : str @@ -1171,7 +1146,6 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). - Parameters ---------- user_id : str @@ -1220,7 +1194,6 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). - Parameters ---------- provider : OAuthProvider @@ -1263,7 +1236,6 @@ def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]: A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). - Parameters ---------- user_id : str @@ -1305,7 +1277,6 @@ def create_verification(self, url: str) -> Dict[str, Any]: Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. - Parameters ---------- url : str @@ -1338,7 +1309,6 @@ def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. - Parameters ---------- user_id : str @@ -1399,7 +1369,6 @@ def update_phone_verification(self, user_id: str, secret: str) -> Dict[str, Any] """ Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. - Parameters ---------- user_id : str diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 2bd32f7..6ee1d4f 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -16,7 +16,6 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - Parameters ---------- code : Browser @@ -60,7 +59,6 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - Parameters ---------- code : CreditCard @@ -103,7 +101,6 @@ def get_favicon(self, url: str) -> bytes: This endpoint does not follow HTTP redirects. - Parameters ---------- url : str @@ -138,7 +135,6 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - Parameters ---------- code : Flag @@ -183,7 +179,6 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte This endpoint does not follow HTTP redirects. - Parameters ---------- url : str @@ -226,7 +221,6 @@ def get_initials(self, name: str = None, width: float = None, height: float = No When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - Parameters ---------- name : str @@ -265,7 +259,6 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download: Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. - Parameters ---------- text : str diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 40b7372..b025e0c 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -14,7 +14,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. - Parameters ---------- queries : List[str] @@ -47,7 +46,6 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Create a new Database. - Parameters ---------- database_id : str @@ -89,7 +87,6 @@ def get(self, database_id: str) -> Dict[str, Any]: """ Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. - Parameters ---------- database_id : str @@ -121,7 +118,6 @@ def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, """ Update a database by its unique ID. - Parameters ---------- database_id : str @@ -163,7 +159,6 @@ def delete(self, database_id: str) -> Dict[str, Any]: """ Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. - Parameters ---------- database_id : str @@ -196,7 +191,6 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: """ Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. - Parameters ---------- database_id : str @@ -234,7 +228,6 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per """ Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - Parameters ---------- database_id : str @@ -288,7 +281,6 @@ def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any] """ Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. - Parameters ---------- database_id : str @@ -326,7 +318,6 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per """ Update a collection by its unique ID. - Parameters ---------- database_id : str @@ -380,7 +371,6 @@ def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, A """ Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. - Parameters ---------- database_id : str @@ -419,7 +409,6 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st """ List attributes in the collection. - Parameters ---------- database_id : str @@ -461,7 +450,6 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st Create a boolean attribute. - Parameters ---------- database_id : str @@ -518,7 +506,6 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st """ Update a boolean attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -575,7 +562,6 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s """ Create a date time attribute according to the ISO 8601 standard. - Parameters ---------- database_id : str @@ -632,7 +618,6 @@ def update_datetime_attribute(self, database_id: str, collection_id: str, key: s """ Update a date time attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -690,7 +675,6 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, Create an email attribute. - Parameters ---------- database_id : str @@ -748,7 +732,6 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, Update an email attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -806,7 +789,6 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. - Parameters ---------- database_id : str @@ -870,7 +852,6 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, Update an enum attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -934,7 +915,6 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, Create a float attribute. Optionally, minimum and maximum values can be provided. - Parameters ---------- database_id : str @@ -998,7 +978,6 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, Update a float attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -1062,7 +1041,6 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st Create an integer attribute. Optionally, minimum and maximum values can be provided. - Parameters ---------- database_id : str @@ -1126,7 +1104,6 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st Update an integer attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -1190,7 +1167,6 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re Create IP address attribute. - Parameters ---------- database_id : str @@ -1248,7 +1224,6 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re Update an ip attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -1306,7 +1281,6 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - Parameters ---------- database_id : str @@ -1370,7 +1344,6 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str Create a string attribute. - Parameters ---------- database_id : str @@ -1437,7 +1410,6 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str Update a string attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -1498,7 +1470,6 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r Create a URL attribute. - Parameters ---------- database_id : str @@ -1556,7 +1527,6 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r Update an url attribute. Changing the `default` value will not update already existing documents. - Parameters ---------- database_id : str @@ -1613,7 +1583,6 @@ def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[ """ Get attribute by ID. - Parameters ---------- database_id : str @@ -1657,7 +1626,6 @@ def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Di """ Deletes an attribute. - Parameters ---------- database_id : str @@ -1703,7 +1671,6 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - Parameters ---------- database_id : str @@ -1754,7 +1721,6 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str """ Get a list of all the user's documents in a given collection. You can use the query params to filter your results. - Parameters ---------- database_id : str @@ -1795,7 +1761,6 @@ def create_document(self, database_id: str, collection_id: str, document_id: str """ Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - Parameters ---------- database_id : str @@ -1851,7 +1816,6 @@ def create_documents(self, database_id: str, collection_id: str, documents: List Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - Parameters ---------- database_id : str @@ -1899,7 +1863,6 @@ def upsert_documents(self, database_id: str, collection_id: str, documents: List Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - Parameters ---------- database_id : str @@ -1946,7 +1909,6 @@ def update_documents(self, database_id: str, collection_id: str, data: dict = No Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. - Parameters ---------- database_id : str @@ -1993,7 +1955,6 @@ def delete_documents(self, database_id: str, collection_id: str, queries: List[s Bulk delete documents using queries, if no queries are passed then all documents are deleted. - Parameters ---------- database_id : str @@ -2035,7 +1996,6 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q """ Get a document by its unique ID. This endpoint response returns a JSON object with the document data. - Parameters ---------- database_id : str @@ -2084,7 +2044,6 @@ def upsert_document(self, database_id: str, collection_id: str, document_id: str Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - Parameters ---------- database_id : str @@ -2138,7 +2097,6 @@ def update_document(self, database_id: str, collection_id: str, document_id: str """ Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. - Parameters ---------- database_id : str @@ -2189,7 +2147,6 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str """ Delete a document by its unique ID. - Parameters ---------- database_id : str @@ -2234,7 +2191,6 @@ def decrement_document_attribute(self, database_id: str, collection_id: str, doc """ Decrement a specific attribute of a document by a given value. - Parameters ---------- database_id : str @@ -2291,7 +2247,6 @@ def increment_document_attribute(self, database_id: str, collection_id: str, doc """ Increment a specific attribute of a document by a given value. - Parameters ---------- database_id : str @@ -2348,7 +2303,6 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] """ List indexes in the collection. - Parameters ---------- database_id : str @@ -2390,7 +2344,6 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be `key`, `fulltext`, and `unique`. - Parameters ---------- database_id : str @@ -2453,7 +2406,6 @@ def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, """ Get index by ID. - Parameters ---------- database_id : str @@ -2497,7 +2449,6 @@ def delete_index(self, database_id: str, collection_id: str, key: str) -> Dict[s """ Delete an index. - Parameters ---------- database_id : str diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 3dd2459..9dce425 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -16,7 +16,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's functions. You can use the query params to filter your results. - Parameters ---------- queries : List[str] @@ -48,7 +47,6 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st """ Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. - Parameters ---------- function_id : str @@ -180,7 +178,6 @@ def get(self, function_id: str) -> Dict[str, Any]: """ Get a function by its unique ID. - Parameters ---------- function_id : str @@ -212,7 +209,6 @@ def update(self, function_id: str, name: str, runtime: Runtime = None, execute: """ Update function by its unique ID. - Parameters ---------- function_id : str @@ -299,7 +295,6 @@ def delete(self, function_id: str) -> Dict[str, Any]: """ Delete a function by its unique ID. - Parameters ---------- function_id : str @@ -332,7 +327,6 @@ def update_function_deployment(self, function_id: str, deployment_id: str) -> Di """ Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function. - Parameters ---------- function_id : str @@ -371,7 +365,6 @@ def list_deployments(self, function_id: str, queries: List[str] = None, search: """ Get a list of all the function's code deployments. You can use the query params to filter your results. - Parameters ---------- function_id : str @@ -413,7 +406,6 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e Use the "command" param to set the entrypoint used to execute your code. - Parameters ---------- function_id : str @@ -471,7 +463,6 @@ def create_duplicate_deployment(self, function_id: str, deployment_id: str, buil """ Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. - Parameters ---------- function_id : str @@ -515,7 +506,6 @@ def create_template_deployment(self, function_id: str, repository: str, owner: s Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. - Parameters ---------- function_id : str @@ -577,7 +567,6 @@ def create_vcs_deployment(self, function_id: str, type: VCSDeploymentType, refer This endpoint lets you create deployment from a branch, commit, or a tag. - Parameters ---------- function_id : str @@ -625,7 +614,6 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any] """ Get a function deployment by its unique ID. - Parameters ---------- function_id : str @@ -663,7 +651,6 @@ def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, A """ Delete a code deployment by its unique ID. - Parameters ---------- function_id : str @@ -702,7 +689,6 @@ def get_deployment_download(self, function_id: str, deployment_id: str, type: De """ Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. - Parameters ---------- function_id : str @@ -743,7 +729,6 @@ def update_deployment_status(self, function_id: str, deployment_id: str) -> Dict """ Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. - Parameters ---------- function_id : str @@ -782,7 +767,6 @@ def list_executions(self, function_id: str, queries: List[str] = None) -> Dict[s """ Get a list of all the current user function execution logs. You can use the query params to filter your results. - Parameters ---------- function_id : str @@ -817,7 +801,6 @@ def create_execution(self, function_id: str, body: str = None, xasync: bool = No """ Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. - Parameters ---------- function_id : str @@ -868,7 +851,6 @@ def get_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: """ Get a function execution log by its unique ID. - Parameters ---------- function_id : str @@ -906,7 +888,6 @@ def delete_execution(self, function_id: str, execution_id: str) -> Dict[str, Any """ Delete a function execution by its unique ID. - Parameters ---------- function_id : str @@ -945,7 +926,6 @@ def list_variables(self, function_id: str) -> Dict[str, Any]: """ Get a list of all variables of a specific function. - Parameters ---------- function_id : str @@ -977,7 +957,6 @@ def create_variable(self, function_id: str, key: str, value: str, secret: bool = """ Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. - Parameters ---------- function_id : str @@ -1025,7 +1004,6 @@ def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: """ Get a variable by its unique ID. - Parameters ---------- function_id : str @@ -1063,7 +1041,6 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s """ Update variable by its unique ID. - Parameters ---------- function_id : str @@ -1114,7 +1091,6 @@ def delete_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: """ Delete a variable by its unique ID. - Parameters ---------- function_id : str diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 69ad4e0..22ca3aa 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -11,7 +11,6 @@ def query(self, query: dict) -> Dict[str, Any]: """ Execute a GraphQL mutation. - Parameters ---------- query : dict @@ -45,7 +44,6 @@ def mutation(self, query: dict) -> Dict[str, Any]: """ Execute a GraphQL mutation. - Parameters ---------- query : dict diff --git a/appwrite/services/health.py b/appwrite/services/health.py index 665fd1e..dd1d183 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -75,7 +75,6 @@ def get_certificate(self, domain: str = None) -> Dict[str, Any]: """ Get the SSL certificate for a domain - Parameters ---------- domain : str @@ -146,7 +145,6 @@ def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of builds that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -175,7 +173,6 @@ def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -204,7 +201,6 @@ def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict """ Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- name : str @@ -236,7 +232,6 @@ def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -266,7 +261,6 @@ def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any] Returns the amount of failed jobs in a given queue. - Parameters ---------- name : Name @@ -301,7 +295,6 @@ def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -330,7 +323,6 @@ def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of logs that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -359,7 +351,6 @@ def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of mails that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -388,7 +379,6 @@ def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of messages that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -417,7 +407,6 @@ def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -446,7 +435,6 @@ def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. - Parameters ---------- threshold : float @@ -475,7 +463,6 @@ def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float @@ -504,7 +491,6 @@ def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. - Parameters ---------- threshold : float diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 153a1f7..639a820 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -13,7 +13,6 @@ def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[s """ Get a list of all messages from the current Appwrite project. - Parameters ---------- queries : List[str] @@ -45,7 +44,6 @@ def create_email(self, message_id: str, subject: str, content: str, topics: List """ Create a new email message. - Parameters ---------- message_id : str @@ -118,7 +116,6 @@ def update_email(self, message_id: str, topics: List[str] = None, users: List[st Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. - Parameters ---------- message_id : str @@ -184,7 +181,6 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi """ Create a new push notification. - Parameters ---------- message_id : str @@ -272,7 +268,6 @@ def update_push(self, message_id: str, topics: List[str] = None, users: List[str Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. - Parameters ---------- message_id : str @@ -359,7 +354,6 @@ def create_sms(self, message_id: str, content: str, topics: List[str] = None, us """ Create a new SMS message. - Parameters ---------- message_id : str @@ -414,7 +408,6 @@ def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. - Parameters ---------- message_id : str @@ -466,7 +459,6 @@ def get_message(self, message_id: str) -> Dict[str, Any]: Get a message by its unique ID. - Parameters ---------- message_id : str @@ -498,7 +490,6 @@ def delete(self, message_id: str) -> Dict[str, Any]: """ Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message. - Parameters ---------- message_id : str @@ -531,7 +522,6 @@ def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[ """ Get the message activity logs listed by its unique ID. - Parameters ---------- message_id : str @@ -566,7 +556,6 @@ def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, """ Get a list of the targets associated with a message. - Parameters ---------- message_id : str @@ -601,7 +590,6 @@ def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[ """ Get a list of all providers from the current Appwrite project. - Parameters ---------- queries : List[str] @@ -633,7 +621,6 @@ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None """ Create a new Apple Push Notification service provider. - Parameters ---------- provider_id : str @@ -690,7 +677,6 @@ def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool """ Update a Apple Push Notification service provider by its unique ID. - Parameters ---------- provider_id : str @@ -744,7 +730,6 @@ def create_fcm_provider(self, provider_id: str, name: str, service_account_json: """ Create a new Firebase Cloud Messaging provider. - Parameters ---------- provider_id : str @@ -789,7 +774,6 @@ def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool """ Update a Firebase Cloud Messaging provider by its unique ID. - Parameters ---------- provider_id : str @@ -831,7 +815,6 @@ def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = No """ Create a new Mailgun provider. - Parameters ---------- provider_id : str @@ -894,7 +877,6 @@ def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: s """ Update a Mailgun provider by its unique ID. - Parameters ---------- provider_id : str @@ -954,7 +936,6 @@ def create_msg91_provider(self, provider_id: str, name: str, template_id: str = """ Create a new MSG91 provider. - Parameters ---------- provider_id : str @@ -1005,7 +986,6 @@ def update_msg91_provider(self, provider_id: str, name: str = None, enabled: boo """ Update a MSG91 provider by its unique ID. - Parameters ---------- provider_id : str @@ -1053,7 +1033,6 @@ def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = N """ Create a new Sendgrid provider. - Parameters ---------- provider_id : str @@ -1110,7 +1089,6 @@ def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: """ Update a Sendgrid provider by its unique ID. - Parameters ---------- provider_id : str @@ -1164,7 +1142,6 @@ def create_smtp_provider(self, provider_id: str, name: str, host: str, port: flo """ Create a new SMTP provider. - Parameters ---------- provider_id : str @@ -1242,7 +1219,6 @@ def update_smtp_provider(self, provider_id: str, name: str = None, host: str = N """ Update a SMTP provider by its unique ID. - Parameters ---------- provider_id : str @@ -1314,7 +1290,6 @@ def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = Non """ Create a new Telesign provider. - Parameters ---------- provider_id : str @@ -1365,7 +1340,6 @@ def update_telesign_provider(self, provider_id: str, name: str = None, enabled: """ Update a Telesign provider by its unique ID. - Parameters ---------- provider_id : str @@ -1413,7 +1387,6 @@ def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = No """ Create a new Textmagic provider. - Parameters ---------- provider_id : str @@ -1464,7 +1437,6 @@ def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: """ Update a Textmagic provider by its unique ID. - Parameters ---------- provider_id : str @@ -1512,7 +1484,6 @@ def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, """ Create a new Twilio provider. - Parameters ---------- provider_id : str @@ -1563,7 +1534,6 @@ def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bo """ Update a Twilio provider by its unique ID. - Parameters ---------- provider_id : str @@ -1611,7 +1581,6 @@ def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, """ Create a new Vonage provider. - Parameters ---------- provider_id : str @@ -1662,7 +1631,6 @@ def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bo """ Update a Vonage provider by its unique ID. - Parameters ---------- provider_id : str @@ -1711,7 +1679,6 @@ def get_provider(self, provider_id: str) -> Dict[str, Any]: Get a provider by its unique ID. - Parameters ---------- provider_id : str @@ -1743,7 +1710,6 @@ def delete_provider(self, provider_id: str) -> Dict[str, Any]: """ Delete a provider by its unique ID. - Parameters ---------- provider_id : str @@ -1776,7 +1742,6 @@ def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dic """ Get the provider activity logs listed by its unique ID. - Parameters ---------- provider_id : str @@ -1811,7 +1776,6 @@ def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> """ Get the subscriber activity logs listed by its unique ID. - Parameters ---------- subscriber_id : str @@ -1846,7 +1810,6 @@ def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str """ Get a list of all topics from the current Appwrite project. - Parameters ---------- queries : List[str] @@ -1878,7 +1841,6 @@ def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None) -> """ Create a new topic. - Parameters ---------- topic_id : str @@ -1921,7 +1883,6 @@ def get_topic(self, topic_id: str) -> Dict[str, Any]: Get a topic by its unique ID. - Parameters ---------- topic_id : str @@ -1954,7 +1915,6 @@ def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = N Update a topic by its unique ID. - Parameters ---------- topic_id : str @@ -1993,7 +1953,6 @@ def delete_topic(self, topic_id: str) -> Dict[str, Any]: """ Delete a topic by its unique ID. - Parameters ---------- topic_id : str @@ -2026,7 +1985,6 @@ def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, """ Get the topic activity logs listed by its unique ID. - Parameters ---------- topic_id : str @@ -2061,7 +2019,6 @@ def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str """ Get a list of all subscribers from the current Appwrite project. - Parameters ---------- topic_id : str @@ -2099,7 +2056,6 @@ def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str) - """ Create a new subscriber. - Parameters ---------- topic_id : str @@ -2145,7 +2101,6 @@ def get_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: Get a subscriber by its unique ID. - Parameters ---------- topic_id : str @@ -2183,7 +2138,6 @@ def delete_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any] """ Delete a subscriber by its unique ID. - Parameters ---------- topic_id : str diff --git a/appwrite/services/sites.py b/appwrite/services/sites.py index 857cabe..bcb7597 100644 --- a/appwrite/services/sites.py +++ b/appwrite/services/sites.py @@ -17,7 +17,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's sites. You can use the query params to filter your results. - Parameters ---------- queries : List[str] @@ -49,7 +48,6 @@ def create(self, site_id: str, name: str, framework: Framework, build_runtime: B """ Create a new site. - Parameters ---------- site_id : str @@ -184,7 +182,6 @@ def get(self, site_id: str) -> Dict[str, Any]: """ Get a site by its unique ID. - Parameters ---------- site_id : str @@ -216,7 +213,6 @@ def update(self, site_id: str, name: str, framework: Framework, enabled: bool = """ Update site by its unique ID. - Parameters ---------- site_id : str @@ -306,7 +302,6 @@ def delete(self, site_id: str) -> Dict[str, Any]: """ Delete a site by its unique ID. - Parameters ---------- site_id : str @@ -339,7 +334,6 @@ def update_site_deployment(self, site_id: str, deployment_id: str) -> Dict[str, """ Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site. - Parameters ---------- site_id : str @@ -378,7 +372,6 @@ def list_deployments(self, site_id: str, queries: List[str] = None, search: str """ Get a list of all the site's code deployments. You can use the query params to filter your results. - Parameters ---------- site_id : str @@ -416,7 +409,6 @@ def create_deployment(self, site_id: str, code: InputFile, activate: bool, insta """ Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID. - Parameters ---------- site_id : str @@ -477,7 +469,6 @@ def create_duplicate_deployment(self, site_id: str, deployment_id: str) -> Dict[ """ Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. - Parameters ---------- site_id : str @@ -518,7 +509,6 @@ def create_template_deployment(self, site_id: str, repository: str, owner: str, Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. - Parameters ---------- site_id : str @@ -580,7 +570,6 @@ def create_vcs_deployment(self, site_id: str, type: VCSDeploymentType, reference This endpoint lets you create deployment from a branch, commit, or a tag. - Parameters ---------- site_id : str @@ -628,7 +617,6 @@ def get_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: """ Get a site deployment by its unique ID. - Parameters ---------- site_id : str @@ -666,7 +654,6 @@ def delete_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: """ Delete a site deployment by its unique ID. - Parameters ---------- site_id : str @@ -705,7 +692,6 @@ def get_deployment_download(self, site_id: str, deployment_id: str, type: Deploy """ Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. - Parameters ---------- site_id : str @@ -746,7 +732,6 @@ def update_deployment_status(self, site_id: str, deployment_id: str) -> Dict[str """ Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. - Parameters ---------- site_id : str @@ -785,7 +770,6 @@ def list_logs(self, site_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get a list of all site logs. You can use the query params to filter your results. - Parameters ---------- site_id : str @@ -820,7 +804,6 @@ def get_log(self, site_id: str, log_id: str) -> Dict[str, Any]: """ Get a site request log by its unique ID. - Parameters ---------- site_id : str @@ -858,7 +841,6 @@ def delete_log(self, site_id: str, log_id: str) -> Dict[str, Any]: """ Delete a site log by its unique ID. - Parameters ---------- site_id : str @@ -897,7 +879,6 @@ def list_variables(self, site_id: str) -> Dict[str, Any]: """ Get a list of all variables of a specific site. - Parameters ---------- site_id : str @@ -929,7 +910,6 @@ def create_variable(self, site_id: str, key: str, value: str, secret: bool = Non """ Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. - Parameters ---------- site_id : str @@ -977,7 +957,6 @@ def get_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: """ Get a variable by its unique ID. - Parameters ---------- site_id : str @@ -1015,7 +994,6 @@ def update_variable(self, site_id: str, variable_id: str, key: str, value: str = """ Update variable by its unique ID. - Parameters ---------- site_id : str @@ -1066,7 +1044,6 @@ def delete_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: """ Delete a variable by its unique ID. - Parameters ---------- site_id : str diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index e970187..22198eb 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -15,7 +15,6 @@ def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[st """ Get a list of all the storage buckets. You can use the query params to filter your results. - Parameters ---------- queries : List[str] @@ -47,7 +46,6 @@ def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None """ Create a new storage bucket. - Parameters ---------- bucket_id : str @@ -110,7 +108,6 @@ def get_bucket(self, bucket_id: str) -> Dict[str, Any]: """ Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata. - Parameters ---------- bucket_id : str @@ -142,7 +139,6 @@ def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None """ Update a storage bucket by its unique ID. - Parameters ---------- bucket_id : str @@ -205,7 +201,6 @@ def delete_bucket(self, bucket_id: str) -> Dict[str, Any]: """ Delete a storage bucket by its unique ID. - Parameters ---------- bucket_id : str @@ -238,7 +233,6 @@ def list_files(self, bucket_id: str, queries: List[str] = None, search: str = No """ Get a list of all the user files. You can use the query params to filter your results. - Parameters ---------- bucket_id : str @@ -283,7 +277,6 @@ def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. - Parameters ---------- bucket_id : str @@ -339,7 +332,6 @@ def get_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. - Parameters ---------- bucket_id : str @@ -377,7 +369,6 @@ def update_file(self, bucket_id: str, file_id: str, name: str = None, permission """ Update a file by its unique ID. Only users with write permissions have access to update this resource. - Parameters ---------- bucket_id : str @@ -422,7 +413,6 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Delete a file by its unique ID. Only users with write permissions have access to delete this resource. - Parameters ---------- bucket_id : str @@ -461,7 +451,6 @@ def get_file_download(self, bucket_id: str, file_id: str, token: str = None) -> """ Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. - Parameters ---------- bucket_id : str @@ -502,7 +491,6 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he """ Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. - Parameters ---------- bucket_id : str @@ -576,7 +564,6 @@ def get_file_view(self, bucket_id: str, file_id: str, token: str = None) -> byte """ Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. - Parameters ---------- bucket_id : str diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 50e0297..808dc2a 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -11,7 +11,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. - Parameters ---------- queries : List[str] @@ -43,7 +42,6 @@ def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, """ Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. - Parameters ---------- team_id : str @@ -85,7 +83,6 @@ def get(self, team_id: str) -> Dict[str, Any]: """ Get a team by its ID. All team members have read access for this resource. - Parameters ---------- team_id : str @@ -117,7 +114,6 @@ def update_name(self, team_id: str, name: str) -> Dict[str, Any]: """ Update the team's name by its unique ID. - Parameters ---------- team_id : str @@ -156,7 +152,6 @@ def delete(self, team_id: str) -> Dict[str, Any]: """ Delete a team using its ID. Only team members with the owner role can delete the team. - Parameters ---------- team_id : str @@ -189,7 +184,6 @@ def list_memberships(self, team_id: str, queries: List[str] = None, search: str """ Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. - Parameters ---------- team_id : str @@ -234,7 +228,6 @@ def create_membership(self, team_id: str, roles: List[str], email: str = None, u Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. - Parameters ---------- team_id : str @@ -288,7 +281,6 @@ def get_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: """ Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. - Parameters ---------- team_id : str @@ -327,7 +319,6 @@ def update_membership(self, team_id: str, membership_id: str, roles: List[str]) Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). - Parameters ---------- team_id : str @@ -372,7 +363,6 @@ def delete_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: """ This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted. - Parameters ---------- team_id : str @@ -414,7 +404,6 @@ def update_membership_status(self, team_id: str, membership_id: str, user_id: st If the request is successful, a session for the user is automatically created. - Parameters ---------- team_id : str @@ -465,7 +454,6 @@ def get_prefs(self, team_id: str) -> Dict[str, Any]: """ Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). - Parameters ---------- team_id : str @@ -497,7 +485,6 @@ def update_prefs(self, team_id: str, prefs: dict) -> Dict[str, Any]: """ Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. - Parameters ---------- team_id : str diff --git a/appwrite/services/tokens.py b/appwrite/services/tokens.py index 93ba739..7ec7f4f 100644 --- a/appwrite/services/tokens.py +++ b/appwrite/services/tokens.py @@ -11,7 +11,6 @@ def list(self, bucket_id: str, file_id: str, queries: List[str] = None) -> Dict[ """ List all the tokens created for a specific file or bucket. You can use the query params to filter your results. - Parameters ---------- bucket_id : str @@ -52,7 +51,6 @@ def create_file_token(self, bucket_id: str, file_id: str, expire: str = None) -> """ Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. - Parameters ---------- bucket_id : str @@ -94,7 +92,6 @@ def get(self, token_id: str) -> Dict[str, Any]: """ Get a token by its unique ID. - Parameters ---------- token_id : str @@ -126,7 +123,6 @@ def update(self, token_id: str, expire: str = None) -> Dict[str, Any]: """ Update a token by its unique ID. Use this endpoint to update a token's expiry date. - Parameters ---------- token_id : str @@ -162,7 +158,6 @@ def delete(self, token_id: str) -> Dict[str, Any]: """ Delete a token by its unique ID. - Parameters ---------- token_id : str diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 1af4e41..694657f 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -14,7 +14,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's users. You can use the query params to filter your results. - Parameters ---------- queries : List[str] @@ -46,7 +45,6 @@ def create(self, user_id: str, email: str = None, phone: str = None, password: s """ Create a new user. - Parameters ---------- user_id : str @@ -91,7 +89,6 @@ def create_argon2_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. - Parameters ---------- user_id : str @@ -139,7 +136,6 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. - Parameters ---------- user_id : str @@ -187,7 +183,6 @@ def list_identities(self, queries: List[str] = None, search: str = None) -> Dict """ Get identities for all users. - Parameters ---------- queries : List[str] @@ -219,7 +214,6 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: """ Delete an identity by its unique ID. - Parameters ---------- identity_id : str @@ -252,7 +246,6 @@ def create_md5_user(self, user_id: str, email: str, password: str, name: str = N """ Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. - Parameters ---------- user_id : str @@ -300,7 +293,6 @@ def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. - Parameters ---------- user_id : str @@ -348,7 +340,6 @@ def create_scrypt_user(self, user_id: str, email: str, password: str, password_s """ Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. - Parameters ---------- user_id : str @@ -426,7 +417,6 @@ def create_scrypt_modified_user(self, user_id: str, email: str, password: str, p """ Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. - Parameters ---------- user_id : str @@ -492,7 +482,6 @@ def create_sha_user(self, user_id: str, email: str, password: str, password_vers """ Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. - Parameters ---------- user_id : str @@ -543,7 +532,6 @@ def get(self, user_id: str) -> Dict[str, Any]: """ Get a user by its unique ID. - Parameters ---------- user_id : str @@ -575,7 +563,6 @@ def delete(self, user_id: str) -> Dict[str, Any]: """ Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. - Parameters ---------- user_id : str @@ -608,7 +595,6 @@ def update_email(self, user_id: str, email: str) -> Dict[str, Any]: """ Update the user email by its unique ID. - Parameters ---------- user_id : str @@ -647,7 +633,6 @@ def create_jwt(self, user_id: str, session_id: str = None, duration: float = Non """ Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. - Parameters ---------- user_id : str @@ -688,7 +673,6 @@ def update_labels(self, user_id: str, labels: List[str]) -> Dict[str, Any]: Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. - Parameters ---------- user_id : str @@ -727,7 +711,6 @@ def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get the user activity logs list by its unique ID. - Parameters ---------- user_id : str @@ -762,7 +745,6 @@ def list_memberships(self, user_id: str, queries: List[str] = None, search: str """ Get the user membership list by its unique ID. - Parameters ---------- user_id : str @@ -800,7 +782,6 @@ def update_mfa(self, user_id: str, mfa: bool) -> Dict[str, Any]: """ Enable or disable MFA on a user account. - Parameters ---------- user_id : str @@ -839,7 +820,6 @@ def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType) -> Dic """ Delete an authenticator app. - Parameters ---------- user_id : str @@ -878,7 +858,6 @@ def list_mfa_factors(self, user_id: str) -> Dict[str, Any]: """ List the factors available on the account to be used as a MFA challange. - Parameters ---------- user_id : str @@ -910,7 +889,6 @@ def get_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. - Parameters ---------- user_id : str @@ -942,7 +920,6 @@ def update_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. - Parameters ---------- user_id : str @@ -975,7 +952,6 @@ def create_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. - Parameters ---------- user_id : str @@ -1008,7 +984,6 @@ def update_name(self, user_id: str, name: str) -> Dict[str, Any]: """ Update the user name by its unique ID. - Parameters ---------- user_id : str @@ -1047,7 +1022,6 @@ def update_password(self, user_id: str, password: str) -> Dict[str, Any]: """ Update the user password by its unique ID. - Parameters ---------- user_id : str @@ -1086,7 +1060,6 @@ def update_phone(self, user_id: str, number: str) -> Dict[str, Any]: """ Update the user phone by its unique ID. - Parameters ---------- user_id : str @@ -1125,7 +1098,6 @@ def get_prefs(self, user_id: str) -> Dict[str, Any]: """ Get the user preferences by its unique ID. - Parameters ---------- user_id : str @@ -1157,7 +1129,6 @@ def update_prefs(self, user_id: str, prefs: dict) -> Dict[str, Any]: """ Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. - Parameters ---------- user_id : str @@ -1196,7 +1167,6 @@ def list_sessions(self, user_id: str) -> Dict[str, Any]: """ Get the user sessions list by its unique ID. - Parameters ---------- user_id : str @@ -1230,7 +1200,6 @@ def create_session(self, user_id: str) -> Dict[str, Any]: If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint. - Parameters ---------- user_id : str @@ -1263,7 +1232,6 @@ def delete_sessions(self, user_id: str) -> Dict[str, Any]: """ Delete all user's sessions by using the user's unique ID. - Parameters ---------- user_id : str @@ -1296,7 +1264,6 @@ def delete_session(self, user_id: str, session_id: str) -> Dict[str, Any]: """ Delete a user sessions by its unique ID. - Parameters ---------- user_id : str @@ -1335,7 +1302,6 @@ def update_status(self, user_id: str, status: bool) -> Dict[str, Any]: """ Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. - Parameters ---------- user_id : str @@ -1374,7 +1340,6 @@ def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any """ List the messaging targets that are associated with a user. - Parameters ---------- user_id : str @@ -1409,7 +1374,6 @@ def create_target(self, user_id: str, target_id: str, provider_type: MessagingPr """ Create a messaging target. - Parameters ---------- user_id : str @@ -1466,7 +1430,6 @@ def get_target(self, user_id: str, target_id: str) -> Dict[str, Any]: """ Get a user's push notification target by ID. - Parameters ---------- user_id : str @@ -1504,7 +1467,6 @@ def update_target(self, user_id: str, target_id: str, identifier: str = None, pr """ Update a messaging target. - Parameters ---------- user_id : str @@ -1552,7 +1514,6 @@ def delete_target(self, user_id: str, target_id: str) -> Dict[str, Any]: """ Delete a messaging target. - Parameters ---------- user_id : str @@ -1592,7 +1553,6 @@ def create_token(self, user_id: str, length: float = None, expire: float = None) Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. - Parameters ---------- user_id : str @@ -1631,7 +1591,6 @@ def update_email_verification(self, user_id: str, email_verification: bool) -> D """ Update the user email verification status by its unique ID. - Parameters ---------- user_id : str @@ -1670,7 +1629,6 @@ def update_phone_verification(self, user_id: str, phone_verification: bool) -> D """ Update the user phone verification status by its unique ID. - Parameters ---------- user_id : str From ff8807b39c497d04e5f7adb0cb9570fa2dce2471 Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Thu, 24 Jul 2025 10:41:18 +0000 Subject: [PATCH 59/60] chore: changelog --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 510e270..ff63134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,24 @@ * Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service * Add `dart38` and `flutter332` support to runtime models * Add `gif` support to `ImageFormat` enum +* Add `upsertDocument` support to `Databases` service + +## 11.0.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 10.0.0 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 9.0.3 + +* Update sdk to use Numpy-style docstrings From 228f76bae3a010a176556d3991bf3a9e2a401971 Mon Sep 17 00:00:00 2001 From: root <chiragaggarwal5k@gmail.com> Date: Thu, 24 Jul 2025 10:44:24 +0000 Subject: [PATCH 60/60] fix: version --- appwrite/client.py | 4 +-- appwrite/services/account.py | 31 +++++++++++++++++++++ appwrite/services/avatars.py | 7 +++++ appwrite/services/databases.py | 49 ++++++++++++++++++++++++++++++++++ appwrite/services/functions.py | 24 +++++++++++++++++ appwrite/services/graphql.py | 2 ++ appwrite/services/health.py | 14 ++++++++++ appwrite/services/messaging.py | 46 +++++++++++++++++++++++++++++++ appwrite/services/sites.py | 23 ++++++++++++++++ appwrite/services/storage.py | 13 +++++++++ appwrite/services/teams.py | 13 +++++++++ appwrite/services/tokens.py | 5 ++++ appwrite/services/users.py | 42 +++++++++++++++++++++++++++++ setup.py | 4 +-- 14 files changed, 273 insertions(+), 4 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index b7ab483..ed4d4b5 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/11.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/11.1.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '11.0.0', + 'x-sdk-version': '11.1.0', 'X-Appwrite-Response-Format' : '1.7.0', } diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 9dd3c5e..6062ad4 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -35,6 +35,7 @@ def create(self, user_id: str, email: str, password: str, name: str = None) -> D """ Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). + Parameters ---------- user_id : str @@ -84,6 +85,7 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]: This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + Parameters ---------- email : str @@ -122,6 +124,7 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]: """ Get the list of identities for the currently logged in user. + Parameters ---------- queries : List[str] @@ -150,6 +153,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: """ Delete an identity by its unique ID. + Parameters ---------- identity_id : str @@ -204,6 +208,7 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]: """ Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. + Parameters ---------- queries : List[str] @@ -232,6 +237,7 @@ def update_mfa(self, mfa: bool) -> Dict[str, Any]: """ Enable or disable MFA on an account. + Parameters ---------- mfa : bool @@ -264,6 +270,7 @@ def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: """ Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. + Parameters ---------- type : AuthenticatorType @@ -296,6 +303,7 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[st """ Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. + Parameters ---------- type : AuthenticatorType @@ -334,6 +342,7 @@ def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]: """ Delete an authenticator for a user by ID. + Parameters ---------- type : AuthenticatorType @@ -366,6 +375,7 @@ def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]: """ Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. + Parameters ---------- factor : AuthenticationFactor @@ -398,6 +408,7 @@ def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]: """ Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. + Parameters ---------- challenge_id : str @@ -522,6 +533,7 @@ def update_name(self, name: str) -> Dict[str, Any]: """ Update currently logged in user account name. + Parameters ---------- name : str @@ -554,6 +566,7 @@ def update_password(self, password: str, old_password: str = None) -> Dict[str, """ Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. + Parameters ---------- password : str @@ -589,6 +602,7 @@ def update_phone(self, phone: str, password: str) -> Dict[str, Any]: """ Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. + Parameters ---------- phone : str @@ -648,6 +662,7 @@ def update_prefs(self, prefs: dict) -> Dict[str, Any]: """ Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. + Parameters ---------- prefs : dict @@ -680,6 +695,7 @@ def create_recovery(self, email: str, url: str) -> Dict[str, Any]: """ Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. + Parameters ---------- email : str @@ -720,6 +736,7 @@ def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str, Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + Parameters ---------- user_id : str @@ -831,6 +848,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str, A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- email : str @@ -869,6 +887,7 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters ---------- user_id : str @@ -907,6 +926,7 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters ---------- user_id : str @@ -945,6 +965,7 @@ def create_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. + Parameters ---------- user_id : str @@ -983,6 +1004,7 @@ def get_session(self, session_id: str) -> Dict[str, Any]: """ Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. + Parameters ---------- session_id : str @@ -1014,6 +1036,7 @@ def update_session(self, session_id: str) -> Dict[str, Any]: """ Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. + Parameters ---------- session_id : str @@ -1046,6 +1069,7 @@ def delete_session(self, session_id: str) -> Dict[str, Any]: """ Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. + Parameters ---------- session_id : str @@ -1102,6 +1126,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1146,6 +1171,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1194,6 +1220,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- provider : OAuthProvider @@ -1236,6 +1263,7 @@ def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]: A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + Parameters ---------- user_id : str @@ -1277,6 +1305,7 @@ def create_verification(self, url: str) -> Dict[str, Any]: Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + Parameters ---------- url : str @@ -1309,6 +1338,7 @@ def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. + Parameters ---------- user_id : str @@ -1369,6 +1399,7 @@ def update_phone_verification(self, user_id: str, secret: str) -> Dict[str, Any] """ Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. + Parameters ---------- user_id : str diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 6ee1d4f..2bd32f7 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -16,6 +16,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : Browser @@ -59,6 +60,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : CreditCard @@ -101,6 +103,7 @@ def get_favicon(self, url: str) -> bytes: This endpoint does not follow HTTP redirects. + Parameters ---------- url : str @@ -135,6 +138,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- code : Flag @@ -179,6 +183,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte This endpoint does not follow HTTP redirects. + Parameters ---------- url : str @@ -221,6 +226,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + Parameters ---------- name : str @@ -259,6 +265,7 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download: Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. + Parameters ---------- text : str diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index b025e0c..40b7372 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -14,6 +14,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. + Parameters ---------- queries : List[str] @@ -46,6 +47,7 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Create a new Database. + Parameters ---------- database_id : str @@ -87,6 +89,7 @@ def get(self, database_id: str) -> Dict[str, Any]: """ Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. + Parameters ---------- database_id : str @@ -118,6 +121,7 @@ def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, """ Update a database by its unique ID. + Parameters ---------- database_id : str @@ -159,6 +163,7 @@ def delete(self, database_id: str) -> Dict[str, Any]: """ Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. + Parameters ---------- database_id : str @@ -191,6 +196,7 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: """ Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. + Parameters ---------- database_id : str @@ -228,6 +234,7 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per """ Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + Parameters ---------- database_id : str @@ -281,6 +288,7 @@ def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any] """ Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. + Parameters ---------- database_id : str @@ -318,6 +326,7 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per """ Update a collection by its unique ID. + Parameters ---------- database_id : str @@ -371,6 +380,7 @@ def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, A """ Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. + Parameters ---------- database_id : str @@ -409,6 +419,7 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st """ List attributes in the collection. + Parameters ---------- database_id : str @@ -450,6 +461,7 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st Create a boolean attribute. + Parameters ---------- database_id : str @@ -506,6 +518,7 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st """ Update a boolean attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -562,6 +575,7 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s """ Create a date time attribute according to the ISO 8601 standard. + Parameters ---------- database_id : str @@ -618,6 +632,7 @@ def update_datetime_attribute(self, database_id: str, collection_id: str, key: s """ Update a date time attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -675,6 +690,7 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, Create an email attribute. + Parameters ---------- database_id : str @@ -732,6 +748,7 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, Update an email attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -789,6 +806,7 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. + Parameters ---------- database_id : str @@ -852,6 +870,7 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, Update an enum attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -915,6 +934,7 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, Create a float attribute. Optionally, minimum and maximum values can be provided. + Parameters ---------- database_id : str @@ -978,6 +998,7 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, Update a float attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1041,6 +1062,7 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st Create an integer attribute. Optionally, minimum and maximum values can be provided. + Parameters ---------- database_id : str @@ -1104,6 +1126,7 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st Update an integer attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1167,6 +1190,7 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re Create IP address attribute. + Parameters ---------- database_id : str @@ -1224,6 +1248,7 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re Update an ip attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1281,6 +1306,7 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + Parameters ---------- database_id : str @@ -1344,6 +1370,7 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str Create a string attribute. + Parameters ---------- database_id : str @@ -1410,6 +1437,7 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str Update a string attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1470,6 +1498,7 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r Create a URL attribute. + Parameters ---------- database_id : str @@ -1527,6 +1556,7 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r Update an url attribute. Changing the `default` value will not update already existing documents. + Parameters ---------- database_id : str @@ -1583,6 +1613,7 @@ def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[ """ Get attribute by ID. + Parameters ---------- database_id : str @@ -1626,6 +1657,7 @@ def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Di """ Deletes an attribute. + Parameters ---------- database_id : str @@ -1671,6 +1703,7 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + Parameters ---------- database_id : str @@ -1721,6 +1754,7 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str """ Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + Parameters ---------- database_id : str @@ -1761,6 +1795,7 @@ def create_document(self, database_id: str, collection_id: str, document_id: str """ Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + Parameters ---------- database_id : str @@ -1816,6 +1851,7 @@ def create_documents(self, database_id: str, collection_id: str, documents: List Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + Parameters ---------- database_id : str @@ -1863,6 +1899,7 @@ def upsert_documents(self, database_id: str, collection_id: str, documents: List Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + Parameters ---------- database_id : str @@ -1909,6 +1946,7 @@ def update_documents(self, database_id: str, collection_id: str, data: dict = No Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. + Parameters ---------- database_id : str @@ -1955,6 +1993,7 @@ def delete_documents(self, database_id: str, collection_id: str, queries: List[s Bulk delete documents using queries, if no queries are passed then all documents are deleted. + Parameters ---------- database_id : str @@ -1996,6 +2035,7 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q """ Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + Parameters ---------- database_id : str @@ -2044,6 +2084,7 @@ def upsert_document(self, database_id: str, collection_id: str, document_id: str Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + Parameters ---------- database_id : str @@ -2097,6 +2138,7 @@ def update_document(self, database_id: str, collection_id: str, document_id: str """ Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + Parameters ---------- database_id : str @@ -2147,6 +2189,7 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str """ Delete a document by its unique ID. + Parameters ---------- database_id : str @@ -2191,6 +2234,7 @@ def decrement_document_attribute(self, database_id: str, collection_id: str, doc """ Decrement a specific attribute of a document by a given value. + Parameters ---------- database_id : str @@ -2247,6 +2291,7 @@ def increment_document_attribute(self, database_id: str, collection_id: str, doc """ Increment a specific attribute of a document by a given value. + Parameters ---------- database_id : str @@ -2303,6 +2348,7 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] """ List indexes in the collection. + Parameters ---------- database_id : str @@ -2344,6 +2390,7 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be `key`, `fulltext`, and `unique`. + Parameters ---------- database_id : str @@ -2406,6 +2453,7 @@ def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, """ Get index by ID. + Parameters ---------- database_id : str @@ -2449,6 +2497,7 @@ def delete_index(self, database_id: str, collection_id: str, key: str) -> Dict[s """ Delete an index. + Parameters ---------- database_id : str diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 9dce425..3dd2459 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -16,6 +16,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's functions. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -47,6 +48,7 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st """ Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. + Parameters ---------- function_id : str @@ -178,6 +180,7 @@ def get(self, function_id: str) -> Dict[str, Any]: """ Get a function by its unique ID. + Parameters ---------- function_id : str @@ -209,6 +212,7 @@ def update(self, function_id: str, name: str, runtime: Runtime = None, execute: """ Update function by its unique ID. + Parameters ---------- function_id : str @@ -295,6 +299,7 @@ def delete(self, function_id: str) -> Dict[str, Any]: """ Delete a function by its unique ID. + Parameters ---------- function_id : str @@ -327,6 +332,7 @@ def update_function_deployment(self, function_id: str, deployment_id: str) -> Di """ Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function. + Parameters ---------- function_id : str @@ -365,6 +371,7 @@ def list_deployments(self, function_id: str, queries: List[str] = None, search: """ Get a list of all the function's code deployments. You can use the query params to filter your results. + Parameters ---------- function_id : str @@ -406,6 +413,7 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e Use the "command" param to set the entrypoint used to execute your code. + Parameters ---------- function_id : str @@ -463,6 +471,7 @@ def create_duplicate_deployment(self, function_id: str, deployment_id: str, buil """ Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + Parameters ---------- function_id : str @@ -506,6 +515,7 @@ def create_template_deployment(self, function_id: str, repository: str, owner: s Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. + Parameters ---------- function_id : str @@ -567,6 +577,7 @@ def create_vcs_deployment(self, function_id: str, type: VCSDeploymentType, refer This endpoint lets you create deployment from a branch, commit, or a tag. + Parameters ---------- function_id : str @@ -614,6 +625,7 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any] """ Get a function deployment by its unique ID. + Parameters ---------- function_id : str @@ -651,6 +663,7 @@ def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, A """ Delete a code deployment by its unique ID. + Parameters ---------- function_id : str @@ -689,6 +702,7 @@ def get_deployment_download(self, function_id: str, deployment_id: str, type: De """ Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + Parameters ---------- function_id : str @@ -729,6 +743,7 @@ def update_deployment_status(self, function_id: str, deployment_id: str) -> Dict """ Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + Parameters ---------- function_id : str @@ -767,6 +782,7 @@ def list_executions(self, function_id: str, queries: List[str] = None) -> Dict[s """ Get a list of all the current user function execution logs. You can use the query params to filter your results. + Parameters ---------- function_id : str @@ -801,6 +817,7 @@ def create_execution(self, function_id: str, body: str = None, xasync: bool = No """ Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. + Parameters ---------- function_id : str @@ -851,6 +868,7 @@ def get_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]: """ Get a function execution log by its unique ID. + Parameters ---------- function_id : str @@ -888,6 +906,7 @@ def delete_execution(self, function_id: str, execution_id: str) -> Dict[str, Any """ Delete a function execution by its unique ID. + Parameters ---------- function_id : str @@ -926,6 +945,7 @@ def list_variables(self, function_id: str) -> Dict[str, Any]: """ Get a list of all variables of a specific function. + Parameters ---------- function_id : str @@ -957,6 +977,7 @@ def create_variable(self, function_id: str, key: str, value: str, secret: bool = """ Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. + Parameters ---------- function_id : str @@ -1004,6 +1025,7 @@ def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: """ Get a variable by its unique ID. + Parameters ---------- function_id : str @@ -1041,6 +1063,7 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s """ Update variable by its unique ID. + Parameters ---------- function_id : str @@ -1091,6 +1114,7 @@ def delete_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: """ Delete a variable by its unique ID. + Parameters ---------- function_id : str diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 22ca3aa..69ad4e0 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -11,6 +11,7 @@ def query(self, query: dict) -> Dict[str, Any]: """ Execute a GraphQL mutation. + Parameters ---------- query : dict @@ -44,6 +45,7 @@ def mutation(self, query: dict) -> Dict[str, Any]: """ Execute a GraphQL mutation. + Parameters ---------- query : dict diff --git a/appwrite/services/health.py b/appwrite/services/health.py index dd1d183..665fd1e 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -75,6 +75,7 @@ def get_certificate(self, domain: str = None) -> Dict[str, Any]: """ Get the SSL certificate for a domain + Parameters ---------- domain : str @@ -145,6 +146,7 @@ def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of builds that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -173,6 +175,7 @@ def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -201,6 +204,7 @@ def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict """ Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- name : str @@ -232,6 +236,7 @@ def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -261,6 +266,7 @@ def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any] Returns the amount of failed jobs in a given queue. + Parameters ---------- name : Name @@ -295,6 +301,7 @@ def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -323,6 +330,7 @@ def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of logs that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -351,6 +359,7 @@ def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of mails that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -379,6 +388,7 @@ def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of messages that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -407,6 +417,7 @@ def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -435,6 +446,7 @@ def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. + Parameters ---------- threshold : float @@ -463,6 +475,7 @@ def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float @@ -491,6 +504,7 @@ def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: """ Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. + Parameters ---------- threshold : float diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 639a820..153a1f7 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -13,6 +13,7 @@ def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[s """ Get a list of all messages from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -44,6 +45,7 @@ def create_email(self, message_id: str, subject: str, content: str, topics: List """ Create a new email message. + Parameters ---------- message_id : str @@ -116,6 +118,7 @@ def update_email(self, message_id: str, topics: List[str] = None, users: List[st Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -181,6 +184,7 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi """ Create a new push notification. + Parameters ---------- message_id : str @@ -268,6 +272,7 @@ def update_push(self, message_id: str, topics: List[str] = None, users: List[str Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -354,6 +359,7 @@ def create_sms(self, message_id: str, content: str, topics: List[str] = None, us """ Create a new SMS message. + Parameters ---------- message_id : str @@ -408,6 +414,7 @@ def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + Parameters ---------- message_id : str @@ -459,6 +466,7 @@ def get_message(self, message_id: str) -> Dict[str, Any]: Get a message by its unique ID. + Parameters ---------- message_id : str @@ -490,6 +498,7 @@ def delete(self, message_id: str) -> Dict[str, Any]: """ Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message. + Parameters ---------- message_id : str @@ -522,6 +531,7 @@ def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[ """ Get the message activity logs listed by its unique ID. + Parameters ---------- message_id : str @@ -556,6 +566,7 @@ def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, """ Get a list of the targets associated with a message. + Parameters ---------- message_id : str @@ -590,6 +601,7 @@ def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[ """ Get a list of all providers from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -621,6 +633,7 @@ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None """ Create a new Apple Push Notification service provider. + Parameters ---------- provider_id : str @@ -677,6 +690,7 @@ def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool """ Update a Apple Push Notification service provider by its unique ID. + Parameters ---------- provider_id : str @@ -730,6 +744,7 @@ def create_fcm_provider(self, provider_id: str, name: str, service_account_json: """ Create a new Firebase Cloud Messaging provider. + Parameters ---------- provider_id : str @@ -774,6 +789,7 @@ def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool """ Update a Firebase Cloud Messaging provider by its unique ID. + Parameters ---------- provider_id : str @@ -815,6 +831,7 @@ def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = No """ Create a new Mailgun provider. + Parameters ---------- provider_id : str @@ -877,6 +894,7 @@ def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: s """ Update a Mailgun provider by its unique ID. + Parameters ---------- provider_id : str @@ -936,6 +954,7 @@ def create_msg91_provider(self, provider_id: str, name: str, template_id: str = """ Create a new MSG91 provider. + Parameters ---------- provider_id : str @@ -986,6 +1005,7 @@ def update_msg91_provider(self, provider_id: str, name: str = None, enabled: boo """ Update a MSG91 provider by its unique ID. + Parameters ---------- provider_id : str @@ -1033,6 +1053,7 @@ def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = N """ Create a new Sendgrid provider. + Parameters ---------- provider_id : str @@ -1089,6 +1110,7 @@ def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: """ Update a Sendgrid provider by its unique ID. + Parameters ---------- provider_id : str @@ -1142,6 +1164,7 @@ def create_smtp_provider(self, provider_id: str, name: str, host: str, port: flo """ Create a new SMTP provider. + Parameters ---------- provider_id : str @@ -1219,6 +1242,7 @@ def update_smtp_provider(self, provider_id: str, name: str = None, host: str = N """ Update a SMTP provider by its unique ID. + Parameters ---------- provider_id : str @@ -1290,6 +1314,7 @@ def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = Non """ Create a new Telesign provider. + Parameters ---------- provider_id : str @@ -1340,6 +1365,7 @@ def update_telesign_provider(self, provider_id: str, name: str = None, enabled: """ Update a Telesign provider by its unique ID. + Parameters ---------- provider_id : str @@ -1387,6 +1413,7 @@ def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = No """ Create a new Textmagic provider. + Parameters ---------- provider_id : str @@ -1437,6 +1464,7 @@ def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: """ Update a Textmagic provider by its unique ID. + Parameters ---------- provider_id : str @@ -1484,6 +1512,7 @@ def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, """ Create a new Twilio provider. + Parameters ---------- provider_id : str @@ -1534,6 +1563,7 @@ def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bo """ Update a Twilio provider by its unique ID. + Parameters ---------- provider_id : str @@ -1581,6 +1611,7 @@ def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, """ Create a new Vonage provider. + Parameters ---------- provider_id : str @@ -1631,6 +1662,7 @@ def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bo """ Update a Vonage provider by its unique ID. + Parameters ---------- provider_id : str @@ -1679,6 +1711,7 @@ def get_provider(self, provider_id: str) -> Dict[str, Any]: Get a provider by its unique ID. + Parameters ---------- provider_id : str @@ -1710,6 +1743,7 @@ def delete_provider(self, provider_id: str) -> Dict[str, Any]: """ Delete a provider by its unique ID. + Parameters ---------- provider_id : str @@ -1742,6 +1776,7 @@ def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dic """ Get the provider activity logs listed by its unique ID. + Parameters ---------- provider_id : str @@ -1776,6 +1811,7 @@ def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> """ Get the subscriber activity logs listed by its unique ID. + Parameters ---------- subscriber_id : str @@ -1810,6 +1846,7 @@ def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str """ Get a list of all topics from the current Appwrite project. + Parameters ---------- queries : List[str] @@ -1841,6 +1878,7 @@ def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None) -> """ Create a new topic. + Parameters ---------- topic_id : str @@ -1883,6 +1921,7 @@ def get_topic(self, topic_id: str) -> Dict[str, Any]: Get a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1915,6 +1954,7 @@ def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = N Update a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1953,6 +1993,7 @@ def delete_topic(self, topic_id: str) -> Dict[str, Any]: """ Delete a topic by its unique ID. + Parameters ---------- topic_id : str @@ -1985,6 +2026,7 @@ def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, """ Get the topic activity logs listed by its unique ID. + Parameters ---------- topic_id : str @@ -2019,6 +2061,7 @@ def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str """ Get a list of all subscribers from the current Appwrite project. + Parameters ---------- topic_id : str @@ -2056,6 +2099,7 @@ def create_subscriber(self, topic_id: str, subscriber_id: str, target_id: str) - """ Create a new subscriber. + Parameters ---------- topic_id : str @@ -2101,6 +2145,7 @@ def get_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any]: Get a subscriber by its unique ID. + Parameters ---------- topic_id : str @@ -2138,6 +2183,7 @@ def delete_subscriber(self, topic_id: str, subscriber_id: str) -> Dict[str, Any] """ Delete a subscriber by its unique ID. + Parameters ---------- topic_id : str diff --git a/appwrite/services/sites.py b/appwrite/services/sites.py index bcb7597..857cabe 100644 --- a/appwrite/services/sites.py +++ b/appwrite/services/sites.py @@ -17,6 +17,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's sites. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -48,6 +49,7 @@ def create(self, site_id: str, name: str, framework: Framework, build_runtime: B """ Create a new site. + Parameters ---------- site_id : str @@ -182,6 +184,7 @@ def get(self, site_id: str) -> Dict[str, Any]: """ Get a site by its unique ID. + Parameters ---------- site_id : str @@ -213,6 +216,7 @@ def update(self, site_id: str, name: str, framework: Framework, enabled: bool = """ Update site by its unique ID. + Parameters ---------- site_id : str @@ -302,6 +306,7 @@ def delete(self, site_id: str) -> Dict[str, Any]: """ Delete a site by its unique ID. + Parameters ---------- site_id : str @@ -334,6 +339,7 @@ def update_site_deployment(self, site_id: str, deployment_id: str) -> Dict[str, """ Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site. + Parameters ---------- site_id : str @@ -372,6 +378,7 @@ def list_deployments(self, site_id: str, queries: List[str] = None, search: str """ Get a list of all the site's code deployments. You can use the query params to filter your results. + Parameters ---------- site_id : str @@ -409,6 +416,7 @@ def create_deployment(self, site_id: str, code: InputFile, activate: bool, insta """ Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID. + Parameters ---------- site_id : str @@ -469,6 +477,7 @@ def create_duplicate_deployment(self, site_id: str, deployment_id: str) -> Dict[ """ Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + Parameters ---------- site_id : str @@ -509,6 +518,7 @@ def create_template_deployment(self, site_id: str, repository: str, owner: str, Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. + Parameters ---------- site_id : str @@ -570,6 +580,7 @@ def create_vcs_deployment(self, site_id: str, type: VCSDeploymentType, reference This endpoint lets you create deployment from a branch, commit, or a tag. + Parameters ---------- site_id : str @@ -617,6 +628,7 @@ def get_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: """ Get a site deployment by its unique ID. + Parameters ---------- site_id : str @@ -654,6 +666,7 @@ def delete_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: """ Delete a site deployment by its unique ID. + Parameters ---------- site_id : str @@ -692,6 +705,7 @@ def get_deployment_download(self, site_id: str, deployment_id: str, type: Deploy """ Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + Parameters ---------- site_id : str @@ -732,6 +746,7 @@ def update_deployment_status(self, site_id: str, deployment_id: str) -> Dict[str """ Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + Parameters ---------- site_id : str @@ -770,6 +785,7 @@ def list_logs(self, site_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get a list of all site logs. You can use the query params to filter your results. + Parameters ---------- site_id : str @@ -804,6 +820,7 @@ def get_log(self, site_id: str, log_id: str) -> Dict[str, Any]: """ Get a site request log by its unique ID. + Parameters ---------- site_id : str @@ -841,6 +858,7 @@ def delete_log(self, site_id: str, log_id: str) -> Dict[str, Any]: """ Delete a site log by its unique ID. + Parameters ---------- site_id : str @@ -879,6 +897,7 @@ def list_variables(self, site_id: str) -> Dict[str, Any]: """ Get a list of all variables of a specific site. + Parameters ---------- site_id : str @@ -910,6 +929,7 @@ def create_variable(self, site_id: str, key: str, value: str, secret: bool = Non """ Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. + Parameters ---------- site_id : str @@ -957,6 +977,7 @@ def get_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: """ Get a variable by its unique ID. + Parameters ---------- site_id : str @@ -994,6 +1015,7 @@ def update_variable(self, site_id: str, variable_id: str, key: str, value: str = """ Update variable by its unique ID. + Parameters ---------- site_id : str @@ -1044,6 +1066,7 @@ def delete_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: """ Delete a variable by its unique ID. + Parameters ---------- site_id : str diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 22198eb..e970187 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -15,6 +15,7 @@ def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[st """ Get a list of all the storage buckets. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -46,6 +47,7 @@ def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None """ Create a new storage bucket. + Parameters ---------- bucket_id : str @@ -108,6 +110,7 @@ def get_bucket(self, bucket_id: str) -> Dict[str, Any]: """ Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata. + Parameters ---------- bucket_id : str @@ -139,6 +142,7 @@ def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None """ Update a storage bucket by its unique ID. + Parameters ---------- bucket_id : str @@ -201,6 +205,7 @@ def delete_bucket(self, bucket_id: str) -> Dict[str, Any]: """ Delete a storage bucket by its unique ID. + Parameters ---------- bucket_id : str @@ -233,6 +238,7 @@ def list_files(self, bucket_id: str, queries: List[str] = None, search: str = No """ Get a list of all the user files. You can use the query params to filter your results. + Parameters ---------- bucket_id : str @@ -277,6 +283,7 @@ def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. + Parameters ---------- bucket_id : str @@ -332,6 +339,7 @@ def get_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. + Parameters ---------- bucket_id : str @@ -369,6 +377,7 @@ def update_file(self, bucket_id: str, file_id: str, name: str = None, permission """ Update a file by its unique ID. Only users with write permissions have access to update this resource. + Parameters ---------- bucket_id : str @@ -413,6 +422,7 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: """ Delete a file by its unique ID. Only users with write permissions have access to delete this resource. + Parameters ---------- bucket_id : str @@ -451,6 +461,7 @@ def get_file_download(self, bucket_id: str, file_id: str, token: str = None) -> """ Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + Parameters ---------- bucket_id : str @@ -491,6 +502,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he """ Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. + Parameters ---------- bucket_id : str @@ -564,6 +576,7 @@ def get_file_view(self, bucket_id: str, file_id: str, token: str = None) -> byte """ Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. + Parameters ---------- bucket_id : str diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 808dc2a..50e0297 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -11,6 +11,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. + Parameters ---------- queries : List[str] @@ -42,6 +43,7 @@ def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, """ Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. + Parameters ---------- team_id : str @@ -83,6 +85,7 @@ def get(self, team_id: str) -> Dict[str, Any]: """ Get a team by its ID. All team members have read access for this resource. + Parameters ---------- team_id : str @@ -114,6 +117,7 @@ def update_name(self, team_id: str, name: str) -> Dict[str, Any]: """ Update the team's name by its unique ID. + Parameters ---------- team_id : str @@ -152,6 +156,7 @@ def delete(self, team_id: str) -> Dict[str, Any]: """ Delete a team using its ID. Only team members with the owner role can delete the team. + Parameters ---------- team_id : str @@ -184,6 +189,7 @@ def list_memberships(self, team_id: str, queries: List[str] = None, search: str """ Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. + Parameters ---------- team_id : str @@ -228,6 +234,7 @@ def create_membership(self, team_id: str, roles: List[str], email: str = None, u Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. + Parameters ---------- team_id : str @@ -281,6 +288,7 @@ def get_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: """ Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. + Parameters ---------- team_id : str @@ -319,6 +327,7 @@ def update_membership(self, team_id: str, membership_id: str, roles: List[str]) Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). + Parameters ---------- team_id : str @@ -363,6 +372,7 @@ def delete_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]: """ This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted. + Parameters ---------- team_id : str @@ -404,6 +414,7 @@ def update_membership_status(self, team_id: str, membership_id: str, user_id: st If the request is successful, a session for the user is automatically created. + Parameters ---------- team_id : str @@ -454,6 +465,7 @@ def get_prefs(self, team_id: str) -> Dict[str, Any]: """ Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). + Parameters ---------- team_id : str @@ -485,6 +497,7 @@ def update_prefs(self, team_id: str, prefs: dict) -> Dict[str, Any]: """ Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. + Parameters ---------- team_id : str diff --git a/appwrite/services/tokens.py b/appwrite/services/tokens.py index 7ec7f4f..93ba739 100644 --- a/appwrite/services/tokens.py +++ b/appwrite/services/tokens.py @@ -11,6 +11,7 @@ def list(self, bucket_id: str, file_id: str, queries: List[str] = None) -> Dict[ """ List all the tokens created for a specific file or bucket. You can use the query params to filter your results. + Parameters ---------- bucket_id : str @@ -51,6 +52,7 @@ def create_file_token(self, bucket_id: str, file_id: str, expire: str = None) -> """ Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. + Parameters ---------- bucket_id : str @@ -92,6 +94,7 @@ def get(self, token_id: str) -> Dict[str, Any]: """ Get a token by its unique ID. + Parameters ---------- token_id : str @@ -123,6 +126,7 @@ def update(self, token_id: str, expire: str = None) -> Dict[str, Any]: """ Update a token by its unique ID. Use this endpoint to update a token's expiry date. + Parameters ---------- token_id : str @@ -158,6 +162,7 @@ def delete(self, token_id: str) -> Dict[str, Any]: """ Delete a token by its unique ID. + Parameters ---------- token_id : str diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 694657f..1af4e41 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -14,6 +14,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: """ Get a list of all the project's users. You can use the query params to filter your results. + Parameters ---------- queries : List[str] @@ -45,6 +46,7 @@ def create(self, user_id: str, email: str = None, phone: str = None, password: s """ Create a new user. + Parameters ---------- user_id : str @@ -89,6 +91,7 @@ def create_argon2_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -136,6 +139,7 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -183,6 +187,7 @@ def list_identities(self, queries: List[str] = None, search: str = None) -> Dict """ Get identities for all users. + Parameters ---------- queries : List[str] @@ -214,6 +219,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: """ Delete an identity by its unique ID. + Parameters ---------- identity_id : str @@ -246,6 +252,7 @@ def create_md5_user(self, user_id: str, email: str, password: str, name: str = N """ Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -293,6 +300,7 @@ def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str """ Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -340,6 +348,7 @@ def create_scrypt_user(self, user_id: str, email: str, password: str, password_s """ Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -417,6 +426,7 @@ def create_scrypt_modified_user(self, user_id: str, email: str, password: str, p """ Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -482,6 +492,7 @@ def create_sha_user(self, user_id: str, email: str, password: str, password_vers """ Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. + Parameters ---------- user_id : str @@ -532,6 +543,7 @@ def get(self, user_id: str) -> Dict[str, Any]: """ Get a user by its unique ID. + Parameters ---------- user_id : str @@ -563,6 +575,7 @@ def delete(self, user_id: str) -> Dict[str, Any]: """ Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. + Parameters ---------- user_id : str @@ -595,6 +608,7 @@ def update_email(self, user_id: str, email: str) -> Dict[str, Any]: """ Update the user email by its unique ID. + Parameters ---------- user_id : str @@ -633,6 +647,7 @@ def create_jwt(self, user_id: str, session_id: str = None, duration: float = Non """ Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. + Parameters ---------- user_id : str @@ -673,6 +688,7 @@ def update_labels(self, user_id: str, labels: List[str]) -> Dict[str, Any]: Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. + Parameters ---------- user_id : str @@ -711,6 +727,7 @@ def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: """ Get the user activity logs list by its unique ID. + Parameters ---------- user_id : str @@ -745,6 +762,7 @@ def list_memberships(self, user_id: str, queries: List[str] = None, search: str """ Get the user membership list by its unique ID. + Parameters ---------- user_id : str @@ -782,6 +800,7 @@ def update_mfa(self, user_id: str, mfa: bool) -> Dict[str, Any]: """ Enable or disable MFA on a user account. + Parameters ---------- user_id : str @@ -820,6 +839,7 @@ def delete_mfa_authenticator(self, user_id: str, type: AuthenticatorType) -> Dic """ Delete an authenticator app. + Parameters ---------- user_id : str @@ -858,6 +878,7 @@ def list_mfa_factors(self, user_id: str) -> Dict[str, Any]: """ List the factors available on the account to be used as a MFA challange. + Parameters ---------- user_id : str @@ -889,6 +910,7 @@ def get_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. + Parameters ---------- user_id : str @@ -920,6 +942,7 @@ def update_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. + Parameters ---------- user_id : str @@ -952,6 +975,7 @@ def create_mfa_recovery_codes(self, user_id: str) -> Dict[str, Any]: """ Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. + Parameters ---------- user_id : str @@ -984,6 +1008,7 @@ def update_name(self, user_id: str, name: str) -> Dict[str, Any]: """ Update the user name by its unique ID. + Parameters ---------- user_id : str @@ -1022,6 +1047,7 @@ def update_password(self, user_id: str, password: str) -> Dict[str, Any]: """ Update the user password by its unique ID. + Parameters ---------- user_id : str @@ -1060,6 +1086,7 @@ def update_phone(self, user_id: str, number: str) -> Dict[str, Any]: """ Update the user phone by its unique ID. + Parameters ---------- user_id : str @@ -1098,6 +1125,7 @@ def get_prefs(self, user_id: str) -> Dict[str, Any]: """ Get the user preferences by its unique ID. + Parameters ---------- user_id : str @@ -1129,6 +1157,7 @@ def update_prefs(self, user_id: str, prefs: dict) -> Dict[str, Any]: """ Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. + Parameters ---------- user_id : str @@ -1167,6 +1196,7 @@ def list_sessions(self, user_id: str) -> Dict[str, Any]: """ Get the user sessions list by its unique ID. + Parameters ---------- user_id : str @@ -1200,6 +1230,7 @@ def create_session(self, user_id: str) -> Dict[str, Any]: If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint. + Parameters ---------- user_id : str @@ -1232,6 +1263,7 @@ def delete_sessions(self, user_id: str) -> Dict[str, Any]: """ Delete all user's sessions by using the user's unique ID. + Parameters ---------- user_id : str @@ -1264,6 +1296,7 @@ def delete_session(self, user_id: str, session_id: str) -> Dict[str, Any]: """ Delete a user sessions by its unique ID. + Parameters ---------- user_id : str @@ -1302,6 +1335,7 @@ def update_status(self, user_id: str, status: bool) -> Dict[str, Any]: """ Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. + Parameters ---------- user_id : str @@ -1340,6 +1374,7 @@ def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any """ List the messaging targets that are associated with a user. + Parameters ---------- user_id : str @@ -1374,6 +1409,7 @@ def create_target(self, user_id: str, target_id: str, provider_type: MessagingPr """ Create a messaging target. + Parameters ---------- user_id : str @@ -1430,6 +1466,7 @@ def get_target(self, user_id: str, target_id: str) -> Dict[str, Any]: """ Get a user's push notification target by ID. + Parameters ---------- user_id : str @@ -1467,6 +1504,7 @@ def update_target(self, user_id: str, target_id: str, identifier: str = None, pr """ Update a messaging target. + Parameters ---------- user_id : str @@ -1514,6 +1552,7 @@ def delete_target(self, user_id: str, target_id: str) -> Dict[str, Any]: """ Delete a messaging target. + Parameters ---------- user_id : str @@ -1553,6 +1592,7 @@ def create_token(self, user_id: str, length: float = None, expire: float = None) Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. + Parameters ---------- user_id : str @@ -1591,6 +1631,7 @@ def update_email_verification(self, user_id: str, email_verification: bool) -> D """ Update the user email verification status by its unique ID. + Parameters ---------- user_id : str @@ -1629,6 +1670,7 @@ def update_phone_verification(self, user_id: str, phone_verification: bool) -> D """ Update the user phone verification status by its unique ID. + Parameters ---------- user_id : str diff --git a/setup.py b/setup.py index 5c6270f..18c78cc 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '11.0.0', + version = '11.1.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/11.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/11.1.0.tar.gz', install_requires=[ 'requests', ], <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy