diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e8eca7b..d84d143 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.9' - name: Build package run: | diff --git a/appwrite/client.py b/appwrite/client.py index 4e04484..bc6853d 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/9.0.0 ({os.uname().sysname}; {os.uname().version}; {os.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/9.0.1 ({os.uname().sysname}; {os.uname().version}; {os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '9.0.0', + 'x-sdk-version': '9.0.1', 'X-Appwrite-Response-Format' : '1.6.0', } diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 7c248f3..8344161 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.authenticator_type import AuthenticatorType; from ..enums.authentication_factor import AuthenticationFactor; @@ -62,7 +63,7 @@ def update_email(self, email: str, password: str): 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: list[str] = None): + def list_identities(self, queries: List[str] = None): """List identities""" api_path = '/account/identities' @@ -99,7 +100,7 @@ def create_jwt(self): 'content-type': 'application/json', }, api_params) - def list_logs(self, queries: list[str] = None): + def list_logs(self, queries: List[str] = None): """List logs""" api_path = '/account/logs' @@ -568,7 +569,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra 'content-type': 'application/json', }, api_params) - def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: list[str] = None): + def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: List[str] = None): """Create OAuth2 token""" api_path = '/account/tokens/oauth2/{provider}' diff --git a/appwrite/services/avatars.py b/appwrite/services/avatars.py index 40a0abb..4220f35 100644 --- a/appwrite/services/avatars.py +++ b/appwrite/services/avatars.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.browser import Browser; from ..enums.credit_card import CreditCard; diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index e1c63b2..08e8edf 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.relationship_type import RelationshipType; from ..enums.relation_mutate import RelationMutate; @@ -9,7 +10,7 @@ class Databases(Service): def __init__(self, client): super(Databases, self).__init__(client) - def list(self, queries: list[str] = None, search: str = None): + def list(self, queries: List[str] = None, search: str = None): """List databases""" api_path = '/databases' @@ -92,7 +93,7 @@ def delete(self, database_id: str): 'content-type': 'application/json', }, api_params) - def list_collections(self, database_id: str, queries: list[str] = None, search: str = None): + def list_collections(self, database_id: str, queries: List[str] = None, search: str = None): """List collections""" api_path = '/databases/{databaseId}/collections' @@ -109,7 +110,7 @@ def list_collections(self, database_id: str, queries: list[str] = None, search: 'content-type': 'application/json', }, api_params) - def create_collection(self, database_id: str, collection_id: str, name: str, permissions: list[str] = None, document_security: bool = None, enabled: bool = None): + def create_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None): """Create collection""" api_path = '/databases/{databaseId}/collections' @@ -154,7 +155,7 @@ def get_collection(self, database_id: str, collection_id: str): 'content-type': 'application/json', }, api_params) - def update_collection(self, database_id: str, collection_id: str, name: str, permissions: list[str] = None, document_security: bool = None, enabled: bool = None): + def update_collection(self, database_id: str, collection_id: str, name: str, permissions: List[str] = None, document_security: bool = None, enabled: bool = None): """Update collection""" api_path = '/databases/{databaseId}/collections/{collectionId}' @@ -199,7 +200,7 @@ def delete_collection(self, database_id: str, collection_id: str): 'content-type': 'application/json', }, api_params) - def list_attributes(self, database_id: str, collection_id: str, queries: list[str] = None): + def list_attributes(self, database_id: str, collection_id: str, queries: List[str] = None): """List attributes""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' @@ -393,7 +394,7 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list[str], required: bool, default: str = None, array: bool = None): + def create_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str = None, array: bool = None): """Create enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' @@ -426,7 +427,7 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str, 'content-type': 'application/json', }, api_params) - def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: list[str], required: bool, default: str, new_key: str = None): + def update_enum_attribute(self, database_id: str, collection_id: str, key: str, elements: List[str], required: bool, default: str, new_key: str = None): """Update enum attribute""" api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}' @@ -865,7 +866,7 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke 'content-type': 'application/json', }, api_params) - def list_documents(self, database_id: str, collection_id: str, queries: list[str] = None): + def list_documents(self, database_id: str, collection_id: str, queries: List[str] = None): """List documents""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' @@ -885,7 +886,7 @@ def list_documents(self, database_id: str, collection_id: str, queries: list[str 'content-type': 'application/json', }, api_params) - def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: list[str] = None): + def create_document(self, database_id: str, collection_id: str, document_id: str, data: dict, permissions: List[str] = None): """Create document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents' @@ -913,7 +914,7 @@ def create_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def get_document(self, database_id: str, collection_id: str, document_id: str, queries: list[str] = None): + def get_document(self, database_id: str, collection_id: str, document_id: str, queries: List[str] = None): """Get document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' @@ -937,7 +938,7 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q 'content-type': 'application/json', }, api_params) - def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: list[str] = None): + def update_document(self, database_id: str, collection_id: str, document_id: str, data: dict = None, permissions: List[str] = None): """Update document""" api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' @@ -985,7 +986,7 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str 'content-type': 'application/json', }, api_params) - def list_indexes(self, database_id: str, collection_id: str, queries: list[str] = None): + def list_indexes(self, database_id: str, collection_id: str, queries: List[str] = None): """List indexes""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' @@ -1005,7 +1006,7 @@ def list_indexes(self, database_id: str, collection_id: str, queries: list[str] 'content-type': 'application/json', }, api_params) - def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: list[str], orders: list[str] = None): + def create_index(self, database_id: str, collection_id: str, key: str, type: IndexType, attributes: List[str], orders: List[str] = None): """Create index""" api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 6eb8bad..0c990bd 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.runtime import Runtime; from ..input_file import InputFile @@ -9,7 +10,7 @@ class Functions(Service): def __init__(self, client): super(Functions, self).__init__(client) - def list(self, queries: list[str] = None, search: str = None): + def list(self, queries: List[str] = None, search: str = None): """List functions""" api_path = '/functions' @@ -22,7 +23,7 @@ def list(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, function_id: str, name: str, runtime: Runtime, execute: list[str] = None, events: list[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None): + def create(self, function_id: str, name: str, runtime: Runtime, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, template_repository: str = None, template_owner: str = None, template_root_directory: str = None, template_version: str = None, specification: str = None): """Create function""" api_path = '/functions' @@ -99,7 +100,7 @@ def get(self, function_id: str): 'content-type': 'application/json', }, api_params) - def update(self, function_id: str, name: str, runtime: Runtime = None, execute: list[str] = None, events: list[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: list[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None): + def update(self, function_id: str, name: str, runtime: Runtime = None, execute: List[str] = None, events: List[str] = None, schedule: str = None, timeout: float = None, enabled: bool = None, logging: bool = None, entrypoint: str = None, commands: str = None, scopes: List[str] = None, installation_id: str = None, provider_repository_id: str = None, provider_branch: str = None, provider_silent_mode: bool = None, provider_root_directory: str = None, specification: str = None): """Update function""" api_path = '/functions/{functionId}' @@ -149,7 +150,7 @@ def delete(self, function_id: str): 'content-type': 'application/json', }, api_params) - def list_deployments(self, function_id: str, queries: list[str] = None, search: str = None): + def list_deployments(self, function_id: str, queries: List[str] = None, search: str = None): """List deployments""" api_path = '/functions/{functionId}/deployments' @@ -311,7 +312,7 @@ def get_deployment_download(self, function_id: str, deployment_id: str): 'content-type': 'application/json', }, api_params) - def list_executions(self, function_id: str, queries: list[str] = None, search: str = None): + def list_executions(self, function_id: str, queries: List[str] = None, search: str = None): """List executions""" api_path = '/functions/{functionId}/executions' diff --git a/appwrite/services/graphql.py b/appwrite/services/graphql.py index 41421bb..4a0fd36 100644 --- a/appwrite/services/graphql.py +++ b/appwrite/services/graphql.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException class Graphql(Service): diff --git a/appwrite/services/health.py b/appwrite/services/health.py index d87dc57..014b536 100644 --- a/appwrite/services/health.py +++ b/appwrite/services/health.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.name import Name; diff --git a/appwrite/services/locale.py b/appwrite/services/locale.py index 6a8f007..6c14eaf 100644 --- a/appwrite/services/locale.py +++ b/appwrite/services/locale.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException class Locale(Service): diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index f344b9f..9b41d18 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.message_priority import MessagePriority; from ..enums.smtp_encryption import SmtpEncryption; @@ -8,7 +9,7 @@ class Messaging(Service): def __init__(self, client): super(Messaging, self).__init__(client) - def list_messages(self, queries: list[str] = None, search: str = None): + def list_messages(self, queries: List[str] = None, search: str = None): """List messages""" api_path = '/messaging/messages' @@ -21,7 +22,7 @@ def list_messages(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_email(self, message_id: str, subject: str, content: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, cc: list[str] = None, bcc: list[str] = None, attachments: list[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None): + def create_email(self, message_id: str, subject: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, cc: List[str] = None, bcc: List[str] = None, attachments: List[str] = None, draft: bool = None, html: bool = None, scheduled_at: str = None): """Create email""" api_path = '/messaging/messages/email' @@ -53,7 +54,7 @@ def create_email(self, message_id: str, subject: str, content: str, topics: list 'content-type': 'application/json', }, api_params) - def update_email(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: list[str] = None, bcc: list[str] = None, scheduled_at: str = None, attachments: list[str] = None): + def update_email(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, subject: str = None, content: str = None, draft: bool = None, html: bool = None, cc: List[str] = None, bcc: List[str] = None, scheduled_at: str = None, attachments: List[str] = None): """Update email""" api_path = '/messaging/messages/email/{messageId}' @@ -79,7 +80,7 @@ def update_email(self, message_id: str, topics: list[str] = None, users: list[st 'content-type': 'application/json', }, api_params) - def create_push(self, message_id: str, title: str = None, body: str = None, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): + def create_push(self, message_id: str, title: str = None, body: str = None, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): """Create push notification""" api_path = '/messaging/messages/push' @@ -112,7 +113,7 @@ def create_push(self, message_id: str, title: str = None, body: str = None, topi 'content-type': 'application/json', }, api_params) - def update_push(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): + def update_push(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, title: str = None, body: str = None, data: dict = None, action: str = None, image: str = None, icon: str = None, sound: str = None, color: str = None, tag: str = None, badge: float = None, draft: bool = None, scheduled_at: str = None, content_available: bool = None, critical: bool = None, priority: MessagePriority = None): """Update push notification""" api_path = '/messaging/messages/push/{messageId}' @@ -145,7 +146,7 @@ def update_push(self, message_id: str, topics: list[str] = None, users: list[str 'content-type': 'application/json', }, api_params) - def create_sms(self, message_id: str, content: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, draft: bool = None, scheduled_at: str = None): + def create_sms(self, message_id: str, content: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, draft: bool = None, scheduled_at: str = None): """Create SMS""" api_path = '/messaging/messages/sms' @@ -169,7 +170,7 @@ def create_sms(self, message_id: str, content: str, topics: list[str] = None, us 'content-type': 'application/json', }, api_params) - def update_sms(self, message_id: str, topics: list[str] = None, users: list[str] = None, targets: list[str] = None, content: str = None, draft: bool = None, scheduled_at: str = None): + def update_sms(self, message_id: str, topics: List[str] = None, users: List[str] = None, targets: List[str] = None, content: str = None, draft: bool = None, scheduled_at: str = None): """Update SMS""" api_path = '/messaging/messages/sms/{messageId}' @@ -220,7 +221,7 @@ def delete(self, message_id: str): 'content-type': 'application/json', }, api_params) - def list_message_logs(self, message_id: str, queries: list[str] = None): + def list_message_logs(self, message_id: str, queries: List[str] = None): """List message logs""" api_path = '/messaging/messages/{messageId}/logs' @@ -236,7 +237,7 @@ def list_message_logs(self, message_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_targets(self, message_id: str, queries: list[str] = None): + def list_targets(self, message_id: str, queries: List[str] = None): """List message targets""" api_path = '/messaging/messages/{messageId}/targets' @@ -252,7 +253,7 @@ def list_targets(self, message_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_providers(self, queries: list[str] = None, search: str = None): + def list_providers(self, queries: List[str] = None, search: str = None): """List providers""" api_path = '/messaging/providers' @@ -756,7 +757,7 @@ def delete_provider(self, provider_id: str): 'content-type': 'application/json', }, api_params) - def list_provider_logs(self, provider_id: str, queries: list[str] = None): + def list_provider_logs(self, provider_id: str, queries: List[str] = None): """List provider logs""" api_path = '/messaging/providers/{providerId}/logs' @@ -772,7 +773,7 @@ def list_provider_logs(self, provider_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_subscriber_logs(self, subscriber_id: str, queries: list[str] = None): + def list_subscriber_logs(self, subscriber_id: str, queries: List[str] = None): """List subscriber logs""" api_path = '/messaging/subscribers/{subscriberId}/logs' @@ -788,7 +789,7 @@ def list_subscriber_logs(self, subscriber_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_topics(self, queries: list[str] = None, search: str = None): + def list_topics(self, queries: List[str] = None, search: str = None): """List topics""" api_path = '/messaging/topics' @@ -801,7 +802,7 @@ def list_topics(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_topic(self, topic_id: str, name: str, subscribe: list[str] = None): + def create_topic(self, topic_id: str, name: str, subscribe: List[str] = None): """Create topic""" api_path = '/messaging/topics' @@ -836,7 +837,7 @@ def get_topic(self, topic_id: str): 'content-type': 'application/json', }, api_params) - def update_topic(self, topic_id: str, name: str = None, subscribe: list[str] = None): + def update_topic(self, topic_id: str, name: str = None, subscribe: List[str] = None): """Update topic""" api_path = '/messaging/topics/{topicId}' @@ -868,7 +869,7 @@ def delete_topic(self, topic_id: str): 'content-type': 'application/json', }, api_params) - def list_topic_logs(self, topic_id: str, queries: list[str] = None): + def list_topic_logs(self, topic_id: str, queries: List[str] = None): """List topic logs""" api_path = '/messaging/topics/{topicId}/logs' @@ -884,7 +885,7 @@ def list_topic_logs(self, topic_id: str, queries: list[str] = None): 'content-type': 'application/json', }, api_params) - def list_subscribers(self, topic_id: str, queries: list[str] = None, search: str = None): + def list_subscribers(self, topic_id: str, queries: List[str] = None, search: str = None): """List subscribers""" api_path = '/messaging/topics/{topicId}/subscribers' diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index dc30df5..ac73261 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.compression import Compression; from ..input_file import InputFile @@ -10,7 +11,7 @@ class Storage(Service): def __init__(self, client): super(Storage, self).__init__(client) - def list_buckets(self, queries: list[str] = None, search: str = None): + def list_buckets(self, queries: List[str] = None, search: str = None): """List buckets""" api_path = '/storage/buckets' @@ -23,7 +24,7 @@ def list_buckets(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create_bucket(self, bucket_id: str, name: str, permissions: list[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): + def create_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): """Create bucket""" api_path = '/storage/buckets' @@ -65,7 +66,7 @@ def get_bucket(self, bucket_id: str): 'content-type': 'application/json', }, api_params) - def update_bucket(self, bucket_id: str, name: str, permissions: list[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: list[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): + def update_bucket(self, bucket_id: str, name: str, permissions: List[str] = None, file_security: bool = None, enabled: bool = None, maximum_file_size: float = None, allowed_file_extensions: List[str] = None, compression: Compression = None, encryption: bool = None, antivirus: bool = None): """Update bucket""" api_path = '/storage/buckets/{bucketId}' @@ -107,7 +108,7 @@ def delete_bucket(self, bucket_id: str): 'content-type': 'application/json', }, api_params) - def list_files(self, bucket_id: str, queries: list[str] = None, search: str = None): + def list_files(self, bucket_id: str, queries: List[str] = None, search: str = None): """List files""" api_path = '/storage/buckets/{bucketId}/files' @@ -124,7 +125,7 @@ def list_files(self, bucket_id: str, queries: list[str] = None, search: str = No 'content-type': 'application/json', }, api_params) - def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: list[str] = None, on_progress = None): + def create_file(self, bucket_id: str, file_id: str, file: InputFile, permissions: List[str] = None, on_progress = None): """Create file""" api_path = '/storage/buckets/{bucketId}/files' @@ -173,7 +174,7 @@ def get_file(self, bucket_id: str, file_id: str): 'content-type': 'application/json', }, api_params) - def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: list[str] = None): + def update_file(self, bucket_id: str, file_id: str, name: str = None, permissions: List[str] = None): """Update file""" api_path = '/storage/buckets/{bucketId}/files/{fileId}' diff --git a/appwrite/services/teams.py b/appwrite/services/teams.py index f157768..fd28540 100644 --- a/appwrite/services/teams.py +++ b/appwrite/services/teams.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException class Teams(Service): @@ -6,7 +7,7 @@ class Teams(Service): def __init__(self, client): super(Teams, self).__init__(client) - def list(self, queries: list[str] = None, search: str = None): + def list(self, queries: List[str] = None, search: str = None): """List teams""" api_path = '/teams' @@ -19,7 +20,7 @@ def list(self, queries: list[str] = None, search: str = None): 'content-type': 'application/json', }, api_params) - def create(self, team_id: str, name: str, roles: list[str] = None): + def create(self, team_id: str, name: str, roles: List[str] = None): """Create team""" api_path = '/teams' @@ -88,7 +89,7 @@ def delete(self, team_id: str): 'content-type': 'application/json', }, api_params) - def list_memberships(self, team_id: str, queries: list[str] = None, search: str = None): + def list_memberships(self, team_id: str, queries: List[str] = None, search: str = None): """List team memberships""" api_path = '/teams/{teamId}/memberships' @@ -105,7 +106,7 @@ def list_memberships(self, team_id: str, queries: list[str] = None, search: str 'content-type': 'application/json', }, api_params) - def create_membership(self, team_id: str, roles: list[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None): + def create_membership(self, team_id: str, roles: List[str], email: str = None, user_id: str = None, phone: str = None, url: str = None, name: str = None): """Create team membership""" api_path = '/teams/{teamId}/memberships' @@ -148,7 +149,7 @@ def get_membership(self, team_id: str, membership_id: str): 'content-type': 'application/json', }, api_params) - def update_membership(self, team_id: str, membership_id: str, roles: list[str]): + def update_membership(self, team_id: str, membership_id: str, roles: List[str]): """Update membership""" api_path = '/teams/{teamId}/memberships/{membershipId}' diff --git a/appwrite/services/users.py b/appwrite/services/users.py index 6ed17ee..09155c3 100644 --- a/appwrite/services/users.py +++ b/appwrite/services/users.py @@ -1,4 +1,5 @@ from ..service import Service +from typing import List from ..exception import AppwriteException from ..enums.password_hash import PasswordHash; from ..enums.authenticator_type import AuthenticatorType; @@ -9,7 +10,7 @@ class Users(Service): def __init__(self, client): super(Users, self).__init__(client) - def list(self, queries: list[str] = None, search: str = None): + def list(self, queries: List[str] = None, search: str = None): """List users""" api_path = '/users' @@ -89,7 +90,7 @@ def create_bcrypt_user(self, user_id: str, email: str, password: str, name: str 'content-type': 'application/json', }, api_params) - def list_identities(self, queries: list[str] = None, search: str = None): + def list_identities(self, queries: List[str] = None, search: str = None): """List identities""" api_path = '/users/identities' @@ -336,7 +337,7 @@ def create_jwt(self, user_id: str, session_id: str = None, duration: float = Non 'content-type': 'application/json', }, api_params) - def update_labels(self, user_id: str, labels: list[str]): + def update_labels(self, user_id: str, labels: List[str]): """Update user labels""" api_path = '/users/{userId}/labels' @@ -355,7 +356,7 @@ def update_labels(self, user_id: str, labels: list[str]): 'content-type': 'application/json', }, api_params) - def list_logs(self, user_id: str, queries: list[str] = None): + def list_logs(self, user_id: str, queries: List[str] = None): """List user logs""" api_path = '/users/{userId}/logs' @@ -658,7 +659,7 @@ def update_status(self, user_id: str, status: bool): 'content-type': 'application/json', }, api_params) - def list_targets(self, user_id: str, queries: list[str] = None): + def list_targets(self, user_id: str, queries: List[str] = None): """List user targets""" api_path = '/users/{userId}/targets' diff --git a/setup.py b/setup.py index 40bc73f..5598001 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '9.0.0', + version = '9.0.1', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/9.0.1.tar.gz', install_requires=[ 'requests', ],