From e63795377d585265cef8ea967123e900f9c81dc8 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Oct 2025 03:35:30 +0000 Subject: [PATCH 1/2] regen --- CHANGELOG.md | 5 + appwrite/client.py | 6 +- appwrite/enums/execution_status.py | 1 + appwrite/enums/framework.py | 1 + appwrite/services/account.py | 41 +- appwrite/services/avatars.py | 51 +- appwrite/services/databases.py | 374 ++++++----- appwrite/services/functions.py | 131 ++-- appwrite/services/graphql.py | 3 +- appwrite/services/health.py | 61 +- appwrite/services/locale.py | 3 +- appwrite/services/messaging.py | 586 +++++++++++------- appwrite/services/sites.py | 111 ++-- appwrite/services/storage.py | 95 +-- appwrite/services/tables_db.py | 321 +++++----- appwrite/services/teams.py | 31 +- appwrite/services/tokens.py | 15 +- appwrite/services/users.py | 95 +-- appwrite/utils/__init__.py | 1 + appwrite/utils/deprecated.py | 51 ++ docs/examples/databases/create-collection.md | 4 +- docs/examples/databases/create-document.md | 4 +- docs/examples/databases/update-collection.md | 4 +- docs/examples/databases/update-document.md | 4 +- docs/examples/databases/upsert-document.md | 4 +- .../messaging/create-resend-provider.md | 20 + .../messaging/update-resend-provider.md | 20 + docs/examples/storage/create-bucket.md | 4 +- docs/examples/storage/create-file.md | 4 +- docs/examples/storage/update-bucket.md | 4 +- docs/examples/storage/update-file.md | 4 +- docs/examples/tablesdb/create-row.md | 4 +- docs/examples/tablesdb/create-table.md | 4 +- docs/examples/tablesdb/update-row.md | 4 +- docs/examples/tablesdb/update-table.md | 4 +- docs/examples/tablesdb/upsert-row.md | 4 +- setup.py | 13 +- 37 files changed, 1197 insertions(+), 895 deletions(-) create mode 100644 appwrite/utils/__init__.py create mode 100644 appwrite/utils/deprecated.py create mode 100644 docs/examples/messaging/create-resend-provider.md create mode 100644 docs/examples/messaging/update-resend-provider.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d8327b..90dcfc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 13.4.2 + +* Fix adding `Optional[]` to optional parameters +* Fix passing of `None` to nullable parameters + ## 13.4.1 * Add transaction support for Databases and TablesDB diff --git a/appwrite/client.py b/appwrite/client.py index 102298d..a4b5661 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -15,11 +15,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/13.4.1 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/13.4.2 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '13.4.1', + 'x-sdk-version': '13.4.2', 'X-Appwrite-Response-Format' : '1.8.0', } @@ -79,8 +79,6 @@ def call(self, method, path='', headers=None, params=None, response_type='json') if params is None: params = {} - params = {k: v for k, v in params.items() if v is not None} # Remove None values from params dictionary - data = {} files = {} stringify = False diff --git a/appwrite/enums/execution_status.py b/appwrite/enums/execution_status.py index 639b64d..99c72bb 100644 --- a/appwrite/enums/execution_status.py +++ b/appwrite/enums/execution_status.py @@ -5,3 +5,4 @@ class ExecutionStatus(Enum): PROCESSING = "processing" COMPLETED = "completed" FAILED = "failed" + SCHEDULED = "scheduled" diff --git a/appwrite/enums/framework.py b/appwrite/enums/framework.py index b3a9fb6..217150f 100644 --- a/appwrite/enums/framework.py +++ b/appwrite/enums/framework.py @@ -9,6 +9,7 @@ class Framework(Enum): VUE = "vue" SVELTEKIT = "sveltekit" ASTRO = "astro" + TANSTACK_START = "tanstack-start" REMIX = "remix" LYNX = "lynx" FLUTTER = "flutter" diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 08d3ae3..3b79f43 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.authenticator_type import AuthenticatorType; from ..enums.authentication_factor import AuthenticationFactor; from ..enums.o_auth_provider import OAuthProvider; @@ -31,7 +32,7 @@ def get(self) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + def create(self, user_id: str, email: str, password: str, name: Optional[str] = None) -> Dict[str, Any]: """ Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). @@ -43,7 +44,7 @@ def create(self, user_id: str, email: str, password: str, name: str = None) -> D User email. password : str New user password. Must be between 8 and 256 chars. - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -118,13 +119,13 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: List[str] = None) -> Dict[str, Any]: + def list_identities(self, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get the list of identities for the currently logged in user. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry Returns @@ -200,13 +201,13 @@ def create_jwt(self) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_logs(self, queries: List[str] = None) -> Dict[str, Any]: + def list_logs(self, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset Returns @@ -550,7 +551,7 @@ def update_name(self, name: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def update_password(self, password: str, old_password: str = None) -> Dict[str, Any]: + def update_password(self, password: str, old_password: Optional[str] = None) -> Dict[str, Any]: """ Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. @@ -558,7 +559,7 @@ def update_password(self, password: str, old_password: str = None) -> Dict[str, ---------- password : str New user password. Must be at least 8 chars. - old_password : str + old_password : Optional[str] Current user password. Must be at least 8 chars. Returns @@ -865,6 +866,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str, 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.6.0. Please use `account.create_session` instead.") def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. @@ -905,6 +907,7 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.6.0. Please use `account.create_session` instead.") def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. @@ -1100,7 +1103,7 @@ def update_status(self) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> Dict[str, Any]: + def create_email_token(self, user_id: str, email: str, phrase: Optional[bool] = None) -> Dict[str, Any]: """ Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. @@ -1113,7 +1116,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. email : str User email. - phrase : bool + phrase : Optional[bool] Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. Returns @@ -1144,7 +1147,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D 'content-type': 'application/json', }, api_params) - def create_magic_url_token(self, user_id: str, email: str, url: str = None, phrase: bool = None) -> Dict[str, Any]: + def create_magic_url_token(self, user_id: str, email: str, url: Optional[str] = None, phrase: Optional[bool] = None) -> Dict[str, Any]: """ Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. @@ -1157,9 +1160,9 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. email : str User email. - url : str + url : Optional[str] URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. - phrase : bool + phrase : Optional[bool] Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. Returns @@ -1191,7 +1194,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra 'content-type': 'application/json', }, api_params) - def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: List[str] = None) -> str: + def create_o_auth2_token(self, provider: OAuthProvider, success: Optional[str] = None, failure: Optional[str] = None, scopes: Optional[List[str]] = None) -> str: """ Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. @@ -1203,11 +1206,11 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai ---------- provider : OAuthProvider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. - success : str + success : Optional[str] URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. - failure : str + failure : Optional[str] URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. - scopes : List[str] + scopes : Optional[List[str]] A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. Returns @@ -1310,6 +1313,7 @@ def create_email_verification(self, url: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `account.create_email_verification` instead.") def create_verification(self, url: str) -> Dict[str, Any]: """ Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. @@ -1385,6 +1389,7 @@ def update_email_verification(self, user_id: str, secret: str) -> Dict[str, Any] 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `account.update_email_verification` instead.") def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]: """ Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index a72e14f..3923da6 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.browser import Browser; from ..enums.credit_card import CreditCard; from ..enums.flag import Flag; @@ -10,7 +11,7 @@ class Avatars(Service): def __init__(self, client) -> None: super(Avatars, self).__init__(client) - def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None) -> bytes: + def get_browser(self, code: Browser, width: Optional[float] = None, height: Optional[float] = None, quality: Optional[float] = None) -> bytes: """ You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. @@ -20,11 +21,11 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, ---------- code : Browser Browser Code. - width : float + width : Optional[float] Image width. Pass an integer between 0 to 2000. Defaults to 100. - height : float + height : Optional[float] Image height. Pass an integer between 0 to 2000. Defaults to 100. - quality : float + quality : Optional[float] Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. Returns @@ -52,7 +53,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None, return self.client.call('get', api_path, { }, api_params) - def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> bytes: + def get_credit_card(self, code: CreditCard, width: Optional[float] = None, height: Optional[float] = None, quality: Optional[float] = None) -> bytes: """ The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. @@ -63,11 +64,11 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float = ---------- code : CreditCard Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. - width : float + width : Optional[float] Image width. Pass an integer between 0 to 2000. Defaults to 100. - height : float + height : Optional[float] Image height. Pass an integer between 0 to 2000. Defaults to 100. - quality : float + quality : Optional[float] Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. Returns @@ -128,7 +129,7 @@ def get_favicon(self, url: str) -> bytes: return self.client.call('get', api_path, { }, api_params) - def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> bytes: + def get_flag(self, code: Flag, width: Optional[float] = None, height: Optional[float] = None, quality: Optional[float] = None) -> bytes: """ You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. @@ -139,11 +140,11 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit ---------- code : Flag Country Code. ISO Alpha-2 country code format. - width : float + width : Optional[float] Image width. Pass an integer between 0 to 2000. Defaults to 100. - height : float + height : Optional[float] Image height. Pass an integer between 0 to 2000. Defaults to 100. - quality : float + quality : Optional[float] Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. Returns @@ -171,7 +172,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit return self.client.call('get', api_path, { }, api_params) - def get_image(self, url: str, width: float = None, height: float = None) -> bytes: + def get_image(self, url: str, width: Optional[float] = None, height: Optional[float] = None) -> bytes: """ Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. @@ -183,9 +184,9 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte ---------- url : str Image URL which you want to crop. - width : float + width : Optional[float] Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. - height : float + height : Optional[float] Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. Returns @@ -212,7 +213,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte return self.client.call('get', api_path, { }, api_params) - def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> bytes: + def get_initials(self, name: Optional[str] = None, width: Optional[float] = None, height: Optional[float] = None, background: Optional[str] = None) -> bytes: """ Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. @@ -223,13 +224,13 @@ def get_initials(self, name: str = None, width: float = None, height: float = No Parameters ---------- - name : str + name : Optional[str] Full Name. When empty, current user name or email will be used. Max length: 128 chars. - width : float + width : Optional[float] Image width. Pass an integer between 0 to 2000. Defaults to 100. - height : float + height : Optional[float] Image height. Pass an integer between 0 to 2000. Defaults to 100. - background : str + background : Optional[str] Changes background color. By default a random color will be picked and stay will persistent to the given name. Returns @@ -254,7 +255,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No return self.client.call('get', api_path, { }, api_params) - def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> bytes: + def get_qr(self, text: str, size: Optional[float] = None, margin: Optional[float] = None, download: Optional[bool] = None) -> bytes: """ Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. @@ -263,11 +264,11 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download: ---------- text : str Plain text to be converted to QR code image. - size : float + size : Optional[float] QR code size. Pass an integer between 1 to 1000. Defaults to 400. - margin : float + margin : Optional[float] Margin from edge. Pass an integer between 0 to 10. Defaults to 1. - download : bool + download : Optional[bool] Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. Returns diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 0af913f..d3fc85c 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.relationship_type import RelationshipType; from ..enums.relation_mutate import RelationMutate; from ..enums.index_type import IndexType; @@ -10,7 +11,8 @@ class Databases(Service): def __init__(self, client) -> None: super(Databases, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.list` instead.") + def list(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. @@ -18,9 +20,9 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: This API has been deprecated since 1.8.0. Please use `tablesDB.list` instead. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -43,7 +45,8 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create` instead.") + def create(self, database_id: str, name: str, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Database. @@ -56,7 +59,7 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Database name. Max length: 128 chars. - enabled : bool + enabled : Optional[bool] Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. Returns @@ -87,13 +90,13 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, 'content-type': 'application/json', }, api_params) - def list_transactions(self, queries: List[str] = None) -> Dict[str, Any]: + def list_transactions(self, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ List transactions across all databases. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Returns @@ -115,13 +118,13 @@ def list_transactions(self, queries: List[str] = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create_transaction(self, ttl: float = None) -> Dict[str, Any]: + def create_transaction(self, ttl: Optional[float] = None) -> Dict[str, Any]: """ Create a new transaction. Parameters ---------- - ttl : float + ttl : Optional[float] Seconds before the transaction expires. Returns @@ -175,7 +178,7 @@ def get_transaction(self, transaction_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_transaction(self, transaction_id: str, commit: bool = None, rollback: bool = None) -> Dict[str, Any]: + def update_transaction(self, transaction_id: str, commit: Optional[bool] = None, rollback: Optional[bool] = None) -> Dict[str, Any]: """ Update a transaction, to either commit or roll back its operations. @@ -183,9 +186,9 @@ def update_transaction(self, transaction_id: str, commit: bool = None, rollback: ---------- transaction_id : str Transaction ID. - commit : bool + commit : Optional[bool] Commit transaction? - rollback : bool + rollback : Optional[bool] Rollback transaction? Returns @@ -245,7 +248,7 @@ def delete_transaction(self, transaction_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def create_operations(self, transaction_id: str, operations: List[dict] = None) -> Dict[str, Any]: + def create_operations(self, transaction_id: str, operations: Optional[List[dict]] = None) -> Dict[str, Any]: """ Create multiple operations in a single transaction. @@ -253,7 +256,7 @@ def create_operations(self, transaction_id: str, operations: List[dict] = None) ---------- transaction_id : str Transaction ID. - operations : List[dict] + operations : Optional[List[dict]] Array of staged operations. Returns @@ -280,6 +283,7 @@ def create_operations(self, transaction_id: str, operations: List[dict] = None) 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.get` instead.") def get(self, database_id: str) -> Dict[str, Any]: """ Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. @@ -313,7 +317,8 @@ def get(self, database_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update` instead.") + def update(self, database_id: str, name: str, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Update a database by its unique ID. @@ -325,7 +330,7 @@ def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Database ID. name : str Database name. Max length: 128 chars. - enabled : bool + enabled : Optional[bool] Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. Returns @@ -356,6 +361,7 @@ def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.delete` instead.") def delete(self, database_id: str) -> Dict[str, Any]: """ Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. @@ -390,7 +396,8 @@ def delete(self, database_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_collections(self, database_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.list_tables` instead.") + def list_collections(self, database_id: str, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. @@ -400,9 +407,9 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: ---------- database_id : str Database ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -429,7 +436,8 @@ def list_collections(self, database_id: str, queries: List[str] = None, search: return self.client.call('get', api_path, { }, api_params) - def create_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_table` instead.") + def create_collection(self, database_id: str, collection_id: str, name: str, permissions: Optional[List[str]] = None, document_security: Optional[bool] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. @@ -443,11 +451,11 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Collection name. Max length: 128 chars. - permissions : List[str] + permissions : Optional[List[str]] An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - document_security : bool + document_security : Optional[bool] Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - enabled : bool + enabled : Optional[bool] Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. Returns @@ -484,6 +492,7 @@ def create_collection(self, database_id: str, collection_id: str, name: str, per 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.get_table` instead.") def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any]: """ Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. @@ -523,7 +532,8 @@ def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any] return self.client.call('get', api_path, { }, api_params) - def update_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_table` instead.") + def update_collection(self, database_id: str, collection_id: str, name: str, permissions: Optional[List[str]] = None, document_security: Optional[bool] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Update a collection by its unique ID. @@ -537,11 +547,11 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per Collection ID. name : str Collection name. Max length: 128 chars. - permissions : List[str] + permissions : Optional[List[str]] An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - document_security : bool + document_security : Optional[bool] Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - enabled : bool + enabled : Optional[bool] Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. Returns @@ -578,6 +588,7 @@ def update_collection(self, database_id: str, collection_id: str, name: str, per 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.delete_table` instead.") def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, Any]: """ Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. @@ -618,7 +629,8 @@ def delete_collection(self, database_id: str, collection_id: str) -> Dict[str, A 'content-type': 'application/json', }, api_params) - def list_attributes(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.list_columns` instead.") + def list_attributes(self, database_id: str, collection_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ List attributes in the collection. @@ -630,7 +642,7 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st Database ID. collection_id : str Collection ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error Returns @@ -660,7 +672,8 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st return self.client.call('get', api_path, { }, api_params) - def create_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool = None, array: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_boolean_column` instead.") + def create_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[bool] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create a boolean attribute. @@ -677,9 +690,9 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st Attribute Key. required : bool Is attribute required? - default : bool + default : Optional[bool] Default value for attribute when not provided. Cannot be set when attribute is required. - array : bool + array : Optional[bool] Is attribute an array? Returns @@ -719,7 +732,8 @@ def create_boolean_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def update_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: bool, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_boolean_column` instead.") + def update_boolean_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[bool], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a boolean attribute. Changing the `default` value will not update already existing documents. @@ -735,9 +749,9 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st Attribute Key. required : bool Is attribute required? - default : bool + default : Optional[bool] Default value for attribute when not provided. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New attribute key. Returns @@ -777,7 +791,8 @@ def update_boolean_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def create_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_datetime_column` instead.") + def create_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create a date time attribute according to the ISO 8601 standard. @@ -793,9 +808,9 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. - array : bool + array : Optional[bool] Is attribute an array? Returns @@ -835,7 +850,8 @@ def create_datetime_attribute(self, database_id: str, collection_id: str, key: s 'content-type': 'application/json', }, api_params) - def update_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_datetime_column` instead.") + def update_datetime_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a date time attribute. Changing the `default` value will not update already existing documents. @@ -851,9 +867,9 @@ def update_datetime_attribute(self, database_id: str, collection_id: str, key: s Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New attribute key. Returns @@ -893,7 +909,8 @@ def update_datetime_attribute(self, database_id: str, collection_id: str, key: s 'content-type': 'application/json', }, api_params) - def create_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_email_column` instead.") + def create_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create an email attribute. @@ -910,9 +927,9 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - array : bool + array : Optional[bool] Is attribute an array? Returns @@ -952,7 +969,8 @@ def create_email_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_email_column` instead.") + def update_email_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an email attribute. Changing the `default` value will not update already existing documents. @@ -969,9 +987,9 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New Attribute Key. Returns @@ -1011,7 +1029,8 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_enum_column` instead.") + def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. @@ -1030,9 +1049,9 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, Array of enum values. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - array : bool + array : Optional[bool] Is attribute an array? Returns @@ -1076,7 +1095,8 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_enum_column` instead.") + def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an enum attribute. Changing the `default` value will not update already existing documents. @@ -1095,9 +1115,9 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, Updated list of enum values. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New Attribute Key. Returns @@ -1141,7 +1161,8 @@ def update_enum_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_float_column` instead.") + def create_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: Optional[float] = None, max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create a float attribute. Optionally, minimum and maximum values can be provided. @@ -1158,13 +1179,13 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, Attribute Key. required : bool Is attribute required? - min : float + min : Optional[float] Minimum value. - max : float + max : Optional[float] Maximum value. - default : float + default : Optional[float] Default value. Cannot be set when required. - array : bool + array : Optional[bool] Is attribute an array? Returns @@ -1206,7 +1227,8 @@ def create_float_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_float_column` instead.") + def update_float_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[float], min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a float attribute. Changing the `default` value will not update already existing documents. @@ -1223,13 +1245,13 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, Attribute Key. required : bool Is attribute required? - default : float + default : Optional[float] Default value. Cannot be set when required. - min : float + min : Optional[float] Minimum value. - max : float + max : Optional[float] Maximum value. - new_key : str + new_key : Optional[str] New Attribute Key. Returns @@ -1271,7 +1293,8 @@ def update_float_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_integer_column` instead.") + def create_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, min: Optional[float] = None, max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create an integer attribute. Optionally, minimum and maximum values can be provided. @@ -1288,13 +1311,13 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st Attribute Key. required : bool Is attribute required? - min : float + min : Optional[float] Minimum value - max : float + max : Optional[float] Maximum value - default : float + default : Optional[float] Default value. Cannot be set when attribute is required. - array : bool + array : Optional[bool] Is attribute an array? Returns @@ -1336,7 +1359,8 @@ def create_integer_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def update_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_integer_column` instead.") + def update_integer_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[float], min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an integer attribute. Changing the `default` value will not update already existing documents. @@ -1353,13 +1377,13 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st Attribute Key. required : bool Is attribute required? - default : float + default : Optional[float] Default value. Cannot be set when attribute is required. - min : float + min : Optional[float] Minimum value - max : float + max : Optional[float] Maximum value - new_key : str + new_key : Optional[str] New Attribute Key. Returns @@ -1401,7 +1425,8 @@ def update_integer_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def create_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_ip_column` instead.") + def create_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create IP address attribute. @@ -1418,9 +1443,9 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value. Cannot be set when attribute is required. - array : bool + array : Optional[bool] Is attribute an array? Returns @@ -1460,7 +1485,8 @@ def create_ip_attribute(self, database_id: str, collection_id: str, key: str, re 'content-type': 'application/json', }, api_params) - def update_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_ip_column` instead.") + def update_ip_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an ip attribute. Changing the `default` value will not update already existing documents. @@ -1477,9 +1503,9 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New Attribute Key. Returns @@ -1519,7 +1545,8 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re 'content-type': 'application/json', }, api_params) - def create_line_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_line_column` instead.") + def create_line_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[List[Any]] = None) -> Dict[str, Any]: """ Create a geometric line attribute. @@ -1535,7 +1562,7 @@ def create_line_attribute(self, database_id: str, collection_id: str, key: str, Attribute Key. required : bool Is attribute required? - default : List[Any] + default : Optional[List[Any]] Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. Returns @@ -1574,7 +1601,8 @@ def create_line_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_line_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_line_column` instead.") + def update_line_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[List[Any]] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a line attribute. Changing the `default` value will not update already existing documents. @@ -1590,9 +1618,9 @@ def update_line_attribute(self, database_id: str, collection_id: str, key: str, Attribute Key. required : bool Is attribute required? - default : List[Any] + default : Optional[List[Any]] Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New attribute key. Returns @@ -1632,7 +1660,8 @@ def update_line_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_point_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_point_column` instead.") + def create_point_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[List[Any]] = None) -> Dict[str, Any]: """ Create a geometric point attribute. @@ -1648,7 +1677,7 @@ def create_point_attribute(self, database_id: str, collection_id: str, key: str, Attribute Key. required : bool Is attribute required? - default : List[Any] + default : Optional[List[Any]] Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. Returns @@ -1687,7 +1716,8 @@ def create_point_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_point_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_point_column` instead.") + def update_point_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[List[Any]] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a point attribute. Changing the `default` value will not update already existing documents. @@ -1703,9 +1733,9 @@ def update_point_attribute(self, database_id: str, collection_id: str, key: str, Attribute Key. required : bool Is attribute required? - default : List[Any] + default : Optional[List[Any]] Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New attribute key. Returns @@ -1745,7 +1775,8 @@ def update_point_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_polygon_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_polygon_column` instead.") + def create_polygon_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[List[Any]] = None) -> Dict[str, Any]: """ Create a geometric polygon attribute. @@ -1761,7 +1792,7 @@ def create_polygon_attribute(self, database_id: str, collection_id: str, key: st Attribute Key. required : bool Is attribute required? - default : List[Any] + default : Optional[List[Any]] Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. Returns @@ -1800,7 +1831,8 @@ def create_polygon_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def update_polygon_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_polygon_column` instead.") + def update_polygon_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[List[Any]] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a polygon attribute. Changing the `default` value will not update already existing documents. @@ -1816,9 +1848,9 @@ def update_polygon_attribute(self, database_id: str, collection_id: str, key: st Attribute Key. required : bool Is attribute required? - default : List[Any] + default : Optional[List[Any]] Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New attribute key. Returns @@ -1858,7 +1890,8 @@ def update_polygon_attribute(self, database_id: str, collection_id: str, key: st 'content-type': 'application/json', }, api_params) - def create_relationship_attribute(self, database_id: str, collection_id: str, related_collection_id: str, type: RelationshipType, two_way: bool = None, key: str = None, two_way_key: str = None, on_delete: RelationMutate = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_relationship_column` instead.") + def create_relationship_attribute(self, database_id: str, collection_id: str, related_collection_id: str, type: RelationshipType, two_way: Optional[bool] = None, key: Optional[str] = None, two_way_key: Optional[str] = None, on_delete: Optional[RelationMutate] = None) -> Dict[str, Any]: """ Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). @@ -1875,13 +1908,13 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re Related Collection ID. type : RelationshipType Relation type - two_way : bool + two_way : Optional[bool] Is Two Way? - key : str + key : Optional[str] Attribute Key. - two_way_key : str + two_way_key : Optional[str] Two Way Attribute Key. - on_delete : RelationMutate + on_delete : Optional[RelationMutate] Constraints option Returns @@ -1923,7 +1956,8 @@ def create_relationship_attribute(self, database_id: str, collection_id: str, re 'content-type': 'application/json', }, api_params) - def create_string_attribute(self, database_id: str, collection_id: str, key: str, size: float, required: bool, default: str = None, array: bool = None, encrypt: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_string_column` instead.") + def create_string_attribute(self, database_id: str, collection_id: str, key: str, size: float, required: bool, default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None) -> Dict[str, Any]: """ Create a string attribute. @@ -1942,11 +1976,11 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str Attribute size for text attributes, in number of characters. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - array : bool + array : Optional[bool] Is attribute an array? - encrypt : bool + encrypt : Optional[bool] Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. Returns @@ -1991,7 +2025,8 @@ def create_string_attribute(self, database_id: str, collection_id: str, key: str 'content-type': 'application/json', }, api_params) - def update_string_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, size: float = None, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_string_column` instead.") + def update_string_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str], size: Optional[float] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a string attribute. Changing the `default` value will not update already existing documents. @@ -2008,11 +2043,11 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - size : float + size : Optional[float] Maximum size of the string attribute. - new_key : str + new_key : Optional[str] New Attribute Key. Returns @@ -2053,7 +2088,8 @@ def update_string_attribute(self, database_id: str, collection_id: str, key: str 'content-type': 'application/json', }, api_params) - def create_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_url_column` instead.") + def create_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create a URL attribute. @@ -2070,9 +2106,9 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - array : bool + array : Optional[bool] Is attribute an array? Returns @@ -2112,7 +2148,8 @@ def create_url_attribute(self, database_id: str, collection_id: str, key: str, r 'content-type': 'application/json', }, api_params) - def update_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_url_column` instead.") + def update_url_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an url attribute. Changing the `default` value will not update already existing documents. @@ -2129,9 +2166,9 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r Attribute Key. required : bool Is attribute required? - default : str + default : Optional[str] Default value for attribute when not provided. Cannot be set when attribute is required. - new_key : str + new_key : Optional[str] New Attribute Key. Returns @@ -2171,6 +2208,7 @@ def update_url_attribute(self, database_id: str, collection_id: str, key: str, r 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.get_column` instead.") def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: """ Get attribute by ID. @@ -2216,6 +2254,7 @@ def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[ return self.client.call('get', api_path, { }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.delete_column` instead.") def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: """ Deletes an attribute. @@ -2262,7 +2301,8 @@ def delete_attribute(self, database_id: str, collection_id: str, key: str) -> Di 'content-type': 'application/json', }, api_params) - def update_relationship_attribute(self, database_id: str, collection_id: str, key: str, on_delete: RelationMutate = None, new_key: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_relationship_column` instead.") + def update_relationship_attribute(self, database_id: str, collection_id: str, key: str, on_delete: Optional[RelationMutate] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). @@ -2277,9 +2317,9 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke Collection ID. key : str Attribute Key. - on_delete : RelationMutate + on_delete : Optional[RelationMutate] Constraints option - new_key : str + new_key : Optional[str] New Attribute Key. Returns @@ -2315,7 +2355,8 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke 'content-type': 'application/json', }, api_params) - def list_documents(self, database_id: str, collection_id: str, queries: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.list_rows` instead.") + def list_documents(self, database_id: str, collection_id: str, queries: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the user's documents in a given collection. You can use the query params to filter your results. @@ -2327,9 +2368,9 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str Database ID. collection_id : str Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - transaction_id : str + transaction_id : Optional[str] Transaction ID to read uncommitted changes within the transaction. Returns @@ -2360,7 +2401,8 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str return self.client.call('get', api_path, { }, api_params) - def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_row` instead.") + def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. @@ -2376,9 +2418,9 @@ def create_document(self, database_id: str, collection_id: str, document_id: str Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. data : dict Document data as JSON object. - permissions : List[str] + permissions : Optional[List[str]] An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2418,7 +2460,8 @@ def create_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def create_documents(self, database_id: str, collection_id: str, documents: List[dict], transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_rows` instead.") + def create_documents(self, database_id: str, collection_id: str, documents: List[dict], transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. @@ -2432,7 +2475,7 @@ def create_documents(self, database_id: str, collection_id: str, documents: List Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. documents : List[dict] Array of documents data as JSON objects. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2467,7 +2510,8 @@ def create_documents(self, database_id: str, collection_id: str, documents: List 'content-type': 'application/json', }, api_params) - def upsert_documents(self, database_id: str, collection_id: str, documents: List[dict], transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.upsert_rows` instead.") + def upsert_documents(self, database_id: str, collection_id: str, documents: List[dict], transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. @@ -2482,7 +2526,7 @@ def upsert_documents(self, database_id: str, collection_id: str, documents: List Collection ID. documents : List[dict] Array of document data as JSON objects. May contain partial documents. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2517,7 +2561,8 @@ def upsert_documents(self, database_id: str, collection_id: str, documents: List 'content-type': 'application/json', }, api_params) - def update_documents(self, database_id: str, collection_id: str, data: dict = None, queries: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_rows` instead.") + def update_documents(self, database_id: str, collection_id: str, data: Optional[dict] = None, queries: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. @@ -2529,11 +2574,11 @@ def update_documents(self, database_id: str, collection_id: str, data: dict = No Database ID. collection_id : str Collection ID. - data : dict + data : Optional[dict] Document data as JSON object. Include only attribute and value pairs to be updated. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2566,7 +2611,8 @@ def update_documents(self, database_id: str, collection_id: str, data: dict = No 'content-type': 'application/json', }, api_params) - def delete_documents(self, database_id: str, collection_id: str, queries: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.delete_rows` instead.") + def delete_documents(self, database_id: str, collection_id: str, queries: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Bulk delete documents using queries, if no queries are passed then all documents are deleted. @@ -2578,9 +2624,9 @@ def delete_documents(self, database_id: str, collection_id: str, queries: List[s Database ID. collection_id : str Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2612,7 +2658,8 @@ def delete_documents(self, database_id: str, collection_id: str, queries: List[s 'content-type': 'application/json', }, api_params) - def get_document(self, database_id: str, collection_id: str, document_id: str, queries: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.get_row` instead.") + def get_document(self, database_id: str, collection_id: str, document_id: str, queries: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Get a document by its unique ID. This endpoint response returns a JSON object with the document data. @@ -2626,9 +2673,9 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). document_id : str Document ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - transaction_id : str + transaction_id : Optional[str] Transaction ID to read uncommitted changes within the transaction. Returns @@ -2663,7 +2710,8 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q return self.client.call('get', api_path, { }, api_params) - def upsert_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.upsert_row` instead.") + def upsert_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. @@ -2679,9 +2727,9 @@ def upsert_document(self, database_id: str, collection_id: str, document_id: str Document ID. data : dict Document data as JSON object. Include all required attributes of the document to be created or updated. - permissions : List[str] + permissions : Optional[List[str]] An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2721,7 +2769,8 @@ def upsert_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.update_row` instead.") + def update_document(self, database_id: str, collection_id: str, document_id: str, data: Optional[dict] = None, permissions: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. @@ -2735,11 +2784,11 @@ def update_document(self, database_id: str, collection_id: str, document_id: str Collection ID. document_id : str Document ID. - data : dict + data : Optional[dict] Document data as JSON object. Include only attribute and value pairs to be updated. - permissions : List[str] + permissions : Optional[List[str]] An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2776,7 +2825,8 @@ def update_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def delete_document(self, database_id: str, collection_id: str, document_id: str, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.delete_row` instead.") + def delete_document(self, database_id: str, collection_id: str, document_id: str, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Delete a document by its unique ID. @@ -2790,7 +2840,7 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). document_id : str Document ID. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2825,7 +2875,8 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def decrement_document_attribute(self, database_id: str, collection_id: str, document_id: str, attribute: str, value: float = None, min: float = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.decrement_row_column` instead.") + def decrement_document_attribute(self, database_id: str, collection_id: str, document_id: str, attribute: str, value: Optional[float] = None, min: Optional[float] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Decrement a specific attribute of a document by a given value. @@ -2841,11 +2892,11 @@ def decrement_document_attribute(self, database_id: str, collection_id: str, doc Document ID. attribute : str Attribute key. - value : float + value : Optional[float] Value to increment the attribute by. The value must be a number. - min : float + min : Optional[float] Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2886,7 +2937,8 @@ def decrement_document_attribute(self, database_id: str, collection_id: str, doc 'content-type': 'application/json', }, api_params) - def increment_document_attribute(self, database_id: str, collection_id: str, document_id: str, attribute: str, value: float = None, max: float = None, transaction_id: str = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.increment_row_column` instead.") + def increment_document_attribute(self, database_id: str, collection_id: str, document_id: str, attribute: str, value: Optional[float] = None, max: Optional[float] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Increment a specific attribute of a document by a given value. @@ -2902,11 +2954,11 @@ def increment_document_attribute(self, database_id: str, collection_id: str, doc Document ID. attribute : str Attribute key. - value : float + value : Optional[float] Value to increment the attribute by. The value must be a number. - max : float + max : Optional[float] Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2947,7 +2999,8 @@ def increment_document_attribute(self, database_id: str, collection_id: str, doc 'content-type': 'application/json', }, api_params) - def list_indexes(self, database_id: str, collection_id: str, queries: List[str] = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.list_indexes` instead.") + def list_indexes(self, database_id: str, collection_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ List indexes in the collection. @@ -2959,7 +3012,7 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] Database ID. collection_id : str Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error Returns @@ -2989,7 +3042,8 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str] return self.client.call('get', api_path, { }, api_params) - def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: List[str] = None, lengths: List[float] = None) -> Dict[str, Any]: + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_index` instead.") + def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: Optional[List[str]] = None, lengths: Optional[List[float]] = None) -> Dict[str, Any]: """ Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be `key`, `fulltext`, and `unique`. @@ -3008,9 +3062,9 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind Index type. attributes : List[str] Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. - orders : List[str] + orders : Optional[List[str]] Array of index orders. Maximum of 100 orders are allowed. - lengths : List[float] + lengths : Optional[List[float]] Length of index. Maximum of 100 Returns @@ -3054,6 +3108,7 @@ def create_index(self, database_id: str, collection_id: str, key: str, type: Ind 'content-type': 'application/json', }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.get_index` instead.") def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: """ Get an index by its unique ID. @@ -3099,6 +3154,7 @@ def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, return self.client.call('get', api_path, { }, api_params) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.delete_index` instead.") def delete_index(self, database_id: str, collection_id: str, key: str) -> Dict[str, Any]: """ Delete an index. diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index ab0ab64..9ffae50 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.runtime import Runtime; from ..input_file import InputFile from ..enums.vcs_deployment_type import VCSDeploymentType; @@ -12,15 +13,15 @@ class Functions(Service): def __init__(self, client) -> None: super(Functions, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the project's functions. You can use the query params to filter your results. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -43,7 +44,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: + def create(self, function_id: str, name: str, runtime: Runtime, execute: Optional[List[str]] = None, events: Optional[List[str]] = None, schedule: Optional[str] = None, timeout: Optional[float] = None, enabled: Optional[bool] = None, logging: Optional[bool] = None, entrypoint: Optional[str] = None, commands: Optional[str] = None, scopes: Optional[List[str]] = None, installation_id: Optional[str] = None, provider_repository_id: Optional[str] = None, provider_branch: Optional[str] = None, provider_silent_mode: Optional[bool] = None, provider_root_directory: Optional[str] = None, specification: Optional[str] = None) -> Dict[str, Any]: """ Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. @@ -55,35 +56,35 @@ def create(self, function_id: str, name: str, runtime: Runtime, execute: List[st Function name. Max length: 128 chars. runtime : Runtime Execution runtime. - execute : List[str] + execute : Optional[List[str]] An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. - events : List[str] + events : Optional[List[str]] Events list. Maximum of 100 events are allowed. - schedule : str + schedule : Optional[str] Schedule CRON syntax. - timeout : float + timeout : Optional[float] Function maximum execution time in seconds. - enabled : bool + enabled : Optional[bool] Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. - logging : bool + logging : Optional[bool] When disabled, executions will exclude logs and errors, and will be slightly faster. - entrypoint : str + entrypoint : Optional[str] Entrypoint File. This path is relative to the "providerRootDirectory". - commands : str + commands : Optional[str] Build Commands. - scopes : List[str] + scopes : Optional[List[str]] List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. - installation_id : str + installation_id : Optional[str] Appwrite Installation ID for VCS (Version Control System) deployment. - provider_repository_id : str + provider_repository_id : Optional[str] Repository ID of the repo linked to the function. - provider_branch : str + provider_branch : Optional[str] Production branch for the repo linked to the function. - provider_silent_mode : bool + provider_silent_mode : Optional[bool] Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. - provider_root_directory : str + provider_root_directory : Optional[str] Path to function code in the linked repo. - specification : str + specification : Optional[str] Runtime specification for the function and builds. Returns @@ -205,7 +206,7 @@ def get(self, function_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update(self, function_id: str, name: str, runtime: Runtime = None, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: + def update(self, function_id: str, name: str, runtime: Optional[Runtime] = None, execute: Optional[List[str]] = None, events: Optional[List[str]] = None, schedule: Optional[str] = None, timeout: Optional[float] = None, enabled: Optional[bool] = None, logging: Optional[bool] = None, entrypoint: Optional[str] = None, commands: Optional[str] = None, scopes: Optional[List[str]] = None, installation_id: Optional[str] = None, provider_repository_id: Optional[str] = None, provider_branch: Optional[str] = None, provider_silent_mode: Optional[bool] = None, provider_root_directory: Optional[str] = None, specification: Optional[str] = None) -> Dict[str, Any]: """ Update function by its unique ID. @@ -215,37 +216,37 @@ def update(self, function_id: str, name: str, runtime: Runtime = None, execute: Function ID. name : str Function name. Max length: 128 chars. - runtime : Runtime + runtime : Optional[Runtime] Execution runtime. - execute : List[str] + execute : Optional[List[str]] An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. - events : List[str] + events : Optional[List[str]] Events list. Maximum of 100 events are allowed. - schedule : str + schedule : Optional[str] Schedule CRON syntax. - timeout : float + timeout : Optional[float] Maximum execution time in seconds. - enabled : bool + enabled : Optional[bool] Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. - logging : bool + logging : Optional[bool] When disabled, executions will exclude logs and errors, and will be slightly faster. - entrypoint : str + entrypoint : Optional[str] Entrypoint File. This path is relative to the "providerRootDirectory". - commands : str + commands : Optional[str] Build Commands. - scopes : List[str] + scopes : Optional[List[str]] List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. - installation_id : str + installation_id : Optional[str] Appwrite Installation ID for VCS (Version Controle System) deployment. - provider_repository_id : str + provider_repository_id : Optional[str] Repository ID of the repo linked to the function - provider_branch : str + provider_branch : Optional[str] Production branch for the repo linked to the function - provider_silent_mode : bool + provider_silent_mode : Optional[bool] Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. - provider_root_directory : str + provider_root_directory : Optional[str] Path to function code in the linked repo. - specification : str + specification : Optional[str] Runtime specification for the function and builds. Returns @@ -361,7 +362,7 @@ def update_function_deployment(self, function_id: str, deployment_id: str) -> Di 'content-type': 'application/json', }, api_params) - def list_deployments(self, function_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_deployments(self, function_id: str, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the function's code deployments. You can use the query params to filter your results. @@ -369,9 +370,9 @@ def list_deployments(self, function_id: str, queries: List[str] = None, search: ---------- function_id : str Function ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -398,7 +399,7 @@ def list_deployments(self, function_id: str, queries: List[str] = None, search: return self.client.call('get', api_path, { }, api_params) - def create_deployment(self, function_id: str, code: InputFile, activate: bool, entrypoint: str = None, commands: str = None, on_progress = None) -> Dict[str, Any]: + def create_deployment(self, function_id: str, code: InputFile, activate: bool, entrypoint: Optional[str] = None, commands: Optional[str] = None, on_progress = None) -> Dict[str, Any]: """ Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. @@ -414,9 +415,9 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. activate : bool Automatically activate the deployment when it is finished building. - entrypoint : str + entrypoint : Optional[str] Entrypoint File. - commands : str + commands : Optional[str] Build Commands. on_progress : callable, optional Optional callback for upload progress @@ -459,7 +460,7 @@ def create_deployment(self, function_id: str, code: InputFile, activate: bool, e 'content-type': 'multipart/form-data', }, api_params, param_name, on_progress, upload_id) - def create_duplicate_deployment(self, function_id: str, deployment_id: str, build_id: str = None) -> Dict[str, Any]: + def create_duplicate_deployment(self, function_id: str, deployment_id: str, build_id: Optional[str] = None) -> Dict[str, Any]: """ Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. @@ -469,7 +470,7 @@ def create_duplicate_deployment(self, function_id: str, deployment_id: str, buil Function ID. deployment_id : str Deployment ID. - build_id : str + build_id : Optional[str] Build unique ID. Returns @@ -500,7 +501,7 @@ def create_duplicate_deployment(self, function_id: str, deployment_id: str, buil 'content-type': 'application/json', }, api_params) - def create_template_deployment(self, function_id: str, repository: str, owner: str, root_directory: str, version: str, activate: bool = None) -> Dict[str, Any]: + def create_template_deployment(self, function_id: str, repository: str, owner: str, root_directory: str, version: str, activate: Optional[bool] = None) -> Dict[str, Any]: """ Create a deployment based on a template. @@ -518,7 +519,7 @@ def create_template_deployment(self, function_id: str, repository: str, owner: s Path to function code in the template repo. version : str Version (tag) for the repo linked to the function template. - activate : bool + activate : Optional[bool] Automatically activate the deployment when it is finished building. Returns @@ -561,7 +562,7 @@ def create_template_deployment(self, function_id: str, repository: str, owner: s 'content-type': 'application/json', }, api_params) - def create_vcs_deployment(self, function_id: str, type: VCSDeploymentType, reference: str, activate: bool = None) -> Dict[str, Any]: + def create_vcs_deployment(self, function_id: str, type: VCSDeploymentType, reference: str, activate: Optional[bool] = None) -> Dict[str, Any]: """ Create a deployment when a function is connected to VCS. @@ -575,7 +576,7 @@ def create_vcs_deployment(self, function_id: str, type: VCSDeploymentType, refer Type of reference passed. Allowed values are: branch, commit reference : str VCS reference to create deployment from. Depending on type this can be: branch name, commit hash - activate : bool + activate : Optional[bool] Automatically activate the deployment when it is finished building. Returns @@ -685,7 +686,7 @@ def delete_deployment(self, function_id: str, deployment_id: str) -> Dict[str, A 'content-type': 'application/json', }, api_params) - def get_deployment_download(self, function_id: str, deployment_id: str, type: DeploymentDownloadType = None) -> bytes: + def get_deployment_download(self, function_id: str, deployment_id: str, type: Optional[DeploymentDownloadType] = None) -> bytes: """ Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. @@ -695,7 +696,7 @@ def get_deployment_download(self, function_id: str, deployment_id: str, type: De Function ID. deployment_id : str Deployment ID. - type : DeploymentDownloadType + type : Optional[DeploymentDownloadType] Deployment file to download. Can be: "source", "output". Returns @@ -763,7 +764,7 @@ def update_deployment_status(self, function_id: str, deployment_id: str) -> Dict 'content-type': 'application/json', }, api_params) - def list_executions(self, function_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_executions(self, function_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get a list of all the current user function execution logs. You can use the query params to filter your results. @@ -771,7 +772,7 @@ def list_executions(self, function_id: str, queries: List[str] = None) -> Dict[s ---------- function_id : str Function ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId Returns @@ -797,7 +798,7 @@ def list_executions(self, function_id: str, queries: List[str] = None) -> Dict[s return self.client.call('get', api_path, { }, api_params) - def create_execution(self, function_id: str, body: str = None, xasync: bool = None, path: str = None, method: ExecutionMethod = None, headers: dict = None, scheduled_at: str = None) -> Dict[str, Any]: + def create_execution(self, function_id: str, body: Optional[str] = None, xasync: Optional[bool] = None, path: Optional[str] = None, method: Optional[ExecutionMethod] = None, headers: Optional[dict] = None, scheduled_at: Optional[str] = None) -> Dict[str, Any]: """ Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. @@ -805,17 +806,17 @@ def create_execution(self, function_id: str, body: str = None, xasync: bool = No ---------- function_id : str Function ID. - body : str + body : Optional[str] HTTP body of execution. Default value is empty string. - xasync : bool + xasync : Optional[bool] Execute code in the background. Default value is false. - path : str + path : Optional[str] HTTP path of execution. Path can include query params. Default value is / - method : ExecutionMethod + method : Optional[ExecutionMethod] HTTP method of execution. Default value is POST. - headers : dict + headers : Optional[dict] HTTP headers of execution. Defaults to empty. - scheduled_at : str + scheduled_at : Optional[str] Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes. Returns @@ -953,7 +954,7 @@ def list_variables(self, function_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create_variable(self, function_id: str, key: str, value: str, secret: bool = None) -> Dict[str, Any]: + def create_variable(self, function_id: str, key: str, value: str, secret: Optional[bool] = None) -> Dict[str, Any]: """ Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. @@ -965,7 +966,7 @@ def create_variable(self, function_id: str, key: str, value: str, secret: bool = Variable key. Max length: 255 chars. value : str Variable value. Max length: 8192 chars. - secret : bool + secret : Optional[bool] Secret variables can be updated or deleted, but only functions can read them during build and runtime. Returns @@ -1037,7 +1038,7 @@ def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_variable(self, function_id: str, variable_id: str, key: str, value: str = None, secret: bool = None) -> Dict[str, Any]: + def update_variable(self, function_id: str, variable_id: str, key: str, value: Optional[str] = None, secret: Optional[bool] = None) -> Dict[str, Any]: """ Update variable by its unique ID. @@ -1049,9 +1050,9 @@ def update_variable(self, function_id: str, variable_id: str, key: str, value: s Variable unique ID. key : str Variable key. Max length: 255 chars. - value : str + value : Optional[str] Variable value. Max length: 8192 chars. - secret : bool + secret : Optional[bool] Secret variables can be updated or deleted, but only functions can read them during build and runtime. Returns diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 22ca3aa..a4849b0 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated class Graphql(Service): diff --git a/appwrite/services/health.py b/appwrite/services/health.py index dd1d183..6a50c6c 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.name import Name; class Health(Service): @@ -71,13 +72,13 @@ def get_cache(self) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_certificate(self, domain: str = None) -> Dict[str, Any]: + def get_certificate(self, domain: Optional[str] = None) -> Dict[str, Any]: """ Get the SSL certificate for a domain Parameters ---------- - domain : str + domain : Optional[str] string Returns @@ -141,13 +142,13 @@ def get_pub_sub(self) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_builds(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of builds that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -169,13 +170,13 @@ def get_queue_builds(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_certificates(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -197,15 +198,15 @@ def get_queue_certificates(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict[str, Any]: + def get_queue_databases(self, name: Optional[str] = None, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - name : str + name : Optional[str] Queue name for which to check the queue size - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -228,13 +229,13 @@ def get_queue_databases(self, name: str = None, threshold: float = None) -> Dict return self.client.call('get', api_path, { }, api_params) - def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_deletes(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -256,7 +257,7 @@ def get_queue_deletes(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any]: + def get_failed_jobs(self, name: Name, threshold: Optional[float] = None) -> Dict[str, Any]: """ Returns the amount of failed jobs in a given queue. @@ -265,7 +266,7 @@ def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any] ---------- name : Name The name of the queue - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -291,13 +292,13 @@ def get_failed_jobs(self, name: Name, threshold: float = None) -> Dict[str, Any] return self.client.call('get', api_path, { }, api_params) - def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_functions(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -319,13 +320,13 @@ def get_queue_functions(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_logs(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of logs that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -347,13 +348,13 @@ def get_queue_logs(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_mails(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of mails that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -375,13 +376,13 @@ def get_queue_mails(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_messaging(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of messages that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -403,13 +404,13 @@ def get_queue_messaging(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_migrations(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -431,13 +432,13 @@ def get_queue_migrations(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_stats_resources(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -459,13 +460,13 @@ def get_queue_stats_resources(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_usage(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns @@ -487,13 +488,13 @@ def get_queue_usage(self, threshold: float = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def get_queue_webhooks(self, threshold: float = None) -> Dict[str, Any]: + def get_queue_webhooks(self, threshold: Optional[float] = None) -> Dict[str, Any]: """ Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. Parameters ---------- - threshold : float + threshold : Optional[float] Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. Returns diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index c34ddee..ea3e083 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated class Locale(Service): diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 639a820..5af193a 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.message_priority import MessagePriority; from ..enums.smtp_encryption import SmtpEncryption; @@ -9,15 +10,15 @@ class Messaging(Service): def __init__(self, client) -> None: super(Messaging, self).__init__(client) - def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_messages(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all messages from the current Appwrite project. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -40,7 +41,7 @@ def list_messages(self, queries: List[str] = None, search: str = None) -> Dict[s return self.client.call('get', api_path, { }, api_params) - def create_email(self, message_id: str, subject: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, cc: List[str] = None, bcc: List[str] = None, attachments: List[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None) -> Dict[str, Any]: + def create_email(self, message_id: str, subject: str, content: str, topics: Optional[List[str]] = None, users: Optional[List[str]] = None, targets: Optional[List[str]] = None, cc: Optional[List[str]] = None, bcc: Optional[List[str]] = None, attachments: Optional[List[str]] = None, draft: Optional[bool] = None, html: Optional[bool] = None, scheduled_at: Optional[str] = None) -> Dict[str, Any]: """ Create a new email message. @@ -52,23 +53,23 @@ def create_email(self, message_id: str, subject: str, content: str, topics: List Email Subject. content : str Email Content. - topics : List[str] + topics : Optional[List[str]] List of Topic IDs. - users : List[str] + users : Optional[List[str]] List of User IDs. - targets : List[str] + targets : Optional[List[str]] List of Targets IDs. - cc : List[str] + cc : Optional[List[str]] Array of target IDs to be added as CC. - bcc : List[str] + bcc : Optional[List[str]] Array of target IDs to be added as BCC. - attachments : List[str] + attachments : Optional[List[str]] Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :. - draft : bool + draft : Optional[bool] Is message a draft - html : bool + html : Optional[bool] Is content of type HTML - scheduled_at : str + scheduled_at : Optional[str] Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. Returns @@ -111,7 +112,7 @@ def create_email(self, message_id: str, subject: str, content: str, topics: List 'content-type': 'application/json', }, api_params) - def update_email(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: List[str] = None, bcc: List[str] = None, scheduled_at: str = None, attachments: List[str] = None) -> Dict[str, Any]: + def update_email(self, message_id: str, topics: Optional[List[str]] = None, users: Optional[List[str]] = None, targets: Optional[List[str]] = None, subject: Optional[str] = None, content: Optional[str] = None, draft: Optional[bool] = None, html: Optional[bool] = None, cc: Optional[List[str]] = None, bcc: Optional[List[str]] = None, scheduled_at: Optional[str] = None, attachments: Optional[List[str]] = None) -> Dict[str, Any]: """ Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. @@ -120,27 +121,27 @@ def update_email(self, message_id: str, topics: List[str] = None, users: List[st ---------- message_id : str Message ID. - topics : List[str] + topics : Optional[List[str]] List of Topic IDs. - users : List[str] + users : Optional[List[str]] List of User IDs. - targets : List[str] + targets : Optional[List[str]] List of Targets IDs. - subject : str + subject : Optional[str] Email Subject. - content : str + content : Optional[str] Email Content. - draft : bool + draft : Optional[bool] Is message a draft - html : bool + html : Optional[bool] Is content of type HTML - cc : List[str] + cc : Optional[List[str]] Array of target IDs to be added as CC. - bcc : List[str] + bcc : Optional[List[str]] Array of target IDs to be added as BCC. - scheduled_at : str + scheduled_at : Optional[str] Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. - attachments : List[str] + attachments : Optional[List[str]] Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :. Returns @@ -177,7 +178,7 @@ def update_email(self, message_id: str, topics: List[str] = None, users: List[st 'content-type': 'application/json', }, api_params) - def create_push(self, message_id: str, title: str = None, body: str = None, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None) -> Dict[str, Any]: + def create_push(self, message_id: str, title: Optional[str] = None, body: Optional[str] = None, topics: Optional[List[str]] = None, users: Optional[List[str]] = None, targets: Optional[List[str]] = None, data: Optional[dict] = None, action: Optional[str] = None, image: Optional[str] = None, icon: Optional[str] = None, sound: Optional[str] = None, color: Optional[str] = None, tag: Optional[str] = None, badge: Optional[float] = None, draft: Optional[bool] = None, scheduled_at: Optional[str] = None, content_available: Optional[bool] = None, critical: Optional[bool] = None, priority: Optional[MessagePriority] = None) -> Dict[str, Any]: """ Create a new push notification. @@ -185,41 +186,41 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi ---------- message_id : str Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - title : str + title : Optional[str] Title for push notification. - body : str + body : Optional[str] Body for push notification. - topics : List[str] + topics : Optional[List[str]] List of Topic IDs. - users : List[str] + users : Optional[List[str]] List of User IDs. - targets : List[str] + targets : Optional[List[str]] List of Targets IDs. - data : dict + data : Optional[dict] Additional key-value pair data for push notification. - action : str + action : Optional[str] Action for push notification. - image : str + image : Optional[str] Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as :. - icon : str + icon : Optional[str] Icon for push notification. Available only for Android and Web Platform. - sound : str + sound : Optional[str] Sound for push notification. Available only for Android and iOS Platform. - color : str + color : Optional[str] Color for push notification. Available only for Android Platform. - tag : str + tag : Optional[str] Tag for push notification. Available only for Android Platform. - badge : float + badge : Optional[float] Badge for push notification. Available only for iOS Platform. - draft : bool + draft : Optional[bool] Is message a draft - scheduled_at : str + scheduled_at : Optional[str] Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. - content_available : bool + content_available : Optional[bool] If set to true, the notification will be delivered in the background. Available only for iOS Platform. - critical : bool + critical : Optional[bool] If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. - priority : MessagePriority + priority : Optional[MessagePriority] Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification. Returns @@ -263,7 +264,7 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi 'content-type': 'application/json', }, api_params) - def update_push(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None) -> Dict[str, Any]: + def update_push(self, message_id: str, topics: Optional[List[str]] = None, users: Optional[List[str]] = None, targets: Optional[List[str]] = None, title: Optional[str] = None, body: Optional[str] = None, data: Optional[dict] = None, action: Optional[str] = None, image: Optional[str] = None, icon: Optional[str] = None, sound: Optional[str] = None, color: Optional[str] = None, tag: Optional[str] = None, badge: Optional[float] = None, draft: Optional[bool] = None, scheduled_at: Optional[str] = None, content_available: Optional[bool] = None, critical: Optional[bool] = None, priority: Optional[MessagePriority] = None) -> Dict[str, Any]: """ Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. @@ -272,41 +273,41 @@ def update_push(self, message_id: str, topics: List[str] = None, users: List[str ---------- message_id : str Message ID. - topics : List[str] + topics : Optional[List[str]] List of Topic IDs. - users : List[str] + users : Optional[List[str]] List of User IDs. - targets : List[str] + targets : Optional[List[str]] List of Targets IDs. - title : str + title : Optional[str] Title for push notification. - body : str + body : Optional[str] Body for push notification. - data : dict + data : Optional[dict] Additional Data for push notification. - action : str + action : Optional[str] Action for push notification. - image : str + image : Optional[str] Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as :. - icon : str + icon : Optional[str] Icon for push notification. Available only for Android and Web platforms. - sound : str + sound : Optional[str] Sound for push notification. Available only for Android and iOS platforms. - color : str + color : Optional[str] Color for push notification. Available only for Android platforms. - tag : str + tag : Optional[str] Tag for push notification. Available only for Android platforms. - badge : float + badge : Optional[float] Badge for push notification. Available only for iOS platforms. - draft : bool + draft : Optional[bool] Is message a draft - scheduled_at : str + scheduled_at : Optional[str] Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. - content_available : bool + content_available : Optional[bool] If set to true, the notification will be delivered in the background. Available only for iOS Platform. - critical : bool + critical : Optional[bool] If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. - priority : MessagePriority + priority : Optional[MessagePriority] Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. Returns @@ -350,7 +351,7 @@ def update_push(self, message_id: str, topics: List[str] = None, users: List[str 'content-type': 'application/json', }, api_params) - def create_sms(self, message_id: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, draft: bool = None, scheduled_at: str = None) -> Dict[str, Any]: + def create_sms(self, message_id: str, content: str, topics: Optional[List[str]] = None, users: Optional[List[str]] = None, targets: Optional[List[str]] = None, draft: Optional[bool] = None, scheduled_at: Optional[str] = None) -> Dict[str, Any]: """ Create a new SMS message. @@ -360,15 +361,15 @@ def create_sms(self, message_id: str, content: str, topics: List[str] = None, us Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. content : str SMS Content. - topics : List[str] + topics : Optional[List[str]] List of Topic IDs. - users : List[str] + users : Optional[List[str]] List of User IDs. - targets : List[str] + targets : Optional[List[str]] List of Targets IDs. - draft : bool + draft : Optional[bool] Is message a draft - scheduled_at : str + scheduled_at : Optional[str] Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. Returns @@ -403,7 +404,7 @@ def create_sms(self, message_id: str, content: str, topics: List[str] = None, us 'content-type': 'application/json', }, api_params) - def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, content: str = None, draft: bool = None, scheduled_at: str = None) -> Dict[str, Any]: + def update_sms(self, message_id: str, topics: Optional[List[str]] = None, users: Optional[List[str]] = None, targets: Optional[List[str]] = None, content: Optional[str] = None, draft: Optional[bool] = None, scheduled_at: Optional[str] = None) -> Dict[str, Any]: """ Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. @@ -412,17 +413,17 @@ def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] ---------- message_id : str Message ID. - topics : List[str] + topics : Optional[List[str]] List of Topic IDs. - users : List[str] + users : Optional[List[str]] List of User IDs. - targets : List[str] + targets : Optional[List[str]] List of Targets IDs. - content : str + content : Optional[str] Email Content. - draft : bool + draft : Optional[bool] Is message a draft - scheduled_at : str + scheduled_at : Optional[str] Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. Returns @@ -518,7 +519,7 @@ def delete(self, message_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_message_logs(self, message_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get the message activity logs listed by its unique ID. @@ -526,7 +527,7 @@ def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[ ---------- message_id : str Message ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset Returns @@ -552,7 +553,7 @@ def list_message_logs(self, message_id: str, queries: List[str] = None) -> Dict[ return self.client.call('get', api_path, { }, api_params) - def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_targets(self, message_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get a list of the targets associated with a message. @@ -560,7 +561,7 @@ def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, ---------- message_id : str Message ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType Returns @@ -586,15 +587,15 @@ def list_targets(self, message_id: str, queries: List[str] = None) -> Dict[str, return self.client.call('get', api_path, { }, api_params) - def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_providers(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all providers from the current Appwrite project. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -617,7 +618,7 @@ def list_providers(self, queries: List[str] = None, search: str = None) -> Dict[ return self.client.call('get', api_path, { }, api_params) - def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None, enabled: bool = None) -> Dict[str, Any]: + def create_apns_provider(self, provider_id: str, name: str, auth_key: Optional[str] = None, auth_key_id: Optional[str] = None, team_id: Optional[str] = None, bundle_id: Optional[str] = None, sandbox: Optional[bool] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Apple Push Notification service provider. @@ -627,17 +628,17 @@ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - auth_key : str + auth_key : Optional[str] APNS authentication key. - auth_key_id : str + auth_key_id : Optional[str] APNS authentication key ID. - team_id : str + team_id : Optional[str] APNS team ID. - bundle_id : str + bundle_id : Optional[str] APNS bundle ID. - sandbox : bool + sandbox : Optional[bool] Use APNS sandbox environment. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -673,7 +674,7 @@ def create_apns_provider(self, provider_id: str, name: str, auth_key: str = None 'content-type': 'application/json', }, api_params) - def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool = None, auth_key: str = None, auth_key_id: str = None, team_id: str = None, bundle_id: str = None, sandbox: bool = None) -> Dict[str, Any]: + def update_apns_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, auth_key: Optional[str] = None, auth_key_id: Optional[str] = None, team_id: Optional[str] = None, bundle_id: Optional[str] = None, sandbox: Optional[bool] = None) -> Dict[str, Any]: """ Update a Apple Push Notification service provider by its unique ID. @@ -681,19 +682,19 @@ def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - enabled : bool + enabled : Optional[bool] Set as enabled. - auth_key : str + auth_key : Optional[str] APNS authentication key. - auth_key_id : str + auth_key_id : Optional[str] APNS authentication key ID. - team_id : str + team_id : Optional[str] APNS team ID. - bundle_id : str + bundle_id : Optional[str] APNS bundle ID. - sandbox : bool + sandbox : Optional[bool] Use APNS sandbox environment. Returns @@ -726,7 +727,7 @@ def update_apns_provider(self, provider_id: str, name: str = None, enabled: bool 'content-type': 'application/json', }, api_params) - def create_fcm_provider(self, provider_id: str, name: str, service_account_json: dict = None, enabled: bool = None) -> Dict[str, Any]: + def create_fcm_provider(self, provider_id: str, name: str, service_account_json: Optional[dict] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Firebase Cloud Messaging provider. @@ -736,9 +737,9 @@ def create_fcm_provider(self, provider_id: str, name: str, service_account_json: Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - service_account_json : dict + service_account_json : Optional[dict] FCM service account JSON. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -770,7 +771,7 @@ def create_fcm_provider(self, provider_id: str, name: str, service_account_json: 'content-type': 'application/json', }, api_params) - def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool = None, service_account_json: dict = None) -> Dict[str, Any]: + def update_fcm_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, service_account_json: Optional[dict] = None) -> Dict[str, Any]: """ Update a Firebase Cloud Messaging provider by its unique ID. @@ -778,11 +779,11 @@ def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - enabled : bool + enabled : Optional[bool] Set as enabled. - service_account_json : dict + service_account_json : Optional[dict] FCM service account JSON. Returns @@ -811,7 +812,7 @@ def update_fcm_provider(self, provider_id: str, name: str = None, enabled: bool 'content-type': 'application/json', }, api_params) - def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = None, domain: str = None, is_eu_region: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: + def create_mailgun_provider(self, provider_id: str, name: str, api_key: Optional[str] = None, domain: Optional[str] = None, is_eu_region: Optional[bool] = None, from_name: Optional[str] = None, from_email: Optional[str] = None, reply_to_name: Optional[str] = None, reply_to_email: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Mailgun provider. @@ -821,21 +822,21 @@ def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = No Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - api_key : str + api_key : Optional[str] Mailgun API Key. - domain : str + domain : Optional[str] Mailgun Domain. - is_eu_region : bool + is_eu_region : Optional[bool] Set as EU region. - from_name : str + from_name : Optional[str] Sender Name. - from_email : str + from_email : Optional[str] Sender email address. - reply_to_name : str + reply_to_name : Optional[str] Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well. - reply_to_email : str + reply_to_email : Optional[str] Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -873,7 +874,7 @@ def create_mailgun_provider(self, provider_id: str, name: str, api_key: str = No 'content-type': 'application/json', }, api_params) - def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: str = None, domain: str = None, is_eu_region: bool = None, enabled: bool = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None) -> Dict[str, Any]: + def update_mailgun_provider(self, provider_id: str, name: Optional[str] = None, api_key: Optional[str] = None, domain: Optional[str] = None, is_eu_region: Optional[bool] = None, enabled: Optional[bool] = None, from_name: Optional[str] = None, from_email: Optional[str] = None, reply_to_name: Optional[str] = None, reply_to_email: Optional[str] = None) -> Dict[str, Any]: """ Update a Mailgun provider by its unique ID. @@ -881,23 +882,23 @@ def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: s ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - api_key : str + api_key : Optional[str] Mailgun API Key. - domain : str + domain : Optional[str] Mailgun Domain. - is_eu_region : bool + is_eu_region : Optional[bool] Set as EU region. - enabled : bool + enabled : Optional[bool] Set as enabled. - from_name : str + from_name : Optional[str] Sender Name. - from_email : str + from_email : Optional[str] Sender email address. - reply_to_name : str + reply_to_name : Optional[str] Name set in the reply to field for the mail. Default value is sender name. - reply_to_email : str + reply_to_email : Optional[str] Email set in the reply to field for the mail. Default value is sender email. Returns @@ -932,7 +933,7 @@ def update_mailgun_provider(self, provider_id: str, name: str = None, api_key: s 'content-type': 'application/json', }, api_params) - def create_msg91_provider(self, provider_id: str, name: str, template_id: str = None, sender_id: str = None, auth_key: str = None, enabled: bool = None) -> Dict[str, Any]: + def create_msg91_provider(self, provider_id: str, name: str, template_id: Optional[str] = None, sender_id: Optional[str] = None, auth_key: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new MSG91 provider. @@ -942,13 +943,13 @@ def create_msg91_provider(self, provider_id: str, name: str, template_id: str = Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - template_id : str + template_id : Optional[str] Msg91 template ID - sender_id : str + sender_id : Optional[str] Msg91 sender ID. - auth_key : str + auth_key : Optional[str] Msg91 auth key. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -982,7 +983,7 @@ def create_msg91_provider(self, provider_id: str, name: str, template_id: str = 'content-type': 'application/json', }, api_params) - def update_msg91_provider(self, provider_id: str, name: str = None, enabled: bool = None, template_id: str = None, sender_id: str = None, auth_key: str = None) -> Dict[str, Any]: + def update_msg91_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, template_id: Optional[str] = None, sender_id: Optional[str] = None, auth_key: Optional[str] = None) -> Dict[str, Any]: """ Update a MSG91 provider by its unique ID. @@ -990,15 +991,15 @@ def update_msg91_provider(self, provider_id: str, name: str = None, enabled: boo ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - enabled : bool + enabled : Optional[bool] Set as enabled. - template_id : str + template_id : Optional[str] Msg91 template ID. - sender_id : str + sender_id : Optional[str] Msg91 sender ID. - auth_key : str + auth_key : Optional[str] Msg91 auth key. Returns @@ -1029,7 +1030,116 @@ def update_msg91_provider(self, provider_id: str, name: str = None, enabled: boo 'content-type': 'application/json', }, api_params) - def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: + def create_resend_provider(self, provider_id: str, name: str, api_key: Optional[str] = None, from_name: Optional[str] = None, from_email: Optional[str] = None, reply_to_name: Optional[str] = None, reply_to_email: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: + """ + Create a new Resend provider. + + Parameters + ---------- + provider_id : str + Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + name : str + Provider name. + api_key : Optional[str] + Resend API key. + from_name : Optional[str] + Sender Name. + from_email : Optional[str] + Sender email address. + reply_to_name : Optional[str] + Name set in the reply to field for the mail. Default value is sender name. + reply_to_email : Optional[str] + Email set in the reply to field for the mail. Default value is sender email. + enabled : Optional[bool] + Set as enabled. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/messaging/providers/resend' + 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_resend_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, api_key: Optional[str] = None, from_name: Optional[str] = None, from_email: Optional[str] = None, reply_to_name: Optional[str] = None, reply_to_email: Optional[str] = None) -> Dict[str, Any]: + """ + Update a Resend provider by its unique ID. + + Parameters + ---------- + provider_id : str + Provider ID. + name : Optional[str] + Provider name. + enabled : Optional[bool] + Set as enabled. + api_key : Optional[str] + Resend API key. + from_name : Optional[str] + Sender Name. + from_email : Optional[str] + Sender email address. + reply_to_name : Optional[str] + Name set in the Reply To field for the mail. Default value is Sender Name. + reply_to_email : Optional[str] + Email set in the Reply To field for the mail. Default value is Sender Email. + + Returns + ------- + Dict[str, Any] + API response as a dictionary + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/messaging/providers/resend/{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_sendgrid_provider(self, provider_id: str, name: str, api_key: Optional[str] = None, from_name: Optional[str] = None, from_email: Optional[str] = None, reply_to_name: Optional[str] = None, reply_to_email: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Sendgrid provider. @@ -1039,17 +1149,17 @@ def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = N Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - api_key : str + api_key : Optional[str] Sendgrid API key. - from_name : str + from_name : Optional[str] Sender Name. - from_email : str + from_email : Optional[str] Sender email address. - reply_to_name : str + reply_to_name : Optional[str] Name set in the reply to field for the mail. Default value is sender name. - reply_to_email : str + reply_to_email : Optional[str] Email set in the reply to field for the mail. Default value is sender email. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -1085,7 +1195,7 @@ def create_sendgrid_provider(self, provider_id: str, name: str, api_key: str = N 'content-type': 'application/json', }, api_params) - def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None) -> Dict[str, Any]: + def update_sendgrid_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, api_key: Optional[str] = None, from_name: Optional[str] = None, from_email: Optional[str] = None, reply_to_name: Optional[str] = None, reply_to_email: Optional[str] = None) -> Dict[str, Any]: """ Update a Sendgrid provider by its unique ID. @@ -1093,19 +1203,19 @@ def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - enabled : bool + enabled : Optional[bool] Set as enabled. - api_key : str + api_key : Optional[str] Sendgrid API key. - from_name : str + from_name : Optional[str] Sender Name. - from_email : str + from_email : Optional[str] Sender email address. - reply_to_name : str + reply_to_name : Optional[str] Name set in the Reply To field for the mail. Default value is Sender Name. - reply_to_email : str + reply_to_email : Optional[str] Email set in the Reply To field for the mail. Default value is Sender Email. Returns @@ -1138,7 +1248,7 @@ def update_sendgrid_provider(self, provider_id: str, name: str = None, enabled: 'content-type': 'application/json', }, api_params) - def create_smtp_provider(self, provider_id: str, name: str, host: str, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: + def create_smtp_provider(self, provider_id: str, name: str, host: str, port: Optional[float] = None, username: Optional[str] = None, password: Optional[str] = None, encryption: Optional[SmtpEncryption] = None, auto_tls: Optional[bool] = None, mailer: Optional[str] = None, from_name: Optional[str] = None, from_email: Optional[str] = None, reply_to_name: Optional[str] = None, reply_to_email: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new SMTP provider. @@ -1150,27 +1260,27 @@ def create_smtp_provider(self, provider_id: str, name: str, host: str, port: flo Provider name. host : str SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - port : float + port : Optional[float] The default SMTP server port. - username : str + username : Optional[str] Authentication username. - password : str + password : Optional[str] Authentication password. - encryption : SmtpEncryption + encryption : Optional[SmtpEncryption] Encryption type. Can be omitted, 'ssl', or 'tls' - auto_tls : bool + auto_tls : Optional[bool] Enable SMTP AutoTLS feature. - mailer : str + mailer : Optional[str] The value to use for the X-Mailer header. - from_name : str + from_name : Optional[str] Sender Name. - from_email : str + from_email : Optional[str] Sender email address. - reply_to_name : str + reply_to_name : Optional[str] Name set in the reply to field for the mail. Default value is sender name. - reply_to_email : str + reply_to_email : Optional[str] Email set in the reply to field for the mail. Default value is sender email. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -1215,7 +1325,7 @@ def create_smtp_provider(self, provider_id: str, name: str, host: str, port: flo 'content-type': 'application/json', }, api_params) - def update_smtp_provider(self, provider_id: str, name: str = None, host: str = None, port: float = None, username: str = None, password: str = None, encryption: SmtpEncryption = None, auto_tls: bool = None, mailer: str = None, from_name: str = None, from_email: str = None, reply_to_name: str = None, reply_to_email: str = None, enabled: bool = None) -> Dict[str, Any]: + def update_smtp_provider(self, provider_id: str, name: Optional[str] = None, host: Optional[str] = None, port: Optional[float] = None, username: Optional[str] = None, password: Optional[str] = None, encryption: Optional[SmtpEncryption] = None, auto_tls: Optional[bool] = None, mailer: Optional[str] = None, from_name: Optional[str] = None, from_email: Optional[str] = None, reply_to_name: Optional[str] = None, reply_to_email: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Update a SMTP provider by its unique ID. @@ -1223,31 +1333,31 @@ def update_smtp_provider(self, provider_id: str, name: str = None, host: str = N ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - host : str + host : Optional[str] SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - port : float + port : Optional[float] SMTP port. - username : str + username : Optional[str] Authentication username. - password : str + password : Optional[str] Authentication password. - encryption : SmtpEncryption + encryption : Optional[SmtpEncryption] Encryption type. Can be 'ssl' or 'tls' - auto_tls : bool + auto_tls : Optional[bool] Enable SMTP AutoTLS feature. - mailer : str + mailer : Optional[str] The value to use for the X-Mailer header. - from_name : str + from_name : Optional[str] Sender Name. - from_email : str + from_email : Optional[str] Sender email address. - reply_to_name : str + reply_to_name : Optional[str] Name set in the Reply To field for the mail. Default value is Sender Name. - reply_to_email : str + reply_to_email : Optional[str] Email set in the Reply To field for the mail. Default value is Sender Email. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -1286,7 +1396,7 @@ def update_smtp_provider(self, provider_id: str, name: str = None, host: str = N 'content-type': 'application/json', }, api_params) - def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = None, customer_id: str = None, api_key: str = None, enabled: bool = None) -> Dict[str, Any]: + def create_telesign_provider(self, provider_id: str, name: str, xfrom: Optional[str] = None, customer_id: Optional[str] = None, api_key: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Telesign provider. @@ -1296,13 +1406,13 @@ def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = Non Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - xfrom : str + xfrom : Optional[str] Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - customer_id : str + customer_id : Optional[str] Telesign customer ID. - api_key : str + api_key : Optional[str] Telesign API key. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -1336,7 +1446,7 @@ def create_telesign_provider(self, provider_id: str, name: str, xfrom: str = Non 'content-type': 'application/json', }, api_params) - def update_telesign_provider(self, provider_id: str, name: str = None, enabled: bool = None, customer_id: str = None, api_key: str = None, xfrom: str = None) -> Dict[str, Any]: + def update_telesign_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, customer_id: Optional[str] = None, api_key: Optional[str] = None, xfrom: Optional[str] = None) -> Dict[str, Any]: """ Update a Telesign provider by its unique ID. @@ -1344,15 +1454,15 @@ def update_telesign_provider(self, provider_id: str, name: str = None, enabled: ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - enabled : bool + enabled : Optional[bool] Set as enabled. - customer_id : str + customer_id : Optional[str] Telesign customer ID. - api_key : str + api_key : Optional[str] Telesign API key. - xfrom : str + xfrom : Optional[str] Sender number. Returns @@ -1383,7 +1493,7 @@ def update_telesign_provider(self, provider_id: str, name: str = None, enabled: 'content-type': 'application/json', }, api_params) - def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = None, username: str = None, api_key: str = None, enabled: bool = None) -> Dict[str, Any]: + def create_textmagic_provider(self, provider_id: str, name: str, xfrom: Optional[str] = None, username: Optional[str] = None, api_key: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Textmagic provider. @@ -1393,13 +1503,13 @@ def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = No Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - xfrom : str + xfrom : Optional[str] Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - username : str + username : Optional[str] Textmagic username. - api_key : str + api_key : Optional[str] Textmagic apiKey. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -1433,7 +1543,7 @@ def create_textmagic_provider(self, provider_id: str, name: str, xfrom: str = No 'content-type': 'application/json', }, api_params) - def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: bool = None, username: str = None, api_key: str = None, xfrom: str = None) -> Dict[str, Any]: + def update_textmagic_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, username: Optional[str] = None, api_key: Optional[str] = None, xfrom: Optional[str] = None) -> Dict[str, Any]: """ Update a Textmagic provider by its unique ID. @@ -1441,15 +1551,15 @@ def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - enabled : bool + enabled : Optional[bool] Set as enabled. - username : str + username : Optional[str] Textmagic username. - api_key : str + api_key : Optional[str] Textmagic apiKey. - xfrom : str + xfrom : Optional[str] Sender number. Returns @@ -1480,7 +1590,7 @@ def update_textmagic_provider(self, provider_id: str, name: str = None, enabled: 'content-type': 'application/json', }, api_params) - def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, account_sid: str = None, auth_token: str = None, enabled: bool = None) -> Dict[str, Any]: + def create_twilio_provider(self, provider_id: str, name: str, xfrom: Optional[str] = None, account_sid: Optional[str] = None, auth_token: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Twilio provider. @@ -1490,13 +1600,13 @@ def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - xfrom : str + xfrom : Optional[str] Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - account_sid : str + account_sid : Optional[str] Twilio account secret ID. - auth_token : str + auth_token : Optional[str] Twilio authentication token. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -1530,7 +1640,7 @@ def create_twilio_provider(self, provider_id: str, name: str, xfrom: str = None, 'content-type': 'application/json', }, api_params) - def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bool = None, account_sid: str = None, auth_token: str = None, xfrom: str = None) -> Dict[str, Any]: + def update_twilio_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, account_sid: Optional[str] = None, auth_token: Optional[str] = None, xfrom: Optional[str] = None) -> Dict[str, Any]: """ Update a Twilio provider by its unique ID. @@ -1538,15 +1648,15 @@ def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bo ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - enabled : bool + enabled : Optional[bool] Set as enabled. - account_sid : str + account_sid : Optional[str] Twilio account secret ID. - auth_token : str + auth_token : Optional[str] Twilio authentication token. - xfrom : str + xfrom : Optional[str] Sender number. Returns @@ -1577,7 +1687,7 @@ def update_twilio_provider(self, provider_id: str, name: str = None, enabled: bo 'content-type': 'application/json', }, api_params) - def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, api_key: str = None, api_secret: str = None, enabled: bool = None) -> Dict[str, Any]: + def create_vonage_provider(self, provider_id: str, name: str, xfrom: Optional[str] = None, api_key: Optional[str] = None, api_secret: Optional[str] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Vonage provider. @@ -1587,13 +1697,13 @@ def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Provider name. - xfrom : str + xfrom : Optional[str] Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - api_key : str + api_key : Optional[str] Vonage API key. - api_secret : str + api_secret : Optional[str] Vonage API secret. - enabled : bool + enabled : Optional[bool] Set as enabled. Returns @@ -1627,7 +1737,7 @@ def create_vonage_provider(self, provider_id: str, name: str, xfrom: str = None, 'content-type': 'application/json', }, api_params) - def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bool = None, api_key: str = None, api_secret: str = None, xfrom: str = None) -> Dict[str, Any]: + def update_vonage_provider(self, provider_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, api_key: Optional[str] = None, api_secret: Optional[str] = None, xfrom: Optional[str] = None) -> Dict[str, Any]: """ Update a Vonage provider by its unique ID. @@ -1635,15 +1745,15 @@ def update_vonage_provider(self, provider_id: str, name: str = None, enabled: bo ---------- provider_id : str Provider ID. - name : str + name : Optional[str] Provider name. - enabled : bool + enabled : Optional[bool] Set as enabled. - api_key : str + api_key : Optional[str] Vonage API key. - api_secret : str + api_secret : Optional[str] Vonage API secret. - xfrom : str + xfrom : Optional[str] Sender number. Returns @@ -1738,7 +1848,7 @@ def delete_provider(self, provider_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_provider_logs(self, provider_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get the provider activity logs listed by its unique ID. @@ -1746,7 +1856,7 @@ def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dic ---------- provider_id : str Provider ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset Returns @@ -1772,7 +1882,7 @@ def list_provider_logs(self, provider_id: str, queries: List[str] = None) -> Dic return self.client.call('get', api_path, { }, api_params) - def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_subscriber_logs(self, subscriber_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get the subscriber activity logs listed by its unique ID. @@ -1780,7 +1890,7 @@ def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> ---------- subscriber_id : str Subscriber ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset Returns @@ -1806,15 +1916,15 @@ def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None) -> return self.client.call('get', api_path, { }, api_params) - def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_topics(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all topics from the current Appwrite project. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -1837,7 +1947,7 @@ def list_topics(self, queries: List[str] = None, search: str = None) -> Dict[str return self.client.call('get', api_path, { }, api_params) - def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None) -> Dict[str, Any]: + def create_topic(self, topic_id: str, name: str, subscribe: Optional[List[str]] = None) -> Dict[str, Any]: """ Create a new topic. @@ -1847,7 +1957,7 @@ def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None) -> Topic ID. Choose a custom Topic ID or a new Topic ID. name : str Topic Name. - subscribe : List[str] + subscribe : Optional[List[str]] An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. Returns @@ -1910,7 +2020,7 @@ def get_topic(self, topic_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = None) -> Dict[str, Any]: + def update_topic(self, topic_id: str, name: Optional[str] = None, subscribe: Optional[List[str]] = None) -> Dict[str, Any]: """ Update a topic by its unique ID. @@ -1919,9 +2029,9 @@ def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = N ---------- topic_id : str Topic ID. - name : str + name : Optional[str] Topic Name. - subscribe : List[str] + subscribe : Optional[List[str]] An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. Returns @@ -1981,7 +2091,7 @@ def delete_topic(self, topic_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_topic_logs(self, topic_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get the topic activity logs listed by its unique ID. @@ -1989,7 +2099,7 @@ def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, ---------- topic_id : str Topic ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset Returns @@ -2015,7 +2125,7 @@ def list_topic_logs(self, topic_id: str, queries: List[str] = None) -> Dict[str, return self.client.call('get', api_path, { }, api_params) - def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_subscribers(self, topic_id: str, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all subscribers from the current Appwrite project. @@ -2023,9 +2133,9 @@ def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str ---------- topic_id : str Topic ID. The topic ID subscribed to. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns diff --git a/appwrite/services/sites.py b/appwrite/services/sites.py index 5a9c49a..f1563cc 100644 --- a/appwrite/services/sites.py +++ b/appwrite/services/sites.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.framework import Framework; from ..enums.build_runtime import BuildRuntime; from ..enums.adapter import Adapter; @@ -13,15 +14,15 @@ class Sites(Service): def __init__(self, client) -> None: super(Sites, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the project's sites. You can use the query params to filter your results. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -44,7 +45,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create(self, site_id: str, name: str, framework: Framework, build_runtime: BuildRuntime, enabled: bool = None, logging: bool = None, timeout: float = None, install_command: str = None, build_command: str = None, output_directory: str = None, adapter: Adapter = None, installation_id: str = None, fallback_file: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: + def create(self, site_id: str, name: str, framework: Framework, build_runtime: BuildRuntime, enabled: Optional[bool] = None, logging: Optional[bool] = None, timeout: Optional[float] = None, install_command: Optional[str] = None, build_command: Optional[str] = None, output_directory: Optional[str] = None, adapter: Optional[Adapter] = None, installation_id: Optional[str] = None, fallback_file: Optional[str] = None, provider_repository_id: Optional[str] = None, provider_branch: Optional[str] = None, provider_silent_mode: Optional[bool] = None, provider_root_directory: Optional[str] = None, specification: Optional[str] = None) -> Dict[str, Any]: """ Create a new site. @@ -58,33 +59,33 @@ def create(self, site_id: str, name: str, framework: Framework, build_runtime: B Sites framework. build_runtime : BuildRuntime Runtime to use during build step. - enabled : bool + enabled : Optional[bool] Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. - logging : bool + logging : Optional[bool] When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - timeout : float + timeout : Optional[float] Maximum request time in seconds. - install_command : str + install_command : Optional[str] Install Command. - build_command : str + build_command : Optional[str] Build Command. - output_directory : str + output_directory : Optional[str] Output Directory for site. - adapter : Adapter + adapter : Optional[Adapter] Framework adapter defining rendering strategy. Allowed values are: static, ssr - installation_id : str + installation_id : Optional[str] Appwrite Installation ID for VCS (Version Control System) deployment. - fallback_file : str + fallback_file : Optional[str] Fallback file for single page application sites. - provider_repository_id : str + provider_repository_id : Optional[str] Repository ID of the repo linked to the site. - provider_branch : str + provider_branch : Optional[str] Production branch for the repo linked to the site. - provider_silent_mode : bool + provider_silent_mode : Optional[bool] Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. - provider_root_directory : str + provider_root_directory : Optional[str] Path to site code in the linked repo. - specification : str + specification : Optional[str] Framework specification for the site and builds. Returns @@ -209,7 +210,7 @@ def get(self, site_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update(self, site_id: str, name: str, framework: Framework, enabled: bool = None, logging: bool = None, timeout: float = None, install_command: str = None, build_command: str = None, output_directory: str = None, build_runtime: BuildRuntime = None, adapter: Adapter = None, fallback_file: str = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None) -> Dict[str, Any]: + def update(self, site_id: str, name: str, framework: Framework, enabled: Optional[bool] = None, logging: Optional[bool] = None, timeout: Optional[float] = None, install_command: Optional[str] = None, build_command: Optional[str] = None, output_directory: Optional[str] = None, build_runtime: Optional[BuildRuntime] = None, adapter: Optional[Adapter] = None, fallback_file: Optional[str] = None, installation_id: Optional[str] = None, provider_repository_id: Optional[str] = None, provider_branch: Optional[str] = None, provider_silent_mode: Optional[bool] = None, provider_root_directory: Optional[str] = None, specification: Optional[str] = None) -> Dict[str, Any]: """ Update site by its unique ID. @@ -221,35 +222,35 @@ def update(self, site_id: str, name: str, framework: Framework, enabled: bool = Site name. Max length: 128 chars. framework : Framework Sites framework. - enabled : bool + enabled : Optional[bool] Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. - logging : bool + logging : Optional[bool] When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - timeout : float + timeout : Optional[float] Maximum request time in seconds. - install_command : str + install_command : Optional[str] Install Command. - build_command : str + build_command : Optional[str] Build Command. - output_directory : str + output_directory : Optional[str] Output Directory for site. - build_runtime : BuildRuntime + build_runtime : Optional[BuildRuntime] Runtime to use during build step. - adapter : Adapter + adapter : Optional[Adapter] Framework adapter defining rendering strategy. Allowed values are: static, ssr - fallback_file : str + fallback_file : Optional[str] Fallback file for single page application sites. - installation_id : str + installation_id : Optional[str] Appwrite Installation ID for VCS (Version Control System) deployment. - provider_repository_id : str + provider_repository_id : Optional[str] Repository ID of the repo linked to the site. - provider_branch : str + provider_branch : Optional[str] Production branch for the repo linked to the site. - provider_silent_mode : bool + provider_silent_mode : Optional[bool] Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. - provider_root_directory : str + provider_root_directory : Optional[str] Path to site code in the linked repo. - specification : str + specification : Optional[str] Framework specification for the site and builds. Returns @@ -368,7 +369,7 @@ def update_site_deployment(self, site_id: str, deployment_id: str) -> Dict[str, 'content-type': 'application/json', }, api_params) - def list_deployments(self, site_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_deployments(self, site_id: str, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the site's code deployments. You can use the query params to filter your results. @@ -376,9 +377,9 @@ def list_deployments(self, site_id: str, queries: List[str] = None, search: str ---------- site_id : str Site ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -405,7 +406,7 @@ def list_deployments(self, site_id: str, queries: List[str] = None, search: str return self.client.call('get', api_path, { }, api_params) - def create_deployment(self, site_id: str, code: InputFile, activate: bool, install_command: str = None, build_command: str = None, output_directory: str = None, on_progress = None) -> Dict[str, Any]: + def create_deployment(self, site_id: str, code: InputFile, activate: bool, install_command: Optional[str] = None, build_command: Optional[str] = None, output_directory: Optional[str] = None, on_progress = None) -> Dict[str, Any]: """ Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID. @@ -417,11 +418,11 @@ def create_deployment(self, site_id: str, code: InputFile, activate: bool, insta Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. activate : bool Automatically activate the deployment when it is finished building. - install_command : str + install_command : Optional[str] Install Commands. - build_command : str + build_command : Optional[str] Build Commands. - output_directory : str + output_directory : Optional[str] Output Directory. on_progress : callable, optional Optional callback for upload progress @@ -503,7 +504,7 @@ def create_duplicate_deployment(self, site_id: str, deployment_id: str) -> Dict[ 'content-type': 'application/json', }, api_params) - def create_template_deployment(self, site_id: str, repository: str, owner: str, root_directory: str, version: str, activate: bool = None) -> Dict[str, Any]: + def create_template_deployment(self, site_id: str, repository: str, owner: str, root_directory: str, version: str, activate: Optional[bool] = None) -> Dict[str, Any]: """ Create a deployment based on a template. @@ -521,7 +522,7 @@ def create_template_deployment(self, site_id: str, repository: str, owner: str, Path to site code in the template repo. version : str Version (tag) for the repo linked to the site template. - activate : bool + activate : Optional[bool] Automatically activate the deployment when it is finished building. Returns @@ -564,7 +565,7 @@ def create_template_deployment(self, site_id: str, repository: str, owner: str, 'content-type': 'application/json', }, api_params) - def create_vcs_deployment(self, site_id: str, type: VCSDeploymentType, reference: str, activate: bool = None) -> Dict[str, Any]: + def create_vcs_deployment(self, site_id: str, type: VCSDeploymentType, reference: str, activate: Optional[bool] = None) -> Dict[str, Any]: """ Create a deployment when a site is connected to VCS. @@ -578,7 +579,7 @@ def create_vcs_deployment(self, site_id: str, type: VCSDeploymentType, reference Type of reference passed. Allowed values are: branch, commit reference : str VCS reference to create deployment from. Depending on type this can be: branch name, commit hash - activate : bool + activate : Optional[bool] Automatically activate the deployment when it is finished building. Returns @@ -688,7 +689,7 @@ def delete_deployment(self, site_id: str, deployment_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def get_deployment_download(self, site_id: str, deployment_id: str, type: DeploymentDownloadType = None) -> bytes: + def get_deployment_download(self, site_id: str, deployment_id: str, type: Optional[DeploymentDownloadType] = None) -> bytes: """ Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. @@ -698,7 +699,7 @@ def get_deployment_download(self, site_id: str, deployment_id: str, type: Deploy Site ID. deployment_id : str Deployment ID. - type : DeploymentDownloadType + type : Optional[DeploymentDownloadType] Deployment file to download. Can be: "source", "output". Returns @@ -766,7 +767,7 @@ def update_deployment_status(self, site_id: str, deployment_id: str) -> Dict[str 'content-type': 'application/json', }, api_params) - def list_logs(self, site_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_logs(self, site_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get a list of all site logs. You can use the query params to filter your results. @@ -774,7 +775,7 @@ def list_logs(self, site_id: str, queries: List[str] = None) -> Dict[str, Any]: ---------- site_id : str Site ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId Returns @@ -906,7 +907,7 @@ def list_variables(self, site_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create_variable(self, site_id: str, key: str, value: str, secret: bool = None) -> Dict[str, Any]: + def create_variable(self, site_id: str, key: str, value: str, secret: Optional[bool] = None) -> Dict[str, Any]: """ Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. @@ -918,7 +919,7 @@ def create_variable(self, site_id: str, key: str, value: str, secret: bool = Non Variable key. Max length: 255 chars. value : str Variable value. Max length: 8192 chars. - secret : bool + secret : Optional[bool] Secret variables can be updated or deleted, but only sites can read them during build and runtime. Returns @@ -990,7 +991,7 @@ def get_variable(self, site_id: str, variable_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_variable(self, site_id: str, variable_id: str, key: str, value: str = None, secret: bool = None) -> Dict[str, Any]: + def update_variable(self, site_id: str, variable_id: str, key: str, value: Optional[str] = None, secret: Optional[bool] = None) -> Dict[str, Any]: """ Update variable by its unique ID. @@ -1002,9 +1003,9 @@ def update_variable(self, site_id: str, variable_id: str, key: str, value: str = Variable unique ID. key : str Variable key. Max length: 255 chars. - value : str + value : Optional[str] Variable value. Max length: 8192 chars. - secret : bool + secret : Optional[bool] Secret variables can be updated or deleted, but only sites can read them during build and runtime. Returns diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index 22198eb..3fe708c 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.compression import Compression; from ..input_file import InputFile from ..enums.image_gravity import ImageGravity; @@ -11,15 +12,15 @@ class Storage(Service): def __init__(self, client) -> None: super(Storage, self).__init__(client) - def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_buckets(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the storage buckets. You can use the query params to filter your results. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -42,7 +43,7 @@ def list_buckets(self, queries: List[str] = None, search: str = None) -> Dict[st return self.client.call('get', api_path, { }, api_params) - def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None) -> Dict[str, Any]: + def create_bucket(self, bucket_id: str, name: str, permissions: Optional[List[str]] = None, file_security: Optional[bool] = None, enabled: Optional[bool] = None, maximum_file_size: Optional[float] = None, allowed_file_extensions: Optional[List[str]] = None, compression: Optional[Compression] = None, encryption: Optional[bool] = None, antivirus: Optional[bool] = None) -> Dict[str, Any]: """ Create a new storage bucket. @@ -52,21 +53,21 @@ def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Bucket name - permissions : List[str] + permissions : Optional[List[str]] An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - file_security : bool + file_security : Optional[bool] Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). - enabled : bool + enabled : Optional[bool] Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - maximum_file_size : float + maximum_file_size : Optional[float] Maximum file size allowed in bytes. Maximum allowed value is 30MB. - allowed_file_extensions : List[str] + allowed_file_extensions : Optional[List[str]] Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. - compression : Compression + compression : Optional[Compression] Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled - encryption : bool + encryption : Optional[bool] Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled - antivirus : bool + antivirus : Optional[bool] Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled Returns @@ -135,7 +136,7 @@ def get_bucket(self, bucket_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None) -> Dict[str, Any]: + def update_bucket(self, bucket_id: str, name: str, permissions: Optional[List[str]] = None, file_security: Optional[bool] = None, enabled: Optional[bool] = None, maximum_file_size: Optional[float] = None, allowed_file_extensions: Optional[List[str]] = None, compression: Optional[Compression] = None, encryption: Optional[bool] = None, antivirus: Optional[bool] = None) -> Dict[str, Any]: """ Update a storage bucket by its unique ID. @@ -145,21 +146,21 @@ def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None Bucket unique ID. name : str Bucket name - permissions : List[str] + permissions : Optional[List[str]] An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - file_security : bool + file_security : Optional[bool] Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). - enabled : bool + enabled : Optional[bool] Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - maximum_file_size : float + maximum_file_size : Optional[float] Maximum file size allowed in bytes. Maximum allowed value is 30MB. - allowed_file_extensions : List[str] + allowed_file_extensions : Optional[List[str]] Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. - compression : Compression + compression : Optional[Compression] Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled - encryption : bool + encryption : Optional[bool] Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled - antivirus : bool + antivirus : Optional[bool] Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled Returns @@ -229,7 +230,7 @@ def delete_bucket(self, bucket_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_files(self, bucket_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_files(self, bucket_id: str, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the user files. You can use the query params to filter your results. @@ -237,9 +238,9 @@ def list_files(self, bucket_id: str, queries: List[str] = None, search: str = No ---------- bucket_id : str Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -266,7 +267,7 @@ def list_files(self, bucket_id: str, queries: List[str] = None, search: str = No return self.client.call('get', api_path, { }, api_params) - def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: List[str] = None, on_progress = None) -> Dict[str, Any]: + def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: Optional[List[str]] = None, on_progress = None) -> Dict[str, Any]: """ Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console. @@ -285,7 +286,7 @@ def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. file : InputFile Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). - permissions : List[str] + permissions : Optional[List[str]] An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). on_progress : callable, optional Optional callback for upload progress @@ -365,7 +366,7 @@ def get_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: List[str] = None) -> Dict[str, Any]: + def update_file(self, bucket_id: str, file_id: str, name: Optional[str] = None, permissions: Optional[List[str]] = None) -> Dict[str, Any]: """ Update a file by its unique ID. Only users with write permissions have access to update this resource. @@ -375,9 +376,9 @@ def update_file(self, bucket_id: str, file_id: str, name: str = None, permission Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). file_id : str File unique ID. - name : str + name : Optional[str] Name of the file - permissions : List[str] + permissions : Optional[List[str]] An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). Returns @@ -447,7 +448,7 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def get_file_download(self, bucket_id: str, file_id: str, token: str = None) -> bytes: + def get_file_download(self, bucket_id: str, file_id: str, token: Optional[str] = None) -> bytes: """ Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. @@ -457,7 +458,7 @@ def get_file_download(self, bucket_id: str, file_id: str, token: str = None) -> Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). file_id : str File ID. - token : str + token : Optional[str] File token for accessing this file. Returns @@ -487,7 +488,7 @@ def get_file_download(self, bucket_id: str, file_id: str, token: str = None) -> return self.client.call('get', api_path, { }, api_params) - def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None, token: str = None) -> bytes: + def get_file_preview(self, bucket_id: str, file_id: str, width: Optional[float] = None, height: Optional[float] = None, gravity: Optional[ImageGravity] = None, quality: Optional[float] = None, border_width: Optional[float] = None, border_color: Optional[str] = None, border_radius: Optional[float] = None, opacity: Optional[float] = None, rotation: Optional[float] = None, background: Optional[str] = None, output: Optional[ImageFormat] = None, token: Optional[str] = None) -> bytes: """ Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. @@ -497,29 +498,29 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). file_id : str File ID - width : float + width : Optional[float] Resize preview image width, Pass an integer between 0 to 4000. - height : float + height : Optional[float] Resize preview image height, Pass an integer between 0 to 4000. - gravity : ImageGravity + gravity : Optional[ImageGravity] Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right - quality : float + quality : Optional[float] Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. - border_width : float + border_width : Optional[float] Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. - border_color : str + border_color : Optional[str] Preview image border color. Use a valid HEX color, no # is needed for prefix. - border_radius : float + border_radius : Optional[float] Preview image border radius in pixels. Pass an integer between 0 to 4000. - opacity : float + opacity : Optional[float] Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. - rotation : float + rotation : Optional[float] Preview image rotation in degrees. Pass an integer between -360 and 360. - background : str + background : Optional[str] Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. - output : ImageFormat + output : Optional[ImageFormat] Output format type (jpeg, jpg, png, gif and webp). - token : str + token : Optional[str] File token for accessing this file. Returns @@ -560,7 +561,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he return self.client.call('get', api_path, { }, api_params) - def get_file_view(self, bucket_id: str, file_id: str, token: str = None) -> bytes: + def get_file_view(self, bucket_id: str, file_id: str, token: Optional[str] = None) -> bytes: """ Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. @@ -570,7 +571,7 @@ def get_file_view(self, bucket_id: str, file_id: str, token: str = None) -> byte Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). file_id : str File ID. - token : str + token : Optional[str] File token for accessing this file. Returns diff --git a/appwrite/services/tables_db.py b/appwrite/services/tables_db.py index 03852dc..20331b9 100644 --- a/appwrite/services/tables_db.py +++ b/appwrite/services/tables_db.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.relationship_type import RelationshipType; from ..enums.relation_mutate import RelationMutate; from ..enums.index_type import IndexType; @@ -10,15 +11,15 @@ class TablesDB(Service): def __init__(self, client) -> None: super(TablesDB, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -41,7 +42,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: + def create(self, database_id: str, name: str, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Database. @@ -52,7 +53,7 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Database name. Max length: 128 chars. - enabled : bool + enabled : Optional[bool] Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. Returns @@ -83,13 +84,13 @@ def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, 'content-type': 'application/json', }, api_params) - def list_transactions(self, queries: List[str] = None) -> Dict[str, Any]: + def list_transactions(self, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ List transactions across all databases. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Returns @@ -111,13 +112,13 @@ def list_transactions(self, queries: List[str] = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create_transaction(self, ttl: float = None) -> Dict[str, Any]: + def create_transaction(self, ttl: Optional[float] = None) -> Dict[str, Any]: """ Create a new transaction. Parameters ---------- - ttl : float + ttl : Optional[float] Seconds before the transaction expires. Returns @@ -171,7 +172,7 @@ def get_transaction(self, transaction_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_transaction(self, transaction_id: str, commit: bool = None, rollback: bool = None) -> Dict[str, Any]: + def update_transaction(self, transaction_id: str, commit: Optional[bool] = None, rollback: Optional[bool] = None) -> Dict[str, Any]: """ Update a transaction, to either commit or roll back its operations. @@ -179,9 +180,9 @@ def update_transaction(self, transaction_id: str, commit: bool = None, rollback: ---------- transaction_id : str Transaction ID. - commit : bool + commit : Optional[bool] Commit transaction? - rollback : bool + rollback : Optional[bool] Rollback transaction? Returns @@ -241,7 +242,7 @@ def delete_transaction(self, transaction_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def create_operations(self, transaction_id: str, operations: List[dict] = None) -> Dict[str, Any]: + def create_operations(self, transaction_id: str, operations: Optional[List[dict]] = None) -> Dict[str, Any]: """ Create multiple operations in a single transaction. @@ -249,7 +250,7 @@ def create_operations(self, transaction_id: str, operations: List[dict] = None) ---------- transaction_id : str Transaction ID. - operations : List[dict] + operations : Optional[List[dict]] Array of staged operations. Returns @@ -307,7 +308,7 @@ def get(self, database_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]: + def update(self, database_id: str, name: str, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Update a database by its unique ID. @@ -317,7 +318,7 @@ def update(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Database ID. name : str Database name. Max length: 128 chars. - enabled : bool + enabled : Optional[bool] Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. Returns @@ -380,7 +381,7 @@ def delete(self, database_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_tables(self, database_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_tables(self, database_id: str, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results. @@ -388,9 +389,9 @@ def list_tables(self, database_id: str, queries: List[str] = None, search: str = ---------- database_id : str Database ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -417,7 +418,7 @@ def list_tables(self, database_id: str, queries: List[str] = None, search: str = return self.client.call('get', api_path, { }, api_params) - def create_table(self, database_id: str, table_id: str, name: str, permissions: List[str] = None, row_security: bool = None, enabled: bool = None) -> Dict[str, Any]: + def create_table(self, database_id: str, table_id: str, name: str, permissions: Optional[List[str]] = None, row_security: Optional[bool] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -429,11 +430,11 @@ def create_table(self, database_id: str, table_id: str, name: str, permissions: Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Table name. Max length: 128 chars. - permissions : List[str] + permissions : Optional[List[str]] An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - row_security : bool + row_security : Optional[bool] Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). - enabled : bool + enabled : Optional[bool] Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. Returns @@ -507,7 +508,7 @@ def get_table(self, database_id: str, table_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_table(self, database_id: str, table_id: str, name: str, permissions: List[str] = None, row_security: bool = None, enabled: bool = None) -> Dict[str, Any]: + def update_table(self, database_id: str, table_id: str, name: str, permissions: Optional[List[str]] = None, row_security: Optional[bool] = None, enabled: Optional[bool] = None) -> Dict[str, Any]: """ Update a table by its unique ID. @@ -519,11 +520,11 @@ def update_table(self, database_id: str, table_id: str, name: str, permissions: Table ID. name : str Table name. Max length: 128 chars. - permissions : List[str] + permissions : Optional[List[str]] An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - row_security : bool + row_security : Optional[bool] Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - enabled : bool + enabled : Optional[bool] Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. Returns @@ -598,7 +599,7 @@ def delete_table(self, database_id: str, table_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_columns(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_columns(self, database_id: str, table_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ List columns in the table. @@ -608,7 +609,7 @@ def list_columns(self, database_id: str, table_id: str, queries: List[str] = Non Database ID. table_id : str Table ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error Returns @@ -638,7 +639,7 @@ def list_columns(self, database_id: str, table_id: str, queries: List[str] = Non return self.client.call('get', api_path, { }, api_params) - def create_boolean_column(self, database_id: str, table_id: str, key: str, required: bool, default: bool = None, array: bool = None) -> Dict[str, Any]: + def create_boolean_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[bool] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create a boolean column. @@ -653,9 +654,9 @@ def create_boolean_column(self, database_id: str, table_id: str, key: str, requi Column Key. required : bool Is column required? - default : bool + default : Optional[bool] Default value for column when not provided. Cannot be set when column is required. - array : bool + array : Optional[bool] Is column an array? Returns @@ -695,7 +696,7 @@ def create_boolean_column(self, database_id: str, table_id: str, key: str, requi 'content-type': 'application/json', }, api_params) - def update_boolean_column(self, database_id: str, table_id: str, key: str, required: bool, default: bool, new_key: str = None) -> Dict[str, Any]: + def update_boolean_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[bool], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a boolean column. Changing the `default` value will not update already existing rows. @@ -709,9 +710,9 @@ def update_boolean_column(self, database_id: str, table_id: str, key: str, requi Column Key. required : bool Is column required? - default : bool + default : Optional[bool] Default value for column when not provided. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -751,7 +752,7 @@ def update_boolean_column(self, database_id: str, table_id: str, key: str, requi 'content-type': 'application/json', }, api_params) - def create_datetime_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + def create_datetime_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create a date time column according to the ISO 8601 standard. @@ -765,9 +766,9 @@ def create_datetime_column(self, database_id: str, table_id: str, key: str, requ Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. - array : bool + array : Optional[bool] Is column an array? Returns @@ -807,7 +808,7 @@ def create_datetime_column(self, database_id: str, table_id: str, key: str, requ 'content-type': 'application/json', }, api_params) - def update_datetime_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + def update_datetime_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a date time column. Changing the `default` value will not update already existing rows. @@ -821,9 +822,9 @@ def update_datetime_column(self, database_id: str, table_id: str, key: str, requ Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -863,7 +864,7 @@ def update_datetime_column(self, database_id: str, table_id: str, key: str, requ 'content-type': 'application/json', }, api_params) - def create_email_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + def create_email_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create an email column. @@ -878,9 +879,9 @@ def create_email_column(self, database_id: str, table_id: str, key: str, require Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - array : bool + array : Optional[bool] Is column an array? Returns @@ -920,7 +921,7 @@ def create_email_column(self, database_id: str, table_id: str, key: str, require 'content-type': 'application/json', }, api_params) - def update_email_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + def update_email_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an email column. Changing the `default` value will not update already existing rows. @@ -935,9 +936,9 @@ def update_email_column(self, database_id: str, table_id: str, key: str, require Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -977,7 +978,7 @@ def update_email_column(self, database_id: str, table_id: str, key: str, require 'content-type': 'application/json', }, api_params) - def create_enum_column(self, database_id: str, table_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + def create_enum_column(self, database_id: str, table_id: str, key: str, elements: List[str], required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column. @@ -993,9 +994,9 @@ def create_enum_column(self, database_id: str, table_id: str, key: str, elements Array of enum values. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - array : bool + array : Optional[bool] Is column an array? Returns @@ -1039,7 +1040,7 @@ def create_enum_column(self, database_id: str, table_id: str, key: str, elements 'content-type': 'application/json', }, api_params) - def update_enum_column(self, database_id: str, table_id: str, key: str, elements: List[str], required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + def update_enum_column(self, database_id: str, table_id: str, key: str, elements: List[str], required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an enum column. Changing the `default` value will not update already existing rows. @@ -1056,9 +1057,9 @@ def update_enum_column(self, database_id: str, table_id: str, key: str, elements Updated list of enum values. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -1102,7 +1103,7 @@ def update_enum_column(self, database_id: str, table_id: str, key: str, elements 'content-type': 'application/json', }, api_params) - def create_float_column(self, database_id: str, table_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: + def create_float_column(self, database_id: str, table_id: str, key: str, required: bool, min: Optional[float] = None, max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create a float column. Optionally, minimum and maximum values can be provided. @@ -1117,13 +1118,13 @@ def create_float_column(self, database_id: str, table_id: str, key: str, require Column Key. required : bool Is column required? - min : float + min : Optional[float] Minimum value - max : float + max : Optional[float] Maximum value - default : float + default : Optional[float] Default value. Cannot be set when required. - array : bool + array : Optional[bool] Is column an array? Returns @@ -1165,7 +1166,7 @@ def create_float_column(self, database_id: str, table_id: str, key: str, require 'content-type': 'application/json', }, api_params) - def update_float_column(self, database_id: str, table_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: + def update_float_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[float], min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a float column. Changing the `default` value will not update already existing rows. @@ -1180,13 +1181,13 @@ def update_float_column(self, database_id: str, table_id: str, key: str, require Column Key. required : bool Is column required? - default : float + default : Optional[float] Default value. Cannot be set when required. - min : float + min : Optional[float] Minimum value - max : float + max : Optional[float] Maximum value - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -1228,7 +1229,7 @@ def update_float_column(self, database_id: str, table_id: str, key: str, require 'content-type': 'application/json', }, api_params) - def create_integer_column(self, database_id: str, table_id: str, key: str, required: bool, min: float = None, max: float = None, default: float = None, array: bool = None) -> Dict[str, Any]: + def create_integer_column(self, database_id: str, table_id: str, key: str, required: bool, min: Optional[float] = None, max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create an integer column. Optionally, minimum and maximum values can be provided. @@ -1243,13 +1244,13 @@ def create_integer_column(self, database_id: str, table_id: str, key: str, requi Column Key. required : bool Is column required? - min : float + min : Optional[float] Minimum value - max : float + max : Optional[float] Maximum value - default : float + default : Optional[float] Default value. Cannot be set when column is required. - array : bool + array : Optional[bool] Is column an array? Returns @@ -1291,7 +1292,7 @@ def create_integer_column(self, database_id: str, table_id: str, key: str, requi 'content-type': 'application/json', }, api_params) - def update_integer_column(self, database_id: str, table_id: str, key: str, required: bool, default: float, min: float = None, max: float = None, new_key: str = None) -> Dict[str, Any]: + def update_integer_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[float], min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an integer column. Changing the `default` value will not update already existing rows. @@ -1306,13 +1307,13 @@ def update_integer_column(self, database_id: str, table_id: str, key: str, requi Column Key. required : bool Is column required? - default : float + default : Optional[float] Default value. Cannot be set when column is required. - min : float + min : Optional[float] Minimum value - max : float + max : Optional[float] Maximum value - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -1354,7 +1355,7 @@ def update_integer_column(self, database_id: str, table_id: str, key: str, requi 'content-type': 'application/json', }, api_params) - def create_ip_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + def create_ip_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create IP address column. @@ -1369,9 +1370,9 @@ def create_ip_column(self, database_id: str, table_id: str, key: str, required: Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value. Cannot be set when column is required. - array : bool + array : Optional[bool] Is column an array? Returns @@ -1411,7 +1412,7 @@ def create_ip_column(self, database_id: str, table_id: str, key: str, required: 'content-type': 'application/json', }, api_params) - def update_ip_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + def update_ip_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an ip column. Changing the `default` value will not update already existing rows. @@ -1426,9 +1427,9 @@ def update_ip_column(self, database_id: str, table_id: str, key: str, required: Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -1468,7 +1469,7 @@ def update_ip_column(self, database_id: str, table_id: str, key: str, required: 'content-type': 'application/json', }, api_params) - def create_line_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]: + def create_line_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[List[Any]] = None) -> Dict[str, Any]: """ Create a geometric line column. @@ -1482,7 +1483,7 @@ def create_line_column(self, database_id: str, table_id: str, key: str, required Column Key. required : bool Is column required? - default : List[Any] + default : Optional[List[Any]] Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. Returns @@ -1521,7 +1522,7 @@ def create_line_column(self, database_id: str, table_id: str, key: str, required 'content-type': 'application/json', }, api_params) - def update_line_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]: + def update_line_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[List[Any]] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a line column. Changing the `default` value will not update already existing rows. @@ -1535,9 +1536,9 @@ def update_line_column(self, database_id: str, table_id: str, key: str, required Column Key. required : bool Is column required? - default : List[Any] + default : Optional[List[Any]] Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -1577,7 +1578,7 @@ def update_line_column(self, database_id: str, table_id: str, key: str, required 'content-type': 'application/json', }, api_params) - def create_point_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]: + def create_point_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[List[Any]] = None) -> Dict[str, Any]: """ Create a geometric point column. @@ -1591,7 +1592,7 @@ def create_point_column(self, database_id: str, table_id: str, key: str, require Column Key. required : bool Is column required? - default : List[Any] + default : Optional[List[Any]] Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. Returns @@ -1630,7 +1631,7 @@ def create_point_column(self, database_id: str, table_id: str, key: str, require 'content-type': 'application/json', }, api_params) - def update_point_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]: + def update_point_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[List[Any]] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a point column. Changing the `default` value will not update already existing rows. @@ -1644,9 +1645,9 @@ def update_point_column(self, database_id: str, table_id: str, key: str, require Column Key. required : bool Is column required? - default : List[Any] + default : Optional[List[Any]] Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -1686,7 +1687,7 @@ def update_point_column(self, database_id: str, table_id: str, key: str, require 'content-type': 'application/json', }, api_params) - def create_polygon_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]: + def create_polygon_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[List[Any]] = None) -> Dict[str, Any]: """ Create a geometric polygon column. @@ -1700,7 +1701,7 @@ def create_polygon_column(self, database_id: str, table_id: str, key: str, requi Column Key. required : bool Is column required? - default : List[Any] + default : Optional[List[Any]] Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. Returns @@ -1739,7 +1740,7 @@ def create_polygon_column(self, database_id: str, table_id: str, key: str, requi 'content-type': 'application/json', }, api_params) - def update_polygon_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]: + def update_polygon_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[List[Any]] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a polygon column. Changing the `default` value will not update already existing rows. @@ -1753,9 +1754,9 @@ def update_polygon_column(self, database_id: str, table_id: str, key: str, requi Column Key. required : bool Is column required? - default : List[Any] + default : Optional[List[Any]] Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -1795,7 +1796,7 @@ def update_polygon_column(self, database_id: str, table_id: str, key: str, requi 'content-type': 'application/json', }, api_params) - def create_relationship_column(self, database_id: str, table_id: str, related_table_id: str, type: RelationshipType, two_way: bool = None, key: str = None, two_way_key: str = None, on_delete: RelationMutate = None) -> Dict[str, Any]: + def create_relationship_column(self, database_id: str, table_id: str, related_table_id: str, type: RelationshipType, two_way: Optional[bool] = None, key: Optional[str] = None, two_way_key: Optional[str] = None, on_delete: Optional[RelationMutate] = None) -> Dict[str, Any]: """ Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). @@ -1810,13 +1811,13 @@ def create_relationship_column(self, database_id: str, table_id: str, related_ta Related Table ID. type : RelationshipType Relation type - two_way : bool + two_way : Optional[bool] Is Two Way? - key : str + key : Optional[str] Column Key. - two_way_key : str + two_way_key : Optional[str] Two Way Column Key. - on_delete : RelationMutate + on_delete : Optional[RelationMutate] Constraints option Returns @@ -1858,7 +1859,7 @@ def create_relationship_column(self, database_id: str, table_id: str, related_ta 'content-type': 'application/json', }, api_params) - def create_string_column(self, database_id: str, table_id: str, key: str, size: float, required: bool, default: str = None, array: bool = None, encrypt: bool = None) -> Dict[str, Any]: + def create_string_column(self, database_id: str, table_id: str, key: str, size: float, required: bool, default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None) -> Dict[str, Any]: """ Create a string column. @@ -1875,11 +1876,11 @@ def create_string_column(self, database_id: str, table_id: str, key: str, size: Column size for text columns, in number of characters. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - array : bool + array : Optional[bool] Is column an array? - encrypt : bool + encrypt : Optional[bool] Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. Returns @@ -1924,7 +1925,7 @@ def create_string_column(self, database_id: str, table_id: str, key: str, size: 'content-type': 'application/json', }, api_params) - def update_string_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, size: float = None, new_key: str = None) -> Dict[str, Any]: + def update_string_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str], size: Optional[float] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update a string column. Changing the `default` value will not update already existing rows. @@ -1939,11 +1940,11 @@ def update_string_column(self, database_id: str, table_id: str, key: str, requir Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - size : float + size : Optional[float] Maximum size of the string column. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -1984,7 +1985,7 @@ def update_string_column(self, database_id: str, table_id: str, key: str, requir 'content-type': 'application/json', }, api_params) - def create_url_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, array: bool = None) -> Dict[str, Any]: + def create_url_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str] = None, array: Optional[bool] = None) -> Dict[str, Any]: """ Create a URL column. @@ -1999,9 +2000,9 @@ def create_url_column(self, database_id: str, table_id: str, key: str, required: Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - array : bool + array : Optional[bool] Is column an array? Returns @@ -2041,7 +2042,7 @@ def create_url_column(self, database_id: str, table_id: str, key: str, required: 'content-type': 'application/json', }, api_params) - def update_url_column(self, database_id: str, table_id: str, key: str, required: bool, default: str, new_key: str = None) -> Dict[str, Any]: + def update_url_column(self, database_id: str, table_id: str, key: str, required: bool, default: Optional[str], new_key: Optional[str] = None) -> Dict[str, Any]: """ Update an url column. Changing the `default` value will not update already existing rows. @@ -2056,9 +2057,9 @@ def update_url_column(self, database_id: str, table_id: str, key: str, required: Column Key. required : bool Is column required? - default : str + default : Optional[str] Default value for column when not provided. Cannot be set when column is required. - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -2185,7 +2186,7 @@ def delete_column(self, database_id: str, table_id: str, key: str) -> Dict[str, 'content-type': 'application/json', }, api_params) - def update_relationship_column(self, database_id: str, table_id: str, key: str, on_delete: RelationMutate = None, new_key: str = None) -> Dict[str, Any]: + def update_relationship_column(self, database_id: str, table_id: str, key: str, on_delete: Optional[RelationMutate] = None, new_key: Optional[str] = None) -> Dict[str, Any]: """ Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). @@ -2198,9 +2199,9 @@ def update_relationship_column(self, database_id: str, table_id: str, key: str, Table ID. key : str Column Key. - on_delete : RelationMutate + on_delete : Optional[RelationMutate] Constraints option - new_key : str + new_key : Optional[str] New Column Key. Returns @@ -2236,7 +2237,7 @@ def update_relationship_column(self, database_id: str, table_id: str, key: str, 'content-type': 'application/json', }, api_params) - def list_indexes(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_indexes(self, database_id: str, table_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ List indexes on the table. @@ -2246,7 +2247,7 @@ def list_indexes(self, database_id: str, table_id: str, queries: List[str] = Non Database ID. table_id : str Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error Returns @@ -2276,7 +2277,7 @@ def list_indexes(self, database_id: str, table_id: str, queries: List[str] = Non return self.client.call('get', api_path, { }, api_params) - def create_index(self, database_id: str, table_id: str, key: str, type: IndexType, columns: List[str], orders: List[str] = None, lengths: List[float] = None) -> Dict[str, Any]: + def create_index(self, database_id: str, table_id: str, key: str, type: IndexType, columns: List[str], orders: Optional[List[str]] = None, lengths: Optional[List[float]] = None) -> Dict[str, Any]: """ Creates an index on the columns listed. Your index should include all the columns you will query in a single request. Type can be `key`, `fulltext`, or `unique`. @@ -2293,9 +2294,9 @@ def create_index(self, database_id: str, table_id: str, key: str, type: IndexTyp Index type. columns : List[str] Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. - orders : List[str] + orders : Optional[List[str]] Array of index orders. Maximum of 100 orders are allowed. - lengths : List[float] + lengths : Optional[List[float]] Length of index. Maximum of 100 Returns @@ -2426,7 +2427,7 @@ def delete_index(self, database_id: str, table_id: str, key: str) -> Dict[str, A 'content-type': 'application/json', }, api_params) - def list_rows(self, database_id: str, table_id: str, queries: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + def list_rows(self, database_id: str, table_id: str, queries: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the user's rows in a given table. You can use the query params to filter your results. @@ -2436,9 +2437,9 @@ def list_rows(self, database_id: str, table_id: str, queries: List[str] = None, Database ID. table_id : str Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - transaction_id : str + transaction_id : Optional[str] Transaction ID to read uncommitted changes within the transaction. Returns @@ -2469,7 +2470,7 @@ def list_rows(self, database_id: str, table_id: str, queries: List[str] = None, return self.client.call('get', api_path, { }, api_params) - def create_row(self, database_id: str, table_id: str, row_id: str, data: dict, permissions: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + def create_row(self, database_id: str, table_id: str, row_id: str, data: dict, permissions: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -2483,9 +2484,9 @@ def create_row(self, database_id: str, table_id: str, row_id: str, data: dict, p Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. data : dict Row data as JSON object. - permissions : List[str] + permissions : Optional[List[str]] An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2525,7 +2526,7 @@ def create_row(self, database_id: str, table_id: str, row_id: str, data: dict, p 'content-type': 'application/json', }, api_params) - def create_rows(self, database_id: str, table_id: str, rows: List[dict], transaction_id: str = None) -> Dict[str, Any]: + def create_rows(self, database_id: str, table_id: str, rows: List[dict], transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -2537,7 +2538,7 @@ def create_rows(self, database_id: str, table_id: str, rows: List[dict], transac Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows. rows : List[dict] Array of rows data as JSON objects. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2572,7 +2573,7 @@ def create_rows(self, database_id: str, table_id: str, rows: List[dict], transac 'content-type': 'application/json', }, api_params) - def upsert_rows(self, database_id: str, table_id: str, rows: List[dict], transaction_id: str = None) -> Dict[str, Any]: + def upsert_rows(self, database_id: str, table_id: str, rows: List[dict], transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -2585,7 +2586,7 @@ def upsert_rows(self, database_id: str, table_id: str, rows: List[dict], transac Table ID. rows : List[dict] Array of row data as JSON objects. May contain partial rows. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2620,7 +2621,7 @@ def upsert_rows(self, database_id: str, table_id: str, rows: List[dict], transac 'content-type': 'application/json', }, api_params) - def update_rows(self, database_id: str, table_id: str, data: dict = None, queries: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + def update_rows(self, database_id: str, table_id: str, data: Optional[dict] = None, queries: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated. @@ -2630,11 +2631,11 @@ def update_rows(self, database_id: str, table_id: str, data: dict = None, querie Database ID. table_id : str Table ID. - data : dict + data : Optional[dict] Row data as JSON object. Include only column and value pairs to be updated. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2667,7 +2668,7 @@ def update_rows(self, database_id: str, table_id: str, data: dict = None, querie 'content-type': 'application/json', }, api_params) - def delete_rows(self, database_id: str, table_id: str, queries: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + def delete_rows(self, database_id: str, table_id: str, queries: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Bulk delete rows using queries, if no queries are passed then all rows are deleted. @@ -2677,9 +2678,9 @@ def delete_rows(self, database_id: str, table_id: str, queries: List[str] = None Database ID. table_id : str Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2711,7 +2712,7 @@ def delete_rows(self, database_id: str, table_id: str, queries: List[str] = None 'content-type': 'application/json', }, api_params) - def get_row(self, database_id: str, table_id: str, row_id: str, queries: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + def get_row(self, database_id: str, table_id: str, row_id: str, queries: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Get a row by its unique ID. This endpoint response returns a JSON object with the row data. @@ -2723,9 +2724,9 @@ def get_row(self, database_id: str, table_id: str, row_id: str, queries: List[st Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). row_id : str Row ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - transaction_id : str + transaction_id : Optional[str] Transaction ID to read uncommitted changes within the transaction. Returns @@ -2760,7 +2761,7 @@ def get_row(self, database_id: str, table_id: str, row_id: str, queries: List[st return self.client.call('get', api_path, { }, api_params) - def upsert_row(self, database_id: str, table_id: str, row_id: str, data: dict = None, permissions: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + def upsert_row(self, database_id: str, table_id: str, row_id: str, data: Optional[dict] = None, permissions: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -2772,11 +2773,11 @@ def upsert_row(self, database_id: str, table_id: str, row_id: str, data: dict = Table ID. row_id : str Row ID. - data : dict + data : Optional[dict] Row data as JSON object. Include all required columns of the row to be created or updated. - permissions : List[str] + permissions : Optional[List[str]] An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2813,7 +2814,7 @@ def upsert_row(self, database_id: str, table_id: str, row_id: str, data: dict = 'content-type': 'application/json', }, api_params) - def update_row(self, database_id: str, table_id: str, row_id: str, data: dict = None, permissions: List[str] = None, transaction_id: str = None) -> Dict[str, Any]: + def update_row(self, database_id: str, table_id: str, row_id: str, data: Optional[dict] = None, permissions: Optional[List[str]] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated. @@ -2825,11 +2826,11 @@ def update_row(self, database_id: str, table_id: str, row_id: str, data: dict = Table ID. row_id : str Row ID. - data : dict + data : Optional[dict] Row data as JSON object. Include only columns and value pairs to be updated. - permissions : List[str] + permissions : Optional[List[str]] An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2866,7 +2867,7 @@ def update_row(self, database_id: str, table_id: str, row_id: str, data: dict = 'content-type': 'application/json', }, api_params) - def delete_row(self, database_id: str, table_id: str, row_id: str, transaction_id: str = None) -> Dict[str, Any]: + def delete_row(self, database_id: str, table_id: str, row_id: str, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Delete a row by its unique ID. @@ -2878,7 +2879,7 @@ def delete_row(self, database_id: str, table_id: str, row_id: str, transaction_i Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). row_id : str Row ID. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2913,7 +2914,7 @@ def delete_row(self, database_id: str, table_id: str, row_id: str, transaction_i 'content-type': 'application/json', }, api_params) - def decrement_row_column(self, database_id: str, table_id: str, row_id: str, column: str, value: float = None, min: float = None, transaction_id: str = None) -> Dict[str, Any]: + def decrement_row_column(self, database_id: str, table_id: str, row_id: str, column: str, value: Optional[float] = None, min: Optional[float] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Decrement a specific column of a row by a given value. @@ -2927,11 +2928,11 @@ def decrement_row_column(self, database_id: str, table_id: str, row_id: str, col Row ID. column : str Column key. - value : float + value : Optional[float] Value to increment the column by. The value must be a number. - min : float + min : Optional[float] Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns @@ -2972,7 +2973,7 @@ def decrement_row_column(self, database_id: str, table_id: str, row_id: str, col 'content-type': 'application/json', }, api_params) - def increment_row_column(self, database_id: str, table_id: str, row_id: str, column: str, value: float = None, max: float = None, transaction_id: str = None) -> Dict[str, Any]: + def increment_row_column(self, database_id: str, table_id: str, row_id: str, column: str, value: Optional[float] = None, max: Optional[float] = None, transaction_id: Optional[str] = None) -> Dict[str, Any]: """ Increment a specific column of a row by a given value. @@ -2986,11 +2987,11 @@ def increment_row_column(self, database_id: str, table_id: str, row_id: str, col Row ID. column : str Column key. - value : float + value : Optional[float] Value to increment the column by. The value must be a number. - max : float + max : Optional[float] Maximum value for the column. If the current value is greater than this value, an error will be thrown. - transaction_id : str + transaction_id : Optional[str] Transaction ID for staging the operation. Returns diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index 808dc2a..bad146b 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -1,21 +1,22 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated class Teams(Service): def __init__(self, client) -> None: super(Teams, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -38,7 +39,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, Any]: + def create(self, team_id: str, name: str, roles: Optional[List[str]] = None) -> Dict[str, Any]: """ Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. @@ -48,7 +49,7 @@ def create(self, team_id: str, name: str, roles: List[str] = None) -> Dict[str, Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. name : str Team name. Max length: 128 chars. - roles : List[str] + roles : Optional[List[str]] Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. Returns @@ -180,7 +181,7 @@ def delete(self, team_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_memberships(self, team_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_memberships(self, team_id: str, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. @@ -188,9 +189,9 @@ def list_memberships(self, team_id: str, queries: List[str] = None, search: str ---------- team_id : str Team ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -217,7 +218,7 @@ def list_memberships(self, team_id: str, queries: List[str] = None, search: str return self.client.call('get', api_path, { }, api_params) - def create_membership(self, team_id: str, roles: List[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None) -> Dict[str, Any]: + def create_membership(self, team_id: str, roles: List[str], email: Optional[str] = None, user_id: Optional[str] = None, phone: Optional[str] = None, url: Optional[str] = None, name: Optional[str] = None) -> Dict[str, Any]: """ Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. @@ -234,15 +235,15 @@ def create_membership(self, team_id: str, roles: List[str], email: str = None, u Team ID. roles : List[str] Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. - email : str + email : Optional[str] Email of the new team member. - user_id : str + user_id : Optional[str] ID of the user to be added to a team. - phone : str + phone : Optional[str] Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - url : str + url : Optional[str] URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. - name : str + name : Optional[str] Name of the new team member. Max length: 128 chars. Returns diff --git a/appwrite/services/tokens.py b/appwrite/services/tokens.py index 7ec7f4f..85700f0 100644 --- a/appwrite/services/tokens.py +++ b/appwrite/services/tokens.py @@ -1,13 +1,14 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated class Tokens(Service): def __init__(self, client) -> None: super(Tokens, self).__init__(client) - def list(self, bucket_id: str, file_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list(self, bucket_id: str, file_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ List all the tokens created for a specific file or bucket. You can use the query params to filter your results. @@ -17,7 +18,7 @@ def list(self, bucket_id: str, file_id: str, queries: List[str] = None) -> Dict[ Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). file_id : str File unique ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire Returns @@ -47,7 +48,7 @@ def list(self, bucket_id: str, file_id: str, queries: List[str] = None) -> Dict[ return self.client.call('get', api_path, { }, api_params) - def create_file_token(self, bucket_id: str, file_id: str, expire: str = None) -> Dict[str, Any]: + def create_file_token(self, bucket_id: str, file_id: str, expire: Optional[str] = None) -> Dict[str, Any]: """ Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. @@ -57,7 +58,7 @@ def create_file_token(self, bucket_id: str, file_id: str, expire: str = None) -> Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). file_id : str File unique ID. - expire : str + expire : Optional[str] Token expiry date Returns @@ -119,7 +120,7 @@ def get(self, token_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update(self, token_id: str, expire: str = None) -> Dict[str, Any]: + def update(self, token_id: str, expire: Optional[str] = None) -> Dict[str, Any]: """ Update a token by its unique ID. Use this endpoint to update a token's expiry date. @@ -127,7 +128,7 @@ def update(self, token_id: str, expire: str = None) -> Dict[str, Any]: ---------- token_id : str Token unique ID. - expire : str + expire : Optional[str] File token expiry date Returns diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 694657f..bb1b9fa 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -1,6 +1,7 @@ from ..service import Service -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional from ..exception import AppwriteException +from appwrite.utils.deprecated import deprecated from ..enums.password_hash import PasswordHash; from ..enums.authenticator_type import AuthenticatorType; from ..enums.messaging_provider_type import MessagingProviderType; @@ -10,15 +11,15 @@ class Users(Service): def __init__(self, client) -> None: super(Users, self).__init__(client) - def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get a list of all the project's users. You can use the query params to filter your results. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -41,7 +42,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def create(self, user_id: str, email: str = None, phone: str = None, password: str = None, name: str = None) -> Dict[str, Any]: + def create(self, user_id: str, email: Optional[str] = None, phone: Optional[str] = None, password: Optional[str] = None, name: Optional[str] = None) -> Dict[str, Any]: """ Create a new user. @@ -49,13 +50,13 @@ def create(self, user_id: str, email: str = None, phone: str = None, password: s ---------- user_id : str User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - email : str + email : Optional[str] User email. - phone : str + phone : Optional[str] Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - password : str + password : Optional[str] Plain text user password. Must be at least 8 chars. - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -85,7 +86,7 @@ def create(self, user_id: str, email: str = None, phone: str = None, password: s 'content-type': 'application/json', }, api_params) - def create_argon2_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + def create_argon2_user(self, user_id: str, email: str, password: str, name: Optional[str] = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. @@ -97,7 +98,7 @@ def create_argon2_user(self, user_id: str, email: str, password: str, name: str User email. password : str User password hashed using Argon2. - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -132,7 +133,7 @@ def create_argon2_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + def create_bcrypt_user(self, user_id: str, email: str, password: str, name: Optional[str] = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. @@ -144,7 +145,7 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str User email. password : str User password hashed using Bcrypt. - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -179,15 +180,15 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_identities(self, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get identities for all users. Parameters ---------- - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -242,7 +243,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def create_md5_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + def create_md5_user(self, user_id: str, email: str, password: str, name: Optional[str] = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. @@ -254,7 +255,7 @@ def create_md5_user(self, user_id: str, email: str, password: str, name: str = N User email. password : str User password hashed using MD5. - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -289,7 +290,7 @@ def create_md5_user(self, user_id: str, email: str, password: str, name: str = N 'content-type': 'application/json', }, api_params) - def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]: + def create_ph_pass_user(self, user_id: str, email: str, password: str, name: Optional[str] = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. @@ -301,7 +302,7 @@ def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str User email. password : str User password hashed using PHPass. - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -336,7 +337,7 @@ def create_ph_pass_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def create_scrypt_user(self, user_id: str, email: str, password: str, password_salt: str, password_cpu: float, password_memory: float, password_parallel: float, password_length: float, name: str = None) -> Dict[str, Any]: + def create_scrypt_user(self, user_id: str, email: str, password: str, password_salt: str, password_cpu: float, password_memory: float, password_parallel: float, password_length: float, name: Optional[str] = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. @@ -358,7 +359,7 @@ def create_scrypt_user(self, user_id: str, email: str, password: str, password_s Optional parallelization cost used to hash password. password_length : float Optional hash length used to hash password. - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -413,7 +414,7 @@ def create_scrypt_user(self, user_id: str, email: str, password: str, password_s 'content-type': 'application/json', }, api_params) - def create_scrypt_modified_user(self, user_id: str, email: str, password: str, password_salt: str, password_salt_separator: str, password_signer_key: str, name: str = None) -> Dict[str, Any]: + def create_scrypt_modified_user(self, user_id: str, email: str, password: str, password_salt: str, password_salt_separator: str, password_signer_key: str, name: Optional[str] = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. @@ -431,7 +432,7 @@ def create_scrypt_modified_user(self, user_id: str, email: str, password: str, p Salt separator used to hash password. password_signer_key : str Signer key used to hash password. - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -478,7 +479,7 @@ def create_scrypt_modified_user(self, user_id: str, email: str, password: str, p 'content-type': 'application/json', }, api_params) - def create_sha_user(self, user_id: str, email: str, password: str, password_version: PasswordHash = None, name: str = None) -> Dict[str, Any]: + def create_sha_user(self, user_id: str, email: str, password: str, password_version: Optional[PasswordHash] = None, name: Optional[str] = None) -> Dict[str, Any]: """ Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. @@ -490,9 +491,9 @@ def create_sha_user(self, user_id: str, email: str, password: str, password_vers User email. password : str User password hashed using SHA. - password_version : PasswordHash + password_version : Optional[PasswordHash] Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512' - name : str + name : Optional[str] User name. Max length: 128 chars. Returns @@ -629,7 +630,7 @@ def update_email(self, user_id: str, email: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def create_jwt(self, user_id: str, session_id: str = None, duration: float = None) -> Dict[str, Any]: + def create_jwt(self, user_id: str, session_id: Optional[str] = None, duration: Optional[float] = None) -> Dict[str, Any]: """ Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. @@ -637,9 +638,9 @@ def create_jwt(self, user_id: str, session_id: str = None, duration: float = Non ---------- user_id : str User ID. - session_id : str + session_id : Optional[str] Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. - duration : float + duration : Optional[float] Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. Returns @@ -707,7 +708,7 @@ def update_labels(self, user_id: str, labels: List[str]) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_logs(self, user_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ Get the user activity logs list by its unique ID. @@ -715,7 +716,7 @@ def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: ---------- user_id : str User ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset Returns @@ -741,7 +742,7 @@ def list_logs(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def list_memberships(self, user_id: str, queries: List[str] = None, search: str = None) -> Dict[str, Any]: + def list_memberships(self, user_id: str, queries: Optional[List[str]] = None, search: Optional[str] = None) -> Dict[str, Any]: """ Get the user membership list by its unique ID. @@ -749,9 +750,9 @@ def list_memberships(self, user_id: str, queries: List[str] = None, search: str ---------- user_id : str User ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles - search : str + search : Optional[str] Search term to filter your list results. Max length: 256 chars. Returns @@ -1336,7 +1337,7 @@ def update_status(self, user_id: str, status: bool) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any]: + def list_targets(self, user_id: str, queries: Optional[List[str]] = None) -> Dict[str, Any]: """ List the messaging targets that are associated with a user. @@ -1344,7 +1345,7 @@ def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any ---------- user_id : str User ID. - queries : List[str] + queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType Returns @@ -1370,7 +1371,7 @@ def list_targets(self, user_id: str, queries: List[str] = None) -> Dict[str, Any return self.client.call('get', api_path, { }, api_params) - def create_target(self, user_id: str, target_id: str, provider_type: MessagingProviderType, identifier: str, provider_id: str = None, name: str = None) -> Dict[str, Any]: + def create_target(self, user_id: str, target_id: str, provider_type: MessagingProviderType, identifier: str, provider_id: Optional[str] = None, name: Optional[str] = None) -> Dict[str, Any]: """ Create a messaging target. @@ -1384,9 +1385,9 @@ def create_target(self, user_id: str, target_id: str, provider_type: MessagingPr The target provider type. Can be one of the following: `email`, `sms` or `push`. identifier : str The target identifier (token, email, phone etc.) - provider_id : str + provider_id : Optional[str] Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. - name : str + name : Optional[str] Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23. Returns @@ -1463,7 +1464,7 @@ def get_target(self, user_id: str, target_id: str) -> Dict[str, Any]: return self.client.call('get', api_path, { }, api_params) - def update_target(self, user_id: str, target_id: str, identifier: str = None, provider_id: str = None, name: str = None) -> Dict[str, Any]: + def update_target(self, user_id: str, target_id: str, identifier: Optional[str] = None, provider_id: Optional[str] = None, name: Optional[str] = None) -> Dict[str, Any]: """ Update a messaging target. @@ -1473,11 +1474,11 @@ def update_target(self, user_id: str, target_id: str, identifier: str = None, pr User ID. target_id : str Target ID. - identifier : str + identifier : Optional[str] The target identifier (token, email, phone etc.) - provider_id : str + provider_id : Optional[str] Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. - name : str + name : Optional[str] Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23. Returns @@ -1548,7 +1549,7 @@ def delete_target(self, user_id: str, target_id: str) -> Dict[str, Any]: 'content-type': 'application/json', }, api_params) - def create_token(self, user_id: str, length: float = None, expire: float = None) -> Dict[str, Any]: + def create_token(self, user_id: str, length: Optional[float] = None, expire: Optional[float] = None) -> Dict[str, Any]: """ Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. @@ -1557,9 +1558,9 @@ def create_token(self, user_id: str, length: float = None, expire: float = None) ---------- user_id : str User ID. - length : float + length : Optional[float] Token length in characters. The default length is 6 characters - expire : float + expire : Optional[float] Token expiration period in seconds. The default expiration is 15 minutes. Returns diff --git a/appwrite/utils/__init__.py b/appwrite/utils/__init__.py new file mode 100644 index 0000000..5bc7dd0 --- /dev/null +++ b/appwrite/utils/__init__.py @@ -0,0 +1 @@ +# This file makes the 'utils' directory a Python package. diff --git a/appwrite/utils/deprecated.py b/appwrite/utils/deprecated.py new file mode 100644 index 0000000..0e0e6e6 --- /dev/null +++ b/appwrite/utils/deprecated.py @@ -0,0 +1,51 @@ +""" +A decorator to mark functions as deprecated. + +When the function is called, a DeprecationWarning is emitted. +Compatible with Python 2.7+ and Python 3.x. +""" + +import functools +import warnings + +def deprecated(reason=None): + """ + Decorator to mark functions as deprecated. + Emits a DeprecationWarning when the function is called. + + Args: + reason (str, optional): Reason for deprecation. Defaults to None. + + Usage: + @deprecated("Use another_function instead.") + def old_function(...): + ... + """ + def decorator(func): + message = "Call to deprecated function '{}'.{}".format( + func.__name__, + " " + reason if reason else "" + ) + + @functools.wraps(func) + def wrapped(*args, **kwargs): + warnings.simplefilter('always', DeprecationWarning) # show warning every time + try: + warnings.warn( + message, + category=DeprecationWarning, + stacklevel=2 + ) + return func(*args, **kwargs) + finally: + warnings.simplefilter('default', DeprecationWarning) # reset filter + return wrapped + + # Support both @deprecated and @deprecated("reason") + if callable(reason): + # Used as @deprecated without arguments + func = reason + reason = None + return decorator(func) + else: + return decorator diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 596d4a9..66dc667 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -12,7 +14,7 @@ result = databases.create_collection( database_id = '', collection_id = '', name = '', - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional document_security = False, # optional enabled = False # optional ) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index f42a3d8..bd1e1c9 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -19,6 +21,6 @@ result = databases.create_document( "age": 30, "isAdmin": False }, - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional transaction_id = '' # optional ) diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 2e5be50..5f357f5 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -12,7 +14,7 @@ result = databases.update_collection( database_id = '', collection_id = '', name = '', - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional document_security = False, # optional enabled = False # optional ) diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index c9ef02f..a396b9e 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,6 +15,6 @@ result = databases.update_document( collection_id = '', document_id = '', data = {}, # optional - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional transaction_id = '' # optional ) diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index e1a2f44..ac53ae1 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.databases import Databases +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,6 +15,6 @@ result = databases.upsert_document( collection_id = '', document_id = '', data = {}, - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional transaction_id = '' # optional ) diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md new file mode 100644 index 0000000..5789f6b --- /dev/null +++ b/docs/examples/messaging/create-resend-provider.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_key('') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_resend_provider( + provider_id = '', + name = '', + api_key = '', # optional + from_name = '', # optional + from_email = 'email@example.com', # optional + reply_to_name = '', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md new file mode 100644 index 0000000..a8ad859 --- /dev/null +++ b/docs/examples/messaging/update-resend-provider.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_key('') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_resend_provider( + provider_id = '', + name = '', # optional + enabled = False, # optional + api_key = '', # optional + from_name = '', # optional + from_email = 'email@example.com', # optional + reply_to_name = '', # optional + reply_to_email = '' # optional +) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 9672782..e08b2d0 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -11,7 +13,7 @@ storage = Storage(client) result = storage.create_bucket( bucket_id = '', name = '', - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional file_security = False, # optional enabled = False, # optional maximum_file_size = 1, # optional diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 6e57284..e37a592 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,6 +1,8 @@ from appwrite.client import Client from appwrite.services.storage import Storage from appwrite.input_file import InputFile +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,5 +15,5 @@ result = storage.create_file( bucket_id = '', file_id = '', file = InputFile.from_path('file.png'), - permissions = ["read("any")"] # optional + permissions = [Permission.read(Role.any())] # optional ) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index f2e741a..bfa7cc3 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -11,7 +13,7 @@ storage = Storage(client) result = storage.update_bucket( bucket_id = '', name = '', - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional file_security = False, # optional enabled = False, # optional maximum_file_size = 1, # optional diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index cf1e577..25acbef 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.storage import Storage +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -12,5 +14,5 @@ result = storage.update_file( bucket_id = '', file_id = '', name = '', # optional - permissions = ["read("any")"] # optional + permissions = [Permission.read(Role.any())] # optional ) diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index d2de586..d244802 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.tables_db import TablesDB +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -19,6 +21,6 @@ result = tables_db.create_row( "age": 30, "isAdmin": False }, - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional transaction_id = '' # optional ) diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index f258ed8..91a15df 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.tables_db import TablesDB +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -12,7 +14,7 @@ result = tables_db.create_table( database_id = '', table_id = '', name = '', - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional row_security = False, # optional enabled = False # optional ) diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 89dbfb0..3d34264 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.tables_db import TablesDB +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,6 +15,6 @@ result = tables_db.update_row( table_id = '', row_id = '', data = {}, # optional - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional transaction_id = '' # optional ) diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 7e494f0..c3e0115 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.tables_db import TablesDB +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -12,7 +14,7 @@ result = tables_db.update_table( database_id = '', table_id = '', name = '', - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional row_security = False, # optional enabled = False # optional ) diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 8539e12..a89d657 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -1,5 +1,7 @@ from appwrite.client import Client from appwrite.services.tables_db import TablesDB +from appwrite.permission import Permission +from appwrite.role import Role client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,6 +15,6 @@ result = tables_db.upsert_row( table_id = '', row_id = '', data = {}, # optional - permissions = ["read("any")"], # optional + permissions = [Permission.read(Role.any())], # optional transaction_id = '' # optional ) diff --git a/setup.py b/setup.py index 93253a3..914013e 100644 --- a/setup.py +++ b/setup.py @@ -4,16 +4,11 @@ with open("README.md", "r", encoding="utf-8") as readme_file_desc: long_description = readme_file_desc.read() - + setuptools.setup( name = 'appwrite', - packages = [ - 'appwrite', - 'appwrite/services', - 'appwrite/encoders', - 'appwrite/enums', - ], - version = '13.4.1', + packages = setuptools.find_packages(), + version = '13.4.2', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +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/13.4.1.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/13.4.2.tar.gz', install_requires=[ 'requests', ], From 55b463c3e191bbcb2e042ddfd168710cbfb50baa Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Oct 2025 04:00:45 +0000 Subject: [PATCH 2/2] regen --- CHANGELOG.md | 4 +++- appwrite/client.py | 4 ++-- setup.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90dcfc2..cb7f47d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ # Change Log -## 13.4.2 +## 13.5.0 +* Add `create_resend_provider` and `update_resend_provider` methods to `Messaging` service +* Improve deprecation warnings * Fix adding `Optional[]` to optional parameters * Fix passing of `None` to nullable parameters diff --git a/appwrite/client.py b/appwrite/client.py index a4b5661..b25cfa2 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -15,11 +15,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/13.4.2 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/13.5.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '13.4.2', + 'x-sdk-version': '13.5.0', 'X-Appwrite-Response-Format' : '1.8.0', } diff --git a/setup.py b/setup.py index 914013e..dd814cd 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = setuptools.find_packages(), - version = '13.4.2', + version = '13.5.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/13.4.2.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/13.5.0.tar.gz', install_requires=[ 'requests', ],