From 94df3f4d3b68fca40ca057f81e1f05ec9919654e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 Feb 2024 23:40:58 +1300 Subject: [PATCH 01/10] 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 02/10] 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 03/10] 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 04/10] 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 05/10] 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 06/10] 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 07/10] 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 08/10] 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 09/10] 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 10/10] 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 +)