diff --git a/CHANGELOG.md b/CHANGELOG.md index 06eb25e3..8f0982d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## 26.0.0 + +* Breaking: `tables_db`, `documents_db` and `vectors_db` `create` and `update` take `description` before `specification` +* Breaking: `functions.update` takes `description` before `email_enabled` +* Added: `create_query` on `databases`, `documents_db` and `tables_db` to send list queries in the request body +* Added: `account.list_memberships` +* Added: optional `description` on create and update for databases, collections, tables, attributes, columns, indexes, buckets, functions, sites, variables, topics, webhooks and keys +* Added: `description` on the matching models +* Added: `total` on list methods in `activities`, `backups`, `domains`, `mongo`, `mysql` and `postgresql` +* Added: `emails` on `messaging.create_email` and `messaging.update_email` +* Added: `deny_list` on `project.update_password_dictionary_policy`, `update_password_personal_data_policy` and their policy models +* Added: `BillingPlan.functions_allow_cron` +* Added: `strip_metadata` on `storage.create_bucket`, `update_bucket` and the `Bucket` model +* Updated: package classifiers list Python 3.13 + ## 25.0.0 * Breaking: requests send `X-Appwrite-Response-Format: 2.5.0`; responses follow the 2.5 shapes diff --git a/appwrite/client.py b/appwrite/client.py index 49c7d754..4b4a5a0f 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -19,11 +19,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent': f'AppwritePythonSDK/25.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent': f'AppwritePythonSDK/26.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '25.0.0', + 'x-sdk-version': '26.0.0', 'X-Appwrite-Response-Format': '2.5.0', } self._config = {} diff --git a/appwrite/models/attribute_bigint.py b/appwrite/models/attribute_bigint.py index 474812db..53639d02 100644 --- a/appwrite/models/attribute_bigint.py +++ b/appwrite/models/attribute_bigint.py @@ -13,6 +13,8 @@ class AttributeBigint(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -36,6 +38,7 @@ class AttributeBigint(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_boolean.py b/appwrite/models/attribute_boolean.py index 7ce326cb..91397ef4 100644 --- a/appwrite/models/attribute_boolean.py +++ b/appwrite/models/attribute_boolean.py @@ -13,6 +13,8 @@ class AttributeBoolean(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -32,6 +34,7 @@ class AttributeBoolean(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_datetime.py b/appwrite/models/attribute_datetime.py index cad6726b..fae2b1e6 100644 --- a/appwrite/models/attribute_datetime.py +++ b/appwrite/models/attribute_datetime.py @@ -13,6 +13,8 @@ class AttributeDatetime(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -34,6 +36,7 @@ class AttributeDatetime(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_email.py b/appwrite/models/attribute_email.py index 4e3c33f6..2e8badcc 100644 --- a/appwrite/models/attribute_email.py +++ b/appwrite/models/attribute_email.py @@ -13,6 +13,8 @@ class AttributeEmail(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -34,6 +36,7 @@ class AttributeEmail(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_enum.py b/appwrite/models/attribute_enum.py index fdf787fc..89d9db9d 100644 --- a/appwrite/models/attribute_enum.py +++ b/appwrite/models/attribute_enum.py @@ -13,6 +13,8 @@ class AttributeEnum(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -36,6 +38,7 @@ class AttributeEnum(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_float.py b/appwrite/models/attribute_float.py index 209b42e8..8392f53a 100644 --- a/appwrite/models/attribute_float.py +++ b/appwrite/models/attribute_float.py @@ -13,6 +13,8 @@ class AttributeFloat(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -36,6 +38,7 @@ class AttributeFloat(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_integer.py b/appwrite/models/attribute_integer.py index f268bb23..609eddac 100644 --- a/appwrite/models/attribute_integer.py +++ b/appwrite/models/attribute_integer.py @@ -13,6 +13,8 @@ class AttributeInteger(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -36,6 +38,7 @@ class AttributeInteger(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_ip.py b/appwrite/models/attribute_ip.py index 9b334968..50f5a8db 100644 --- a/appwrite/models/attribute_ip.py +++ b/appwrite/models/attribute_ip.py @@ -13,6 +13,8 @@ class AttributeIp(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -34,6 +36,7 @@ class AttributeIp(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_line.py b/appwrite/models/attribute_line.py index 4fbcba35..28a5e393 100644 --- a/appwrite/models/attribute_line.py +++ b/appwrite/models/attribute_line.py @@ -13,6 +13,8 @@ class AttributeLine(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -32,6 +34,7 @@ class AttributeLine(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_longtext.py b/appwrite/models/attribute_longtext.py index fa45bfc5..fe3a0bcb 100644 --- a/appwrite/models/attribute_longtext.py +++ b/appwrite/models/attribute_longtext.py @@ -13,6 +13,8 @@ class AttributeLongtext(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -34,6 +36,7 @@ class AttributeLongtext(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_mediumtext.py b/appwrite/models/attribute_mediumtext.py index 59c8ee3f..bfacf192 100644 --- a/appwrite/models/attribute_mediumtext.py +++ b/appwrite/models/attribute_mediumtext.py @@ -13,6 +13,8 @@ class AttributeMediumtext(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -34,6 +36,7 @@ class AttributeMediumtext(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_object.py b/appwrite/models/attribute_object.py index 16e736dd..9cfcb9e4 100644 --- a/appwrite/models/attribute_object.py +++ b/appwrite/models/attribute_object.py @@ -13,6 +13,8 @@ class AttributeObject(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -30,6 +32,7 @@ class AttributeObject(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -47,6 +50,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_point.py b/appwrite/models/attribute_point.py index 15c1d931..f93cb980 100644 --- a/appwrite/models/attribute_point.py +++ b/appwrite/models/attribute_point.py @@ -13,6 +13,8 @@ class AttributePoint(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -32,6 +34,7 @@ class AttributePoint(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_polygon.py b/appwrite/models/attribute_polygon.py index 7d669d70..f7d1c64c 100644 --- a/appwrite/models/attribute_polygon.py +++ b/appwrite/models/attribute_polygon.py @@ -13,6 +13,8 @@ class AttributePolygon(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -32,6 +34,7 @@ class AttributePolygon(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_relationship.py b/appwrite/models/attribute_relationship.py index fc549373..de63c8d3 100644 --- a/appwrite/models/attribute_relationship.py +++ b/appwrite/models/attribute_relationship.py @@ -13,6 +13,8 @@ class AttributeRelationship(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -42,6 +44,7 @@ class AttributeRelationship(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -65,6 +68,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_string.py b/appwrite/models/attribute_string.py index 7cca07a0..4790f71b 100644 --- a/appwrite/models/attribute_string.py +++ b/appwrite/models/attribute_string.py @@ -13,6 +13,8 @@ class AttributeString(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -36,6 +38,7 @@ class AttributeString(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_text.py b/appwrite/models/attribute_text.py index b66f2a50..4fe71e87 100644 --- a/appwrite/models/attribute_text.py +++ b/appwrite/models/attribute_text.py @@ -13,6 +13,8 @@ class AttributeText(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -34,6 +36,7 @@ class AttributeText(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_url.py b/appwrite/models/attribute_url.py index 50ad0ffe..ff34a0f7 100644 --- a/appwrite/models/attribute_url.py +++ b/appwrite/models/attribute_url.py @@ -13,6 +13,8 @@ class AttributeUrl(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -34,6 +36,7 @@ class AttributeUrl(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_varchar.py b/appwrite/models/attribute_varchar.py index 65b806c2..b87ef6b0 100644 --- a/appwrite/models/attribute_varchar.py +++ b/appwrite/models/attribute_varchar.py @@ -13,6 +13,8 @@ class AttributeVarchar(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -36,6 +38,7 @@ class AttributeVarchar(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/attribute_vector.py b/appwrite/models/attribute_vector.py index 1b1d921d..33344e95 100644 --- a/appwrite/models/attribute_vector.py +++ b/appwrite/models/attribute_vector.py @@ -13,6 +13,8 @@ class AttributeVector(AppwriteModel): ---------- key : str Attribute Key. + description : str + Optional description for the attribute. type : str Attribute type. status : AttributeStatus @@ -32,6 +34,7 @@ class AttributeVector(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: AttributeStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/billing_plan.py b/appwrite/models/billing_plan.py index 545e198b..a5e65184 100644 --- a/appwrite/models/billing_plan.py +++ b/appwrite/models/billing_plan.py @@ -155,6 +155,8 @@ class BillingPlan(AppwriteModel): Maximum function and site deployment size in MB functionsintervalminimum : float Shortest function schedule interval allowed, in minutes. 0 allows every interval. + functionsallowcron : bool + Does the plan allow cron function schedules or only intervals. databasesallowencrypt : bool Does the plan support encrypted string attributes or not. limits : Optional[BillingPlanLimits] @@ -238,6 +240,7 @@ class BillingPlan(AppwriteModel): deploymentsize: float = Field(..., alias='deploymentSize') buildsize: float = Field(..., alias='buildSize') functionsintervalminimum: float = Field(..., alias='functionsIntervalMinimum') + functionsallowcron: bool = Field(..., alias='functionsAllowCron') databasesallowencrypt: bool = Field(..., alias='databasesAllowEncrypt') limits: Optional[BillingPlanLimits] = Field(default=None, alias='limits') group: BillingPlanGroup = Field(..., alias='group') @@ -370,6 +373,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['buildSize'] = 0 if 'functionsIntervalMinimum' not in data and 'functionsintervalminimum' not in data: data['functionsIntervalMinimum'] = 0 + if 'functionsAllowCron' not in data and 'functionsallowcron' not in data: + data['functionsAllowCron'] = True if 'databasesAllowEncrypt' not in data and 'databasesallowencrypt' not in data: data['databasesAllowEncrypt'] = False if 'databaseComputeCredit' not in data and 'databasecomputecredit' not in data: diff --git a/appwrite/models/bucket.py b/appwrite/models/bucket.py index 7718a57d..be6a7c37 100644 --- a/appwrite/models/bucket.py +++ b/appwrite/models/bucket.py @@ -22,6 +22,8 @@ class Bucket(AppwriteModel): Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). name : str Bucket name. + description : str + Optional description for the bucket. enabled : bool Bucket enabled. maximumfilesize : float @@ -36,6 +38,8 @@ class Bucket(AppwriteModel): Virus scanning is enabled. transformations : bool Image transformations are enabled. + stripmetadata : bool + Metadata such as location, device and capture time is removed from uploaded images. totalsize : float Total size of this bucket in bytes. """ @@ -46,6 +50,7 @@ class Bucket(AppwriteModel): permissions: List[Any] = Field(..., alias='$permissions') filesecurity: bool = Field(..., alias='fileSecurity') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') enabled: bool = Field(..., alias='enabled') maximumfilesize: float = Field(..., alias='maximumFileSize') allowedfileextensions: List[Any] = Field(..., alias='allowedFileExtensions') @@ -53,6 +58,7 @@ class Bucket(AppwriteModel): encryption: bool = Field(..., alias='encryption') antivirus: bool = Field(..., alias='antivirus') transformations: bool = Field(..., alias='transformations') + stripmetadata: bool = Field(..., alias='stripMetadata') totalsize: float = Field(..., alias='totalSize') @model_validator(mode='before') @@ -74,6 +80,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['fileSecurity'] = False if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'enabled' not in data: data['enabled'] = True if 'maximumFileSize' not in data and 'maximumfilesize' not in data: @@ -88,6 +96,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['antivirus'] = True if 'transformations' not in data: data['transformations'] = True + if 'stripMetadata' not in data and 'stripmetadata' not in data: + data['stripMetadata'] = False if 'totalSize' not in data and 'totalsize' not in data: data['totalSize'] = 0 return data diff --git a/appwrite/models/collection.py b/appwrite/models/collection.py index 419ec48a..57b47caf 100644 --- a/appwrite/models/collection.py +++ b/appwrite/models/collection.py @@ -41,6 +41,8 @@ class Collection(AppwriteModel): Database ID. name : str Collection name. + description : str + Optional description for the collection. enabled : bool Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. documentsecurity : bool @@ -61,6 +63,7 @@ class Collection(AppwriteModel): permissions: List[Any] = Field(..., alias='$permissions') databaseid: str = Field(..., alias='databaseId') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') enabled: bool = Field(..., alias='enabled') documentsecurity: bool = Field(..., alias='documentSecurity') attributes: List[ @@ -108,6 +111,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['databaseId'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'enabled' not in data: data['enabled'] = True if 'documentSecurity' not in data and 'documentsecurity' not in data: diff --git a/appwrite/models/column_bigint.py b/appwrite/models/column_bigint.py index b2fa8225..8fe0857c 100644 --- a/appwrite/models/column_bigint.py +++ b/appwrite/models/column_bigint.py @@ -13,6 +13,8 @@ class ColumnBigint(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -36,6 +38,7 @@ class ColumnBigint(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_boolean.py b/appwrite/models/column_boolean.py index 33ebd132..1ceb8170 100644 --- a/appwrite/models/column_boolean.py +++ b/appwrite/models/column_boolean.py @@ -13,6 +13,8 @@ class ColumnBoolean(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -32,6 +34,7 @@ class ColumnBoolean(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_datetime.py b/appwrite/models/column_datetime.py index 46c1d04a..c8db0d06 100644 --- a/appwrite/models/column_datetime.py +++ b/appwrite/models/column_datetime.py @@ -13,6 +13,8 @@ class ColumnDatetime(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -34,6 +36,7 @@ class ColumnDatetime(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_email.py b/appwrite/models/column_email.py index 68094615..3940ef16 100644 --- a/appwrite/models/column_email.py +++ b/appwrite/models/column_email.py @@ -13,6 +13,8 @@ class ColumnEmail(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -34,6 +36,7 @@ class ColumnEmail(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_enum.py b/appwrite/models/column_enum.py index 3dd815af..081eba50 100644 --- a/appwrite/models/column_enum.py +++ b/appwrite/models/column_enum.py @@ -13,6 +13,8 @@ class ColumnEnum(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -36,6 +38,7 @@ class ColumnEnum(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_float.py b/appwrite/models/column_float.py index aa089000..6ed443c3 100644 --- a/appwrite/models/column_float.py +++ b/appwrite/models/column_float.py @@ -13,6 +13,8 @@ class ColumnFloat(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -36,6 +38,7 @@ class ColumnFloat(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_index.py b/appwrite/models/column_index.py index 54419edf..1124ab21 100644 --- a/appwrite/models/column_index.py +++ b/appwrite/models/column_index.py @@ -18,6 +18,8 @@ class ColumnIndex(AppwriteModel): Index update date in ISO 8601 format. key : str Index Key. + description : str + Optional description for the index. type : str Index type. status : str @@ -36,6 +38,7 @@ class ColumnIndex(AppwriteModel): createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: str = Field(..., alias='status') error: str = Field(..., alias='error') @@ -58,6 +61,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$updatedAt'] = '' if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'status' not in data: diff --git a/appwrite/models/column_integer.py b/appwrite/models/column_integer.py index 9ad8fbd4..64c9feaf 100644 --- a/appwrite/models/column_integer.py +++ b/appwrite/models/column_integer.py @@ -13,6 +13,8 @@ class ColumnInteger(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -36,6 +38,7 @@ class ColumnInteger(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_ip.py b/appwrite/models/column_ip.py index fe5de6b6..24b9cdfa 100644 --- a/appwrite/models/column_ip.py +++ b/appwrite/models/column_ip.py @@ -13,6 +13,8 @@ class ColumnIp(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -34,6 +36,7 @@ class ColumnIp(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_line.py b/appwrite/models/column_line.py index 0216047f..e715deec 100644 --- a/appwrite/models/column_line.py +++ b/appwrite/models/column_line.py @@ -13,6 +13,8 @@ class ColumnLine(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -32,6 +34,7 @@ class ColumnLine(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_longtext.py b/appwrite/models/column_longtext.py index ce3585fd..8a27318d 100644 --- a/appwrite/models/column_longtext.py +++ b/appwrite/models/column_longtext.py @@ -13,6 +13,8 @@ class ColumnLongtext(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -34,6 +36,7 @@ class ColumnLongtext(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_mediumtext.py b/appwrite/models/column_mediumtext.py index 31717475..dfb5c0cc 100644 --- a/appwrite/models/column_mediumtext.py +++ b/appwrite/models/column_mediumtext.py @@ -13,6 +13,8 @@ class ColumnMediumtext(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -34,6 +36,7 @@ class ColumnMediumtext(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_point.py b/appwrite/models/column_point.py index 0217c08e..14997cea 100644 --- a/appwrite/models/column_point.py +++ b/appwrite/models/column_point.py @@ -13,6 +13,8 @@ class ColumnPoint(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -32,6 +34,7 @@ class ColumnPoint(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_polygon.py b/appwrite/models/column_polygon.py index 3bcc61c9..1d8c722c 100644 --- a/appwrite/models/column_polygon.py +++ b/appwrite/models/column_polygon.py @@ -13,6 +13,8 @@ class ColumnPolygon(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -32,6 +34,7 @@ class ColumnPolygon(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -50,6 +53,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_relationship.py b/appwrite/models/column_relationship.py index 5b1f96b9..fd44c287 100644 --- a/appwrite/models/column_relationship.py +++ b/appwrite/models/column_relationship.py @@ -13,6 +13,8 @@ class ColumnRelationship(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -42,6 +44,7 @@ class ColumnRelationship(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -65,6 +68,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_string.py b/appwrite/models/column_string.py index c8d5efcb..a6d8da11 100644 --- a/appwrite/models/column_string.py +++ b/appwrite/models/column_string.py @@ -13,6 +13,8 @@ class ColumnString(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -36,6 +38,7 @@ class ColumnString(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_text.py b/appwrite/models/column_text.py index 29ea6f5b..6be3b6f5 100644 --- a/appwrite/models/column_text.py +++ b/appwrite/models/column_text.py @@ -13,6 +13,8 @@ class ColumnText(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -34,6 +36,7 @@ class ColumnText(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_url.py b/appwrite/models/column_url.py index bb51776b..60bfcfa8 100644 --- a/appwrite/models/column_url.py +++ b/appwrite/models/column_url.py @@ -13,6 +13,8 @@ class ColumnUrl(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -34,6 +36,7 @@ class ColumnUrl(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -53,6 +56,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/column_varchar.py b/appwrite/models/column_varchar.py index 113ca34f..d09f0c94 100644 --- a/appwrite/models/column_varchar.py +++ b/appwrite/models/column_varchar.py @@ -13,6 +13,8 @@ class ColumnVarchar(AppwriteModel): ---------- key : str Column Key. + description : str + Optional description for the column. type : str Column type. status : ColumnStatus @@ -36,6 +38,7 @@ class ColumnVarchar(AppwriteModel): """ key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: ColumnStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -56,6 +59,8 @@ def _apply_defaults(cls, data: Any) -> Any: data = dict(data) if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/database.py b/appwrite/models/database.py index 931cb68d..c17f2a63 100644 --- a/appwrite/models/database.py +++ b/appwrite/models/database.py @@ -18,6 +18,8 @@ class Database(AppwriteModel): Database ID. name : str Database name. + description : str + Optional description for the database. createdat : str Database creation date in ISO 8601 format. updatedat : str @@ -48,6 +50,7 @@ class Database(AppwriteModel): id: str = Field(..., alias='$id') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') enabled: bool = Field(..., alias='enabled') @@ -73,6 +76,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$id'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if '$createdAt' not in data and 'createdat' not in data: data['$createdAt'] = '' if '$updatedAt' not in data and 'updatedat' not in data: diff --git a/appwrite/models/ephemeral_key.py b/appwrite/models/ephemeral_key.py index 7800c687..1fda1395 100644 --- a/appwrite/models/ephemeral_key.py +++ b/appwrite/models/ephemeral_key.py @@ -18,6 +18,8 @@ class EphemeralKey(AppwriteModel): Key update date in ISO 8601 format. name : str Key name. + description : str + Optional description for the key. expire : str Key expiration date in ISO 8601 format. scopes : List[Any] @@ -34,6 +36,7 @@ class EphemeralKey(AppwriteModel): createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') expire: str = Field(..., alias='expire') scopes: List[Any] = Field(..., alias='scopes') secret: str = Field(..., alias='secret') @@ -55,6 +58,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$updatedAt'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'expire' not in data: data['expire'] = '' if 'scopes' not in data: diff --git a/appwrite/models/function.py b/appwrite/models/function.py index 87862433..c25b1017 100644 --- a/appwrite/models/function.py +++ b/appwrite/models/function.py @@ -21,6 +21,8 @@ class Function(AppwriteModel): Execution permissions. name : str Function name. + description : str + Optional description for the function. enabled : bool Function enabled. live : bool @@ -86,6 +88,7 @@ class Function(AppwriteModel): updatedat: str = Field(..., alias='$updatedAt') execute: List[Any] = Field(..., alias='execute') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') enabled: bool = Field(..., alias='enabled') live: bool = Field(..., alias='live') logging: bool = Field(..., alias='logging') @@ -133,6 +136,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['execute'] = [] if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'enabled' not in data: data['enabled'] = True if 'live' not in data: diff --git a/appwrite/models/index.py b/appwrite/models/index.py index 21613a19..64dadef6 100644 --- a/appwrite/models/index.py +++ b/appwrite/models/index.py @@ -19,6 +19,8 @@ class Index(AppwriteModel): Index update date in ISO 8601 format. key : str Index key. + description : str + Optional description for the index. type : str Index type. status : IndexStatus @@ -37,6 +39,7 @@ class Index(AppwriteModel): createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') key: str = Field(..., alias='key') + description: str = Field(..., alias='description') type: str = Field(..., alias='type') status: IndexStatus = Field(..., alias='status') error: str = Field(..., alias='error') @@ -59,6 +62,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$updatedAt'] = '' if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'type' not in data: data['type'] = '' if 'error' not in data: diff --git a/appwrite/models/key.py b/appwrite/models/key.py index f8e209fe..7888c9de 100644 --- a/appwrite/models/key.py +++ b/appwrite/models/key.py @@ -18,6 +18,8 @@ class Key(AppwriteModel): Key update date in ISO 8601 format. name : str Key name. + description : str + Optional description for the key. expire : str Key expiration date in ISO 8601 format. scopes : List[Any] @@ -34,6 +36,7 @@ class Key(AppwriteModel): createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') expire: str = Field(..., alias='expire') scopes: List[Any] = Field(..., alias='scopes') secret: str = Field(..., alias='secret') @@ -55,6 +58,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$updatedAt'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'expire' not in data: data['expire'] = '' if 'scopes' not in data: diff --git a/appwrite/models/policy_password_dictionary.py b/appwrite/models/policy_password_dictionary.py index 37bbbeeb..6527f197 100644 --- a/appwrite/models/policy_password_dictionary.py +++ b/appwrite/models/policy_password_dictionary.py @@ -14,10 +14,13 @@ class PolicyPasswordDictionary(AppwriteModel): Policy ID. enabled : bool Whether password dictionary policy is enabled. + denylist : List[Any] + Custom passwords blocked by case-sensitive equality when enabled. """ id: str = Field(..., alias='$id') enabled: bool = Field(..., alias='enabled') + denylist: List[Any] = Field(..., alias='denyList') @model_validator(mode='before') @classmethod @@ -30,4 +33,6 @@ def _apply_defaults(cls, data: Any) -> Any: data['$id'] = '' if 'enabled' not in data: data['enabled'] = False + if 'denyList' not in data and 'denylist' not in data: + data['denyList'] = [] return data diff --git a/appwrite/models/policy_password_personal_data.py b/appwrite/models/policy_password_personal_data.py index 64f12c7c..82f6158e 100644 --- a/appwrite/models/policy_password_personal_data.py +++ b/appwrite/models/policy_password_personal_data.py @@ -14,10 +14,13 @@ class PolicyPasswordPersonalData(AppwriteModel): Policy ID. enabled : bool Whether password personal data policy is enabled. + denylist : List[Any] + Custom terms blocked by case-insensitive substring matching when enabled. """ id: str = Field(..., alias='$id') enabled: bool = Field(..., alias='enabled') + denylist: List[Any] = Field(..., alias='denyList') @model_validator(mode='before') @classmethod @@ -30,4 +33,6 @@ def _apply_defaults(cls, data: Any) -> Any: data['$id'] = '' if 'enabled' not in data: data['enabled'] = False + if 'denyList' not in data and 'denylist' not in data: + data['denyList'] = [] return data diff --git a/appwrite/models/site.py b/appwrite/models/site.py index bef638fc..346e7fae 100644 --- a/appwrite/models/site.py +++ b/appwrite/models/site.py @@ -19,6 +19,8 @@ class Site(AppwriteModel): Site update date in ISO 8601 format. name : str Site name. + description : str + Optional description for the site. enabled : bool Site enabled. live : bool @@ -87,6 +89,7 @@ class Site(AppwriteModel): createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') enabled: bool = Field(..., alias='enabled') live: bool = Field(..., alias='live') logging: bool = Field(..., alias='logging') @@ -134,6 +137,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$updatedAt'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'enabled' not in data: data['enabled'] = True if 'live' not in data: diff --git a/appwrite/models/table.py b/appwrite/models/table.py index 41c97ef3..944497ab 100644 --- a/appwrite/models/table.py +++ b/appwrite/models/table.py @@ -41,6 +41,8 @@ class Table(AppwriteModel): Database ID. name : str Table name. + description : str + Optional description for the table. enabled : bool Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys. rowsecurity : bool @@ -61,6 +63,7 @@ class Table(AppwriteModel): permissions: List[Any] = Field(..., alias='$permissions') databaseid: str = Field(..., alias='databaseId') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') enabled: bool = Field(..., alias='enabled') rowsecurity: bool = Field(..., alias='rowSecurity') columns: List[ @@ -108,6 +111,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['databaseId'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'enabled' not in data: data['enabled'] = True if 'rowSecurity' not in data and 'rowsecurity' not in data: diff --git a/appwrite/models/topic.py b/appwrite/models/topic.py index b3566eec..f7d3da42 100644 --- a/appwrite/models/topic.py +++ b/appwrite/models/topic.py @@ -18,6 +18,8 @@ class Topic(AppwriteModel): Topic update date in ISO 8601 format. name : str The name of the topic. + description : str + Optional description for the topic. emailtotal : float Total count of email subscribers subscribed to the topic. smstotal : float @@ -36,6 +38,7 @@ class Topic(AppwriteModel): createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') emailtotal: float = Field(..., alias='emailTotal') smstotal: float = Field(..., alias='smsTotal') pushtotal: float = Field(..., alias='pushTotal') @@ -58,6 +61,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$updatedAt'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'emailTotal' not in data and 'emailtotal' not in data: data['emailTotal'] = 0 if 'smsTotal' not in data and 'smstotal' not in data: diff --git a/appwrite/models/variable.py b/appwrite/models/variable.py index a50d58f0..a667b1c9 100644 --- a/appwrite/models/variable.py +++ b/appwrite/models/variable.py @@ -18,6 +18,8 @@ class Variable(AppwriteModel): Variable creation date in ISO 8601 format. key : str Variable key. + description : str + Optional description for the variable. value : str Variable value. secret : bool @@ -32,6 +34,7 @@ class Variable(AppwriteModel): createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') key: str = Field(..., alias='key') + description: str = Field(..., alias='description') value: str = Field(..., alias='value') secret: bool = Field(..., alias='secret') resourcetype: str = Field(..., alias='resourceType') @@ -52,6 +55,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$updatedAt'] = '' if 'key' not in data: data['key'] = '' + if 'description' not in data: + data['description'] = '' if 'value' not in data: data['value'] = '' if 'secret' not in data: diff --git a/appwrite/models/vectorsdb_collection.py b/appwrite/models/vectorsdb_collection.py index e4ca60ff..84098b26 100644 --- a/appwrite/models/vectorsdb_collection.py +++ b/appwrite/models/vectorsdb_collection.py @@ -25,6 +25,8 @@ class VectorsdbCollection(AppwriteModel): Database ID. name : str Collection name. + description : str + Optional description for the collection. enabled : bool Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. documentsecurity : bool @@ -47,6 +49,7 @@ class VectorsdbCollection(AppwriteModel): permissions: List[Any] = Field(..., alias='$permissions') databaseid: str = Field(..., alias='databaseId') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') enabled: bool = Field(..., alias='enabled') documentsecurity: bool = Field(..., alias='documentSecurity') attributes: List[ @@ -79,6 +82,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['databaseId'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'enabled' not in data: data['enabled'] = True if 'documentSecurity' not in data and 'documentsecurity' not in data: diff --git a/appwrite/models/webhook.py b/appwrite/models/webhook.py index 3114336d..db6fc715 100644 --- a/appwrite/models/webhook.py +++ b/appwrite/models/webhook.py @@ -18,6 +18,8 @@ class Webhook(AppwriteModel): Webhook update date in ISO 8601 format. name : str Webhook name. + description : str + Optional description for the webhook. url : str Webhook URL endpoint. events : List[Any] @@ -42,6 +44,7 @@ class Webhook(AppwriteModel): createdat: str = Field(..., alias='$createdAt') updatedat: str = Field(..., alias='$updatedAt') name: str = Field(..., alias='name') + description: str = Field(..., alias='description') url: str = Field(..., alias='url') events: List[Any] = Field(..., alias='events') tls: bool = Field(..., alias='tls') @@ -67,6 +70,8 @@ def _apply_defaults(cls, data: Any) -> Any: data['$updatedAt'] = '' if 'name' not in data: data['name'] = '' + if 'description' not in data: + data['description'] = '' if 'url' not in data: data['url'] = '' if 'events' not in data: diff --git a/appwrite/services/account.py b/appwrite/services/account.py index 6891e202..9788e53c 100644 --- a/appwrite/services/account.py +++ b/appwrite/services/account.py @@ -9,6 +9,7 @@ from ..models.oauth2_consent_token_list import Oauth2ConsentTokenList from ..models.oauth2_consent_token import Oauth2ConsentToken from ..models.identity_list import IdentityList +from ..models.membership_list import MembershipList from ..enums.authenticator_type import AuthenticatorType from ..models.mfa_type import MfaType from ..enums.authentication_factor import AuthenticationFactor @@ -539,6 +540,50 @@ def delete_identity( return response + def list_memberships( + self, + queries: Optional[List[str]] = None, + total: Optional[bool] = None, + ) -> MembershipList: + """ + Get the team memberships of the currently logged in user. + + Parameters + ---------- + 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 + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. + Returns + ------- + MembershipList + API response as a typed Pydantic model + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/account/memberships' + api_params = {} + if queries is not None: + api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) + + response = self.client.call( + 'get', + api_path, + { + 'X-Appwrite-Project': self.client.get_config('project'), + 'accept': 'application/json', + }, + api_params, + ) + + return self._parse_response(response, model=MembershipList) + def update_mfa( self, mfa: bool, @@ -1482,6 +1527,8 @@ def update_recovery( Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable. + Parameters ---------- user_id : str @@ -1583,6 +1630,8 @@ def update_recovery_otp( """ Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https://appwrite.io/docs/references/cloud/client-web/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated. + The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable. + Parameters ---------- user_id : str diff --git a/appwrite/services/activities.py b/appwrite/services/activities.py index 1c33eeef..8556609f 100644 --- a/appwrite/services/activities.py +++ b/appwrite/services/activities.py @@ -15,6 +15,7 @@ def __init__(self, client) -> None: def list_events( self, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> ActivityEventList: """ List all events for selected filters. @@ -23,6 +24,8 @@ def list_events( ---------- 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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- ActivityEventList @@ -38,6 +41,8 @@ def list_events( api_params = {} if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', diff --git a/appwrite/services/backups.py b/appwrite/services/backups.py index c6e75e98..b33b009c 100644 --- a/appwrite/services/backups.py +++ b/appwrite/services/backups.py @@ -20,6 +20,7 @@ def __init__(self, client) -> None: def list_archives( self, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> BackupArchiveList: """ List all archives for a project. @@ -28,6 +29,8 @@ def list_archives( ---------- 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. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- BackupArchiveList @@ -43,6 +46,8 @@ def list_archives( api_params = {} if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -186,6 +191,7 @@ def delete_archive( def list_policies( self, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> BackupPolicyList: """ List all policies for a project. @@ -194,6 +200,8 @@ def list_policies( ---------- 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. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- BackupPolicyList @@ -209,6 +217,8 @@ def list_policies( api_params = {} if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -506,6 +516,7 @@ def create_restoration( def list_restorations( self, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> BackupRestorationList: """ List all backup restorations for a project. @@ -514,6 +525,8 @@ def list_restorations( ---------- 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. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- BackupRestorationList @@ -529,6 +542,8 @@ def list_restorations( api_params = {} if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', diff --git a/appwrite/services/databases.py b/appwrite/services/databases.py index 5e5fa631..179b6b20 100644 --- a/appwrite/services/databases.py +++ b/appwrite/services/databases.py @@ -103,6 +103,7 @@ def create( database_id: str, name: str, enabled: Optional[bool] = None, + description: Optional[str] = None, ) -> Database: """ Create a new Database. @@ -117,6 +118,8 @@ def create( Database name. Max length: 128 chars. 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. + description : Optional[str] + Optional description for the database. Returns ------- Database @@ -138,6 +141,8 @@ def create( api_params['name'] = self._normalize_value(name) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -481,6 +486,7 @@ def update( database_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, + description: Optional[str] = None, ) -> Database: """ Update a database by its unique ID. @@ -495,6 +501,8 @@ def update( Database name. Max length: 128 chars. 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. + description : Optional[str] + Optional description for the database. Returns ------- Database @@ -515,6 +523,8 @@ def update( api_params['name'] = self._normalize_value(name) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', @@ -642,6 +652,7 @@ def create_collection( enabled: Optional[bool] = None, attributes: Optional[List[Dict[str, Any]]] = None, indexes: Optional[List[Dict[str, Any]]] = None, + description: Optional[str] = None, ) -> Collection: """ 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. @@ -666,6 +677,8 @@ def create_collection( Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. indexes : Optional[List[Dict[str, Any]]] Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial, trigram), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + description : Optional[str] + Optional description for the collection. Returns ------- Collection @@ -698,6 +711,8 @@ def create_collection( api_params['attributes'] = self._normalize_value(attributes) if indexes is not None: api_params['indexes'] = self._normalize_value(indexes) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -771,6 +786,7 @@ def update_collection( document_security: Optional[bool] = None, enabled: Optional[bool] = None, purge: Optional[bool] = None, + description: Optional[str] = None, ) -> Collection: """ Update a collection by its unique ID. @@ -793,6 +809,8 @@ def update_collection( 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. purge : Optional[bool] When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + description : Optional[str] + Optional description for the collection. Returns ------- Collection @@ -822,6 +840,8 @@ def update_collection( api_params['enabled'] = self._normalize_value(enabled) if purge is not None: api_params['purge'] = self._normalize_value(purge) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', @@ -956,6 +976,7 @@ def create_big_int_attribute( max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeBigint: """ Create a bigint attribute. Optionally, minimum and maximum values can be provided. @@ -980,6 +1001,8 @@ def create_big_int_attribute( Default value. Cannot be set when attribute is required. array : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeBigint @@ -1013,6 +1036,8 @@ def create_big_int_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1038,6 +1063,7 @@ def update_big_int_attribute( min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeBigint: """ Update a bigint attribute. Changing the `default` value will not update already existing documents. @@ -1062,6 +1088,8 @@ def update_big_int_attribute( Maximum value new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeBigint @@ -1094,6 +1122,8 @@ def update_big_int_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1117,6 +1147,7 @@ def create_boolean_attribute( required: bool, default: Optional[bool] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeBoolean: """ Create a boolean attribute. @@ -1137,6 +1168,8 @@ def create_boolean_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. array : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeBoolean @@ -1166,6 +1199,8 @@ def create_boolean_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1189,6 +1224,7 @@ def update_boolean_attribute( required: bool, default: Optional[bool], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeBoolean: """ Update a boolean attribute. Changing the `default` value will not update already existing documents. @@ -1209,6 +1245,8 @@ def update_boolean_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. new_key : Optional[str] New attribute key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeBoolean @@ -1237,6 +1275,8 @@ def update_boolean_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1260,6 +1300,7 @@ def create_datetime_attribute( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeDatetime: """ Create a date time attribute according to the ISO 8601 standard. @@ -1280,6 +1321,8 @@ def create_datetime_attribute( 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 : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeDatetime @@ -1309,6 +1352,8 @@ def create_datetime_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1332,6 +1377,7 @@ def update_datetime_attribute( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeDatetime: """ Update a date time attribute. Changing the `default` value will not update already existing documents. @@ -1352,6 +1398,8 @@ def update_datetime_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. new_key : Optional[str] New attribute key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeDatetime @@ -1380,6 +1428,8 @@ def update_datetime_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1403,6 +1453,7 @@ def create_email_attribute( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeEmail: """ Create an email attribute. @@ -1423,6 +1474,8 @@ def create_email_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. array : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeEmail @@ -1452,6 +1505,8 @@ def create_email_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1475,6 +1530,7 @@ def update_email_attribute( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeEmail: """ Update an email attribute. Changing the `default` value will not update already existing documents. @@ -1495,6 +1551,8 @@ def update_email_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeEmail @@ -1523,6 +1581,8 @@ def update_email_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1547,6 +1607,7 @@ def create_enum_attribute( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeEnum: """ Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. @@ -1569,6 +1630,8 @@ def create_enum_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. array : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeEnum @@ -1601,6 +1664,8 @@ def create_enum_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1625,6 +1690,7 @@ def update_enum_attribute( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeEnum: """ Update an enum attribute. Changing the `default` value will not update already existing documents. @@ -1647,6 +1713,8 @@ def update_enum_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeEnum @@ -1678,6 +1746,8 @@ def update_enum_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1703,6 +1773,7 @@ def create_float_attribute( max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeFloat: """ Create a float attribute. Optionally, minimum and maximum values can be provided. @@ -1727,6 +1798,8 @@ def create_float_attribute( Default value. Cannot be set when required. array : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeFloat @@ -1760,6 +1833,8 @@ def create_float_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1785,6 +1860,7 @@ def update_float_attribute( min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeFloat: """ Update a float attribute. Changing the `default` value will not update already existing documents. @@ -1809,6 +1885,8 @@ def update_float_attribute( Maximum value. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeFloat @@ -1841,6 +1919,8 @@ def update_float_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1866,6 +1946,7 @@ def create_integer_attribute( max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeInteger: """ Create an integer attribute. Optionally, minimum and maximum values can be provided. @@ -1890,6 +1971,8 @@ def create_integer_attribute( Default value. Cannot be set when attribute is required. array : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeInteger @@ -1923,6 +2006,8 @@ def create_integer_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1948,6 +2033,7 @@ def update_integer_attribute( min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeInteger: """ Update an integer attribute. Changing the `default` value will not update already existing documents. @@ -1972,6 +2058,8 @@ def update_integer_attribute( Maximum value new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeInteger @@ -2004,6 +2092,8 @@ def update_integer_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2027,6 +2117,7 @@ def create_ip_attribute( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeIp: """ Create IP address attribute. @@ -2047,6 +2138,8 @@ def create_ip_attribute( Default value. Cannot be set when attribute is required. array : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeIp @@ -2076,6 +2169,8 @@ def create_ip_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2099,6 +2194,7 @@ def update_ip_attribute( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeIp: """ Update an ip attribute. Changing the `default` value will not update already existing documents. @@ -2119,6 +2215,8 @@ def update_ip_attribute( Default value. Cannot be set when attribute is required. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeIp @@ -2147,6 +2245,8 @@ def update_ip_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2169,6 +2269,7 @@ def create_line_attribute( key: str, required: bool, default: Optional[List[List[Any]]] = None, + description: Optional[str] = None, ) -> AttributeLine: """ Create a geometric line attribute. @@ -2187,6 +2288,8 @@ def create_line_attribute( Is attribute required? default : Optional[List[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. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeLine @@ -2214,6 +2317,8 @@ def create_line_attribute( api_params['required'] = self._normalize_value(required) if default is not None: api_params['default'] = self._normalize_value(default) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2237,6 +2342,7 @@ def update_line_attribute( required: bool, default: Optional[List[List[Any]]] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeLine: """ Update a line attribute. Changing the `default` value will not update already existing documents. @@ -2257,6 +2363,8 @@ def update_line_attribute( 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 : Optional[str] New attribute key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeLine @@ -2286,6 +2394,8 @@ def update_line_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2310,6 +2420,7 @@ def create_longtext_attribute( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeLongtext: """ Create a longtext attribute. @@ -2332,6 +2443,8 @@ def create_longtext_attribute( Is attribute an array? 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. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeLongtext @@ -2363,6 +2476,8 @@ def create_longtext_attribute( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2386,6 +2501,7 @@ def update_longtext_attribute( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeLongtext: """ Update a longtext attribute. Changing the `default` value will not update already existing documents. @@ -2406,6 +2522,8 @@ def update_longtext_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeLongtext @@ -2434,6 +2552,8 @@ def update_longtext_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2458,6 +2578,7 @@ def create_mediumtext_attribute( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeMediumtext: """ Create a mediumtext attribute. @@ -2480,6 +2601,8 @@ def create_mediumtext_attribute( Is attribute an array? 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. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeMediumtext @@ -2511,6 +2634,8 @@ def create_mediumtext_attribute( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2534,6 +2659,7 @@ def update_mediumtext_attribute( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeMediumtext: """ Update a mediumtext attribute. Changing the `default` value will not update already existing documents. @@ -2554,6 +2680,8 @@ def update_mediumtext_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeMediumtext @@ -2582,6 +2710,8 @@ def update_mediumtext_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2604,6 +2734,7 @@ def create_point_attribute( key: str, required: bool, default: Optional[List[float]] = None, + description: Optional[str] = None, ) -> AttributePoint: """ Create a geometric point attribute. @@ -2622,6 +2753,8 @@ def create_point_attribute( Is attribute required? default : Optional[List[float]] Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributePoint @@ -2649,6 +2782,8 @@ def create_point_attribute( api_params['required'] = self._normalize_value(required) if default is not None: api_params['default'] = self._normalize_value(default) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2672,6 +2807,7 @@ def update_point_attribute( required: bool, default: Optional[List[float]] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributePoint: """ Update a point attribute. Changing the `default` value will not update already existing documents. @@ -2692,6 +2828,8 @@ def update_point_attribute( 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 : Optional[str] New attribute key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributePoint @@ -2721,6 +2859,8 @@ def update_point_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2743,6 +2883,7 @@ def create_polygon_attribute( key: str, required: bool, default: Optional[List[List[Any]]] = None, + description: Optional[str] = None, ) -> AttributePolygon: """ Create a geometric polygon attribute. @@ -2761,6 +2902,8 @@ def create_polygon_attribute( Is attribute required? default : Optional[List[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. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributePolygon @@ -2788,6 +2931,8 @@ def create_polygon_attribute( api_params['required'] = self._normalize_value(required) if default is not None: api_params['default'] = self._normalize_value(default) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2811,6 +2956,7 @@ def update_polygon_attribute( required: bool, default: Optional[List[List[Any]]] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributePolygon: """ Update a polygon attribute. Changing the `default` value will not update already existing documents. @@ -2831,6 +2977,8 @@ def update_polygon_attribute( 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 : Optional[str] New attribute key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributePolygon @@ -2860,6 +3008,8 @@ def update_polygon_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2885,6 +3035,7 @@ def create_relationship_attribute( key: Optional[str] = None, two_way_key: Optional[str] = None, on_delete: Optional[RelationMutate] = None, + description: Optional[str] = None, ) -> AttributeRelationship: """ Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). @@ -2909,6 +3060,8 @@ def create_relationship_attribute( Two Way Attribute Key. on_delete : Optional[RelationMutate] Delete constraint. Possible values are: cascade, restrict, setNull. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeRelationship @@ -2942,6 +3095,8 @@ def create_relationship_attribute( api_params['twoWayKey'] = self._normalize_value(two_way_key) if on_delete is not None: api_params['onDelete'] = self._normalize_value(on_delete) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2964,6 +3119,7 @@ def update_relationship_attribute( key: str, on_delete: Optional[RelationMutate] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeRelationship: """ Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). @@ -2982,6 +3138,8 @@ def update_relationship_attribute( Delete constraint. Possible values are: cascade, restrict, setNull. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeRelationship @@ -3008,6 +3166,8 @@ def update_relationship_attribute( api_params['onDelete'] = self._normalize_value(on_delete) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3033,6 +3193,7 @@ def create_string_attribute( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeString: """ Create a string attribute. @@ -3057,6 +3218,8 @@ def create_string_attribute( Is attribute an array? 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. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeString @@ -3091,6 +3254,8 @@ def create_string_attribute( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3115,6 +3280,7 @@ def update_string_attribute( default: Optional[str], size: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeString: """ Update a string attribute. Changing the `default` value will not update already existing documents. @@ -3137,6 +3303,8 @@ def update_string_attribute( Maximum size of the string attribute. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeString @@ -3167,6 +3335,8 @@ def update_string_attribute( api_params['size'] = self._normalize_value(size) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3191,6 +3361,7 @@ def create_text_attribute( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeText: """ Create a text attribute. @@ -3213,6 +3384,8 @@ def create_text_attribute( Is attribute an array? 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. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeText @@ -3244,6 +3417,8 @@ def create_text_attribute( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3267,6 +3442,7 @@ def update_text_attribute( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeText: """ Update a text attribute. Changing the `default` value will not update already existing documents. @@ -3287,6 +3463,8 @@ def update_text_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeText @@ -3315,6 +3493,8 @@ def update_text_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3338,6 +3518,7 @@ def create_url_attribute( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeUrl: """ Create a URL attribute. @@ -3358,6 +3539,8 @@ def create_url_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. array : Optional[bool] Is attribute an array? + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeUrl @@ -3387,6 +3570,8 @@ def create_url_attribute( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3410,6 +3595,7 @@ def update_url_attribute( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeUrl: """ Update an url attribute. Changing the `default` value will not update already existing documents. @@ -3430,6 +3616,8 @@ def update_url_attribute( Default value for attribute when not provided. Cannot be set when attribute is required. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeUrl @@ -3458,6 +3646,8 @@ def update_url_attribute( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3483,6 +3673,7 @@ def create_varchar_attribute( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> AttributeVarchar: """ Create a varchar attribute. @@ -3507,6 +3698,8 @@ def create_varchar_attribute( Is attribute an array? 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. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeVarchar @@ -3541,6 +3734,8 @@ def create_varchar_attribute( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3565,6 +3760,7 @@ def update_varchar_attribute( default: Optional[str], size: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> AttributeVarchar: """ Update a varchar attribute. Changing the `default` value will not update already existing documents. @@ -3587,6 +3783,8 @@ def update_varchar_attribute( Maximum size of the varchar attribute. new_key : Optional[str] New Attribute Key. + description : Optional[str] + Optional description for the attribute. Returns ------- AttributeVarchar @@ -3617,6 +3815,8 @@ def update_varchar_attribute( api_params['size'] = self._normalize_value(size) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3831,6 +4031,8 @@ def list_documents( """ Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + Documents returned by aggregate, groupBy or distinct queries hold only the attributes they select, group or aggregate, typed as a document types them, with a joined attribute named by its join alias (`alias.attribute`). The response omits their `$id`, `$sequence`, `$createdAt`, `$updatedAt`, `$permissions`, `$databaseId` and `$collectionId` unless they select or group it, and those of a right or full join document that no document of this collection matched. SDK document models fill omitted system attributes with empty values. + .. deprecated::1.8.0 This API has been deprecated since 1.8.0. Please use `tablesDB.list_rows` instead. Parameters @@ -3846,7 +4048,7 @@ def list_documents( total : Optional[bool] When set to false, the total count returned will be 0 and will not be calculated. ttl : Optional[float] - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). model_type : Type[T], optional Pydantic model class for the user-defined data. Defaults to dict for backward compatibility. @@ -4229,6 +4431,80 @@ def delete_documents( return DocumentList.with_data(response, model_type) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.create_query` instead.") + def create_query( + self, + database_id: str, + collection_id: str, + queries: Optional[List[str]] = None, + transaction_id: Optional[str] = None, + total: Optional[bool] = None, + ttl: Optional[float] = None, + model_type: Type[T] = dict, + ) -> DocumentList[T]: + """ + Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + + .. deprecated::1.8.0 + This API has been deprecated since 1.8.0. Please use `tablesDB.create_query` instead. + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + 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 : Optional[str] + Transaction ID to read uncommitted changes within the transaction. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. + ttl : Optional[float] + TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). + model_type : Type[T], optional + Pydantic model class for the user-defined data. Defaults to dict for backward compatibility. + + Returns + ------- + DocumentList[T] + API response as a typed Pydantic model + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/databases/{databaseId}/collections/{collectionId}/documents/query' + api_params = {} + if database_id is None or database_id == '': + raise AppwriteException('Missing required parameter: "database_id"') + if collection_id is None or collection_id == '': + raise AppwriteException('Missing required parameter: "collection_id"') + api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) + api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id))) + if queries is not None: + api_params['queries'] = self._normalize_value(queries) + if transaction_id is not None: + api_params['transactionId'] = self._normalize_value(transaction_id) + if total is not None: + api_params['total'] = self._normalize_value(total) + if ttl is not None: + api_params['ttl'] = self._normalize_value(ttl) + + response = self.client.call( + 'post', + api_path, + { + 'X-Appwrite-Project': self.client.get_config('project'), + 'content-type': 'application/json', + 'accept': 'application/json', + }, + api_params, + ) + + return DocumentList.with_data(response, model_type) + @deprecated("This API has been deprecated since 1.8.0. Please use `tablesDB.get_row` instead.") def get_document( self, @@ -4740,6 +5016,7 @@ def create_index( attributes: List[str], orders: Optional[List[OrderBy]] = None, lengths: Optional[List[float]] = None, + description: Optional[str] = None, ) -> Index: """ Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. @@ -4763,6 +5040,8 @@ def create_index( Array of index orders. Maximum of 100 orders are allowed. lengths : Optional[List[float]] Length of index. Maximum of 100 + description : Optional[str] + Optional description for the index. Returns ------- Index @@ -4795,6 +5074,8 @@ def create_index( api_params['orders'] = self._normalize_value(orders) if lengths is not None: api_params['lengths'] = self._normalize_value(lengths) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', diff --git a/appwrite/services/documents_db.py b/appwrite/services/documents_db.py index ecef7255..234f2b66 100644 --- a/appwrite/services/documents_db.py +++ b/appwrite/services/documents_db.py @@ -78,6 +78,7 @@ def create( database_id: str, name: str, enabled: Optional[bool] = None, + description: Optional[str] = None, specification: Optional[str] = None, replicas: Optional[float] = None, sync_mode: Optional[str] = None, @@ -93,6 +94,8 @@ def create( Database name. Max length: 128 chars. 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. + description : Optional[str] + Optional description for the database. specification : Optional[str] Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. replicas : Optional[float] @@ -120,6 +123,8 @@ def create( api_params['name'] = self._normalize_value(name) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) if specification is not None: api_params['specification'] = self._normalize_value(specification) if replicas is not None: @@ -478,6 +483,7 @@ def update( database_id: str, name: str, enabled: Optional[bool] = None, + description: Optional[str] = None, specification: Optional[str] = None, replicas: Optional[float] = None, sync_mode: Optional[str] = None, @@ -493,6 +499,8 @@ def update( Database name. Max length: 128 chars. 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. + description : Optional[str] + Optional description for the database. specification : Optional[str] Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. replicas : Optional[float] @@ -520,6 +528,8 @@ def update( api_params['name'] = self._normalize_value(name) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) if specification is not None: api_params['specification'] = self._normalize_value(specification) if replicas is not None: @@ -646,6 +656,7 @@ def create_collection( enabled: Optional[bool] = None, attributes: Optional[List[Dict[str, Any]]] = None, indexes: Optional[List[Dict[str, Any]]] = None, + description: Optional[str] = None, ) -> Collection: """ 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#documentsDBCreateCollection) API or directly from your database console. @@ -668,6 +679,8 @@ def create_collection( Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. indexes : Optional[List[Dict[str, Any]]] Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + description : Optional[str] + Optional description for the collection. Returns ------- Collection @@ -700,6 +713,8 @@ def create_collection( api_params['attributes'] = self._normalize_value(attributes) if indexes is not None: api_params['indexes'] = self._normalize_value(indexes) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -769,6 +784,7 @@ def update_collection( document_security: Optional[bool] = None, enabled: Optional[bool] = None, purge: Optional[bool] = None, + description: Optional[str] = None, ) -> Collection: """ Update a collection by its unique ID. @@ -789,6 +805,8 @@ def update_collection( 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. purge : Optional[bool] When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + description : Optional[str] + Optional description for the collection. Returns ------- Collection @@ -819,6 +837,8 @@ def update_collection( api_params['enabled'] = self._normalize_value(enabled) if purge is not None: api_params['purge'] = self._normalize_value(purge) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', @@ -1274,6 +1294,77 @@ def delete_documents( return DocumentList.with_data(response, model_type) + def create_query( + self, + database_id: str, + collection_id: str, + queries: Optional[List[str]] = None, + transaction_id: Optional[str] = None, + total: Optional[bool] = None, + ttl: Optional[float] = None, + model_type: Type[T] = dict, + ) -> DocumentList[T]: + """ + Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + + Parameters + ---------- + database_id : str + Database ID. + collection_id : str + Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + queries : 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 : Optional[str] + Transaction ID to read uncommitted changes within the transaction. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. + ttl : Optional[float] + TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + model_type : Type[T], optional + Pydantic model class for the user-defined data. Defaults to dict for backward compatibility. + + Returns + ------- + DocumentList[T] + API response as a typed Pydantic model + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/documentsdb/{databaseId}/collections/{collectionId}/documents/query' + api_params = {} + if database_id is None or database_id == '': + raise AppwriteException('Missing required parameter: "database_id"') + if collection_id is None or collection_id == '': + raise AppwriteException('Missing required parameter: "collection_id"') + api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) + api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id))) + if queries is not None: + api_params['queries'] = self._normalize_value(queries) + if transaction_id is not None: + api_params['transactionId'] = self._normalize_value(transaction_id) + if total is not None: + api_params['total'] = self._normalize_value(total) + if ttl is not None: + api_params['ttl'] = self._normalize_value(ttl) + + response = self.client.call( + 'post', + api_path, + { + 'X-Appwrite-Project': self.client.get_config('project'), + 'content-type': 'application/json', + 'accept': 'application/json', + }, + api_params, + ) + + return DocumentList.with_data(response, model_type) + def get_document( self, database_id: str, @@ -1763,6 +1854,7 @@ def create_index( attributes: List[str], orders: Optional[List[OrderBy]] = None, lengths: Optional[List[float]] = None, + description: Optional[str] = None, ) -> Index: """ Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. @@ -1784,6 +1876,8 @@ def create_index( Array of index orders. Maximum of 100 orders are allowed. lengths : Optional[List[float]] Length of index. Maximum of 100 + description : Optional[str] + Optional description for the index. Returns ------- Index @@ -1816,6 +1910,8 @@ def create_index( api_params['orders'] = self._normalize_value(orders) if lengths is not None: api_params['lengths'] = self._normalize_value(lengths) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', diff --git a/appwrite/services/domains.py b/appwrite/services/domains.py index 6ca12b76..bce1dc23 100644 --- a/appwrite/services/domains.py +++ b/appwrite/services/domains.py @@ -22,6 +22,7 @@ def list( self, queries: Optional[List[str]] = None, search: Optional[str] = None, + total: Optional[bool] = None, ) -> DomainsList: """ List all domains registered for this project. This endpoint supports pagination. @@ -32,6 +33,8 @@ def list( Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as domain name, teamInternalId, expiration, etc. search : Optional[str] Search term to filter your list results. Max length: 256 chars. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- DomainsList @@ -49,6 +52,8 @@ def list( api_params['queries'] = self._normalize_value(queries) if search is not None: api_params['search'] = self._normalize_value(search) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -880,6 +885,7 @@ def list_records( self, domain_id: str, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> DnsRecordsList: """ List DNS records for a given domain. You can use this endpoint to list all the DNS records @@ -891,6 +897,8 @@ def list_records( Domain unique ID. queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. You may filter on attributes such as type, name, value, etc. Maximum of 100 queries are allowed, each 4096 characters long. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- DnsRecordsList @@ -909,6 +917,8 @@ def list_records( api_path = api_path.replace('{domainId}', str(self._normalize_value(domain_id))) if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', diff --git a/appwrite/services/functions.py b/appwrite/services/functions.py index 4a7b0ca7..fa109998 100644 --- a/appwrite/services/functions.py +++ b/appwrite/services/functions.py @@ -101,6 +101,7 @@ def create( runtime_specification: Optional[str] = None, deployment_retention: Optional[float] = None, interval: Optional[float] = None, + description: Optional[str] = None, ) -> Function: """ 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. @@ -153,6 +154,8 @@ def create( Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. interval : Optional[float] Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. + description : Optional[str] + Optional description for the function. Returns ------- Function @@ -215,6 +218,8 @@ def create( api_params['deploymentRetention'] = self._normalize_value(deployment_retention) if interval is not None: api_params['interval'] = self._normalize_value(interval) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -377,6 +382,7 @@ def update( runtime_specification: Optional[str] = None, deployment_retention: Optional[float] = None, interval: Optional[float] = None, + description: Optional[str] = None, email_enabled: Optional[bool] = None, ) -> Function: """ @@ -430,6 +436,8 @@ def update( Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. interval : Optional[float] Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set. + description : Optional[str] + Optional description for the function. email_enabled : Optional[bool] Enable inbound email triggering for this function. When false or omitted on create, SMTP recipients are rejected. Opt-in; default is off. Returns @@ -493,6 +501,8 @@ def update( api_params['deploymentRetention'] = self._normalize_value(deployment_retention) if interval is not None: api_params['interval'] = self._normalize_value(interval) + if description is not None: + api_params['description'] = self._normalize_value(description) if email_enabled is not None: api_params['emailEnabled'] = self._normalize_value(email_enabled) @@ -1387,6 +1397,7 @@ def create_variable( key: str, value: str, secret: Optional[bool] = None, + description: Optional[str] = None, ) -> Variable: """ Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. @@ -1403,6 +1414,8 @@ def create_variable( Variable value. Max length: 8192 chars. secret : Optional[bool] Secret variables can be updated or deleted, but only functions can read them during build and runtime. + description : Optional[str] + Optional description for the variable. Returns ------- Variable @@ -1430,6 +1443,8 @@ def create_variable( api_params['value'] = self._normalize_value(value) if secret is not None: api_params['secret'] = self._normalize_value(secret) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1497,6 +1512,7 @@ def update_variable( key: Optional[str] = None, value: Optional[str] = None, secret: Optional[bool] = None, + description: Optional[str] = None, ) -> Variable: """ Update variable by its unique ID. @@ -1513,6 +1529,8 @@ def update_variable( Variable value. Max length: 8192 chars. secret : Optional[bool] Secret variables can be updated or deleted, but only functions can read them during build and runtime. + description : Optional[str] + Optional description for the variable. Returns ------- Variable @@ -1538,6 +1556,8 @@ def update_variable( api_params['value'] = self._normalize_value(value) if secret is not None: api_params['secret'] = self._normalize_value(secret) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', diff --git a/appwrite/services/messaging.py b/appwrite/services/messaging.py index 6b864262..df5083f7 100644 --- a/appwrite/services/messaging.py +++ b/appwrite/services/messaging.py @@ -86,6 +86,7 @@ def create_email( scheduled_at: Optional[str] = None, reply_to_email: Optional[str] = None, reply_to_name: Optional[str] = None, + emails: Optional[List[str]] = None, ) -> Message: """ Create a new email message. @@ -120,6 +121,8 @@ def create_email( Email address to reply to. If not set, defaults to the sender email address. reply_to_name : Optional[str] Name of the reply to recipient. If not set, defaults to the sender name. + emails : Optional[List[str]] + List of email addresses to send the message to. Use this to deliver to recipients that are not backed by an Appwrite user, target, or topic. Returns ------- Message @@ -164,6 +167,8 @@ def create_email( api_params['replyToEmail'] = self._normalize_value(reply_to_email) if reply_to_name is not None: api_params['replyToName'] = self._normalize_value(reply_to_name) + if emails is not None: + api_params['emails'] = self._normalize_value(emails) response = self.client.call( 'post', @@ -194,6 +199,7 @@ def update_email( attachments: Optional[List[str]] = None, reply_to_email: Optional[str] = None, reply_to_name: Optional[str] = None, + emails: Optional[List[str]] = None, ) -> Message: """ 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. @@ -228,6 +234,8 @@ def update_email( Email address to reply to. Pass an empty string to restore the provider or sender default. reply_to_name : Optional[str] Name of the reply to recipient. Pass an empty string to restore the provider or sender default. + emails : Optional[List[str]] + List of email addresses to send the message to. Use this to deliver to recipients that are not backed by an Appwrite user, target, or topic. Returns ------- Message @@ -270,6 +278,8 @@ def update_email( api_params['replyToEmail'] = self._normalize_value(reply_to_email) if reply_to_name is not None: api_params['replyToName'] = self._normalize_value(reply_to_name) + if emails is not None: + api_params['emails'] = self._normalize_value(emails) response = self.client.call( 'patch', @@ -2936,6 +2946,7 @@ def create_topic( subscribe: Optional[List[str]] = None, qos: Optional[float] = None, expiry: Optional[float] = None, + description: Optional[str] = None, ) -> Topic: """ Create a new topic. @@ -2952,6 +2963,8 @@ def create_topic( MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. expiry : Optional[float] Message retention in seconds for offline delivery. Max 7 days (604800). Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one. + description : Optional[str] + Optional description for the topic. Returns ------- Topic @@ -2977,6 +2990,8 @@ def create_topic( api_params['qos'] = self._normalize_value(qos) if expiry is not None: api_params['expiry'] = self._normalize_value(expiry) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3038,6 +3053,7 @@ def update_topic( subscribe: Optional[List[str]] = None, qos: Optional[float] = None, expiry: Optional[float] = None, + description: Optional[str] = None, ) -> Topic: """ Update a topic by its unique ID. @@ -3054,6 +3070,8 @@ def update_topic( MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. expiry : Optional[float] Message retention in seconds for offline delivery. Max 7 days (604800). Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one. + description : Optional[str] + Optional description for the topic. Returns ------- Topic @@ -3078,6 +3096,8 @@ def update_topic( api_params['qos'] = self._normalize_value(qos) if expiry is not None: api_params['expiry'] = self._normalize_value(expiry) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', diff --git a/appwrite/services/mongo.py b/appwrite/services/mongo.py index 7bb92df1..f377fe6c 100644 --- a/appwrite/services/mongo.py +++ b/appwrite/services/mongo.py @@ -29,6 +29,7 @@ def __init__(self, client) -> None: def list( self, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> DedicatedDatabaseList: """ List all dedicated databases. Results support pagination. @@ -37,6 +38,8 @@ def list( ---------- queries : Optional[List[str]] Array of query strings. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- DedicatedDatabaseList @@ -52,6 +55,8 @@ def list( api_params = {} if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -433,6 +438,7 @@ def list_backups( self, database_id: str, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> DedicatedDatabaseBackupList: """ List all backups for a dedicated database. Results can be filtered by status and type. @@ -443,6 +449,8 @@ def list_backups( Database ID. 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: status, type, databaseId + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- DedicatedDatabaseBackupList @@ -461,6 +469,8 @@ def list_backups( api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -524,6 +534,7 @@ def list_backup_policies( self, database_id: str, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> BackupPolicyList: """ List scheduled backup policies for a dedicated database. @@ -534,6 +545,8 @@ def list_backup_policies( Database ID. queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- BackupPolicyList @@ -552,6 +565,8 @@ def list_backup_policies( api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', diff --git a/appwrite/services/mysql.py b/appwrite/services/mysql.py index 4e70e83f..0e402fe2 100644 --- a/appwrite/services/mysql.py +++ b/appwrite/services/mysql.py @@ -31,6 +31,7 @@ def __init__(self, client) -> None: def list( self, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> DedicatedDatabaseList: """ List all dedicated databases. Results support pagination. @@ -39,6 +40,8 @@ def list( ---------- queries : Optional[List[str]] Array of query strings. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- DedicatedDatabaseList @@ -54,6 +57,8 @@ def list( api_params = {} if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -435,6 +440,7 @@ def list_backups( self, database_id: str, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> DedicatedDatabaseBackupList: """ List all backups for a dedicated database. Results can be filtered by status and type. @@ -445,6 +451,8 @@ def list_backups( Database ID. 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: status, type, databaseId + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- DedicatedDatabaseBackupList @@ -463,6 +471,8 @@ def list_backups( api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -526,6 +536,7 @@ def list_backup_policies( self, database_id: str, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> BackupPolicyList: """ List scheduled backup policies for a dedicated database. @@ -536,6 +547,8 @@ def list_backup_policies( Database ID. queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- BackupPolicyList @@ -554,6 +567,8 @@ def list_backup_policies( api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', diff --git a/appwrite/services/organization.py b/appwrite/services/organization.py index 0e31be2b..ecb7efdb 100644 --- a/appwrite/services/organization.py +++ b/appwrite/services/organization.py @@ -986,6 +986,7 @@ def update_project_key( name: str, scopes: List[ProjectKeyScopes], expire: Optional[str] = None, + description: Optional[str] = None, ) -> Key: """ Update a project key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. @@ -1002,6 +1003,8 @@ def update_project_key( Key scopes list. Maximum of 200 scopes are allowed. expire : Optional[str] Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + description : Optional[str] + Optional description for the key. Returns ------- Key @@ -1029,6 +1032,8 @@ def update_project_key( api_params['scopes'] = self._normalize_value(scopes) if expire is not None: api_params['expire'] = self._normalize_value(expire) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', diff --git a/appwrite/services/postgresql.py b/appwrite/services/postgresql.py index f361d9dd..a5692e05 100644 --- a/appwrite/services/postgresql.py +++ b/appwrite/services/postgresql.py @@ -32,6 +32,7 @@ def __init__(self, client) -> None: def list( self, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> DedicatedDatabaseList: """ List all dedicated databases. Results support pagination. @@ -40,6 +41,8 @@ def list( ---------- queries : Optional[List[str]] Array of query strings. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- DedicatedDatabaseList @@ -55,6 +58,8 @@ def list( api_params = {} if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -436,6 +441,7 @@ def list_backups( self, database_id: str, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> DedicatedDatabaseBackupList: """ List all backups for a dedicated database. Results can be filtered by status and type. @@ -446,6 +452,8 @@ def list_backups( Database ID. 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: status, type, databaseId + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- DedicatedDatabaseBackupList @@ -464,6 +472,8 @@ def list_backups( api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', @@ -527,6 +537,7 @@ def list_backup_policies( self, database_id: str, queries: Optional[List[str]] = None, + total: Optional[bool] = None, ) -> BackupPolicyList: """ List scheduled backup policies for a dedicated database. @@ -537,6 +548,8 @@ def list_backup_policies( Database ID. queries : Optional[List[str]] Array of query strings generated using the Query class provided by the SDK. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. Returns ------- BackupPolicyList @@ -555,6 +568,8 @@ def list_backup_policies( api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) if queries is not None: api_params['queries'] = self._normalize_value(queries) + if total is not None: + api_params['total'] = self._normalize_value(total) response = self.client.call( 'get', diff --git a/appwrite/services/project.py b/appwrite/services/project.py index 3de8bfc2..d1d6da2d 100644 --- a/appwrite/services/project.py +++ b/appwrite/services/project.py @@ -581,6 +581,7 @@ def update_key( name: str, scopes: List[ProjectKeyScopes], expire: Optional[str] = None, + description: Optional[str] = None, ) -> Key: """ Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. @@ -595,6 +596,8 @@ def update_key( Key scopes list. Maximum of 200 scopes are allowed. expire : Optional[str] Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + description : Optional[str] + Optional description for the key. Returns ------- Key @@ -619,6 +622,8 @@ def update_key( api_params['scopes'] = self._normalize_value(scopes) if expire is not None: api_params['expire'] = self._normalize_value(expire) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', @@ -4982,14 +4987,19 @@ def update_passkey_policy( def update_password_dictionary_policy( self, enabled: bool, + deny_list: Optional[List[str]] = None, ) -> ProjectModel: """ Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary. + Custom denyList entries use case-sensitive equality and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits. + Parameters ---------- enabled : bool Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid. + deny_list : Optional[List[str]] + Custom blocked values using case-sensitive equality. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters. Returns ------- ProjectModel @@ -5006,6 +5016,8 @@ def update_password_dictionary_policy( if enabled is None: raise AppwriteException('Missing required parameter: "enabled"') api_params['enabled'] = self._normalize_value(enabled) + if deny_list is not None: + api_params['denyList'] = self._normalize_value(deny_list) response = self.client.call( 'patch', @@ -5064,14 +5076,20 @@ def update_password_history_policy( def update_password_personal_data_policy( self, enabled: bool, + deny_list: Optional[List[str]] = None, ) -> ProjectModel: """ Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number. + Custom denyList entries use case-insensitive substring matching and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits. + Password recovery also checks the recovered user profile, closing the previous gap in profile-based personal-data validation. + Parameters ---------- enabled : bool Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid. + deny_list : Optional[List[str]] + Custom blocked values using case-insensitive substring matching. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters. Returns ------- ProjectModel @@ -5088,6 +5106,8 @@ def update_password_personal_data_policy( if enabled is None: raise AppwriteException('Missing required parameter: "enabled"') api_params['enabled'] = self._normalize_value(enabled) + if deny_list is not None: + api_params['denyList'] = self._normalize_value(deny_list) response = self.client.call( 'patch', @@ -6010,6 +6030,7 @@ def create_variable( key: str, value: str, secret: Optional[bool] = None, + description: Optional[str] = None, ) -> Variable: """ Create a new project environment variable. These variables can be accessed by all functions and sites in the project. @@ -6024,6 +6045,8 @@ def create_variable( Variable value. Max length: 8192 chars. secret : Optional[bool] Secret variables can be updated or deleted, but only projects can read them during build and runtime. + description : Optional[str] + Optional description for the variable. Returns ------- Variable @@ -6048,6 +6071,8 @@ def create_variable( api_params['value'] = self._normalize_value(value) if secret is not None: api_params['secret'] = self._normalize_value(secret) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -6108,6 +6133,7 @@ def update_variable( key: Optional[str] = None, value: Optional[str] = None, secret: Optional[bool] = None, + description: Optional[str] = None, ) -> Variable: """ Update variable by its unique ID. @@ -6122,6 +6148,8 @@ def update_variable( Variable value. Max length: 8192 chars. secret : Optional[bool] Secret variables can be updated or deleted, but only projects can read them during build and runtime. + description : Optional[str] + Optional description for the variable. Returns ------- Variable @@ -6144,6 +6172,8 @@ def update_variable( api_params['value'] = self._normalize_value(value) if secret is not None: api_params['secret'] = self._normalize_value(secret) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', diff --git a/appwrite/services/sites.py b/appwrite/services/sites.py index 952e4b27..f3320934 100644 --- a/appwrite/services/sites.py +++ b/appwrite/services/sites.py @@ -103,6 +103,7 @@ def create( runtime_specification: Optional[str] = None, deployment_retention: Optional[float] = None, scopes: Optional[List[ProjectKeyScopes]] = None, + description: Optional[str] = None, ) -> Site: """ Create a new site. @@ -157,6 +158,8 @@ def create( Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. scopes : Optional[List[ProjectKeyScopes]] List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. + description : Optional[str] + Optional description for the site. Returns ------- Site @@ -222,6 +225,8 @@ def create( api_params['deploymentRetention'] = self._normalize_value(deployment_retention) if scopes is not None: api_params['scopes'] = self._normalize_value(scopes) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -385,6 +390,7 @@ def update( runtime_specification: Optional[str] = None, deployment_retention: Optional[float] = None, scopes: Optional[List[ProjectKeyScopes]] = None, + description: Optional[str] = None, ) -> Site: """ Update site by its unique ID. @@ -439,6 +445,8 @@ def update( Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. scopes : Optional[List[ProjectKeyScopes]] List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. + description : Optional[str] + Optional description for the site. Returns ------- Site @@ -503,6 +511,8 @@ def update( api_params['deploymentRetention'] = self._normalize_value(deployment_retention) if scopes is not None: api_params['scopes'] = self._normalize_value(scopes) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', @@ -1321,6 +1331,7 @@ def create_variable( key: str, value: str, secret: Optional[bool] = None, + description: Optional[str] = None, ) -> Variable: """ Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. @@ -1337,6 +1348,8 @@ def create_variable( Variable value. Max length: 8192 chars. secret : Optional[bool] Secret variables can be updated or deleted, but only sites can read them during build and runtime. + description : Optional[str] + Optional description for the variable. Returns ------- Variable @@ -1364,6 +1377,8 @@ def create_variable( api_params['value'] = self._normalize_value(value) if secret is not None: api_params['secret'] = self._normalize_value(secret) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1431,6 +1446,7 @@ def update_variable( key: Optional[str] = None, value: Optional[str] = None, secret: Optional[bool] = None, + description: Optional[str] = None, ) -> Variable: """ Update variable by its unique ID. @@ -1447,6 +1463,8 @@ def update_variable( Variable value. Max length: 8192 chars. secret : Optional[bool] Secret variables can be updated or deleted, but only sites can read them during build and runtime. + description : Optional[str] + Optional description for the variable. Returns ------- Variable @@ -1472,6 +1490,8 @@ def update_variable( api_params['value'] = self._normalize_value(value) if secret is not None: api_params['secret'] = self._normalize_value(secret) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', diff --git a/appwrite/services/storage.py b/appwrite/services/storage.py index a095f6d2..2981f526 100644 --- a/appwrite/services/storage.py +++ b/appwrite/services/storage.py @@ -30,7 +30,7 @@ def list_buckets( Parameters ---------- 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, transformations + 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, transformations, stripMetadata search : Optional[str] Search term to filter your list results. Max length: 256 chars. total : Optional[bool] @@ -80,6 +80,8 @@ def create_bucket( encryption: Optional[bool] = None, antivirus: Optional[bool] = None, transformations: Optional[bool] = None, + description: Optional[str] = None, + strip_metadata: Optional[bool] = None, ) -> Bucket: """ Create a new storage bucket. @@ -108,6 +110,10 @@ def create_bucket( Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled transformations : Optional[bool] Are image transformations enabled? + description : Optional[str] + Optional description for the bucket. + strip_metadata : Optional[bool] + Remove metadata such as location, device and capture time from uploaded images. The color profile and orientation are kept. For file size above 20MB metadata is not removed even if it's enabled. Returns ------- Bucket @@ -145,6 +151,10 @@ def create_bucket( api_params['antivirus'] = self._normalize_value(antivirus) if transformations is not None: api_params['transformations'] = self._normalize_value(transformations) + if description is not None: + api_params['description'] = self._normalize_value(description) + if strip_metadata is not None: + api_params['stripMetadata'] = self._normalize_value(strip_metadata) response = self.client.call( 'post', @@ -212,6 +222,8 @@ def update_bucket( encryption: Optional[bool] = None, antivirus: Optional[bool] = None, transformations: Optional[bool] = None, + description: Optional[str] = None, + strip_metadata: Optional[bool] = None, ) -> Bucket: """ Update a storage bucket by its unique ID. @@ -240,6 +252,10 @@ def update_bucket( Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled transformations : Optional[bool] Are image transformations enabled? + description : Optional[str] + Optional description for the bucket. + strip_metadata : Optional[bool] + Remove metadata such as location, device and capture time from uploaded images. The color profile and orientation are kept. For file size above 20MB metadata is not removed even if it's enabled. By default, the current setting is kept. Returns ------- Bucket @@ -277,6 +293,10 @@ def update_bucket( api_params['antivirus'] = self._normalize_value(antivirus) if transformations is not None: api_params['transformations'] = self._normalize_value(transformations) + if description is not None: + api_params['description'] = self._normalize_value(description) + if strip_metadata is not None: + api_params['stripMetadata'] = self._normalize_value(strip_metadata) response = self.client.call( 'put', diff --git a/appwrite/services/tables_db.py b/appwrite/services/tables_db.py index 6a90c3a8..19f181a5 100644 --- a/appwrite/services/tables_db.py +++ b/appwrite/services/tables_db.py @@ -106,6 +106,7 @@ def create( database_id: str, name: str, enabled: Optional[bool] = None, + description: Optional[str] = None, specification: Optional[str] = None, replicas: Optional[float] = None, sync_mode: Optional[str] = None, @@ -121,6 +122,8 @@ def create( Database name. Max length: 128 chars. 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. + description : Optional[str] + Optional description for the database. specification : Optional[str] Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. replicas : Optional[float] @@ -148,6 +151,8 @@ def create( api_params['name'] = self._normalize_value(name) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) if specification is not None: api_params['specification'] = self._normalize_value(specification) if replicas is not None: @@ -506,6 +511,7 @@ def update( database_id: str, name: Optional[str] = None, enabled: Optional[bool] = None, + description: Optional[str] = None, specification: Optional[str] = None, replicas: Optional[float] = None, sync_mode: Optional[str] = None, @@ -521,6 +527,8 @@ def update( Database name. Max length: 128 chars. 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. + description : Optional[str] + Optional description for the database. specification : Optional[str] Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. replicas : Optional[float] @@ -547,6 +555,8 @@ def update( api_params['name'] = self._normalize_value(name) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) if specification is not None: api_params['specification'] = self._normalize_value(specification) if replicas is not None: @@ -1086,6 +1096,7 @@ def create_table( enabled: Optional[bool] = None, columns: Optional[List[Dict[str, Any]]] = None, indexes: Optional[List[Dict[str, Any]]] = None, + description: Optional[str] = None, ) -> Table: """ 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. @@ -1108,6 +1119,8 @@ def create_table( Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. indexes : Optional[List[Dict[str, Any]]] Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial, trigram), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + description : Optional[str] + Optional description for the table. Returns ------- Table @@ -1140,6 +1153,8 @@ def create_table( api_params['columns'] = self._normalize_value(columns) if indexes is not None: api_params['indexes'] = self._normalize_value(indexes) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1209,6 +1224,7 @@ def update_table( row_security: Optional[bool] = None, enabled: Optional[bool] = None, purge: Optional[bool] = None, + description: Optional[str] = None, ) -> Table: """ Update a table by its unique ID. @@ -1229,6 +1245,8 @@ def update_table( 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. purge : Optional[bool] When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + description : Optional[str] + Optional description for the table. Returns ------- Table @@ -1258,6 +1276,8 @@ def update_table( api_params['enabled'] = self._normalize_value(enabled) if purge is not None: api_params['purge'] = self._normalize_value(purge) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', @@ -1385,6 +1405,7 @@ def create_big_int_column( max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnBigint: """ Create a bigint column. Optionally, minimum and maximum values can be provided. @@ -1407,6 +1428,8 @@ def create_big_int_column( Default value. Cannot be set when column is required. array : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnBigint @@ -1440,6 +1463,8 @@ def create_big_int_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1464,6 +1489,7 @@ def update_big_int_column( min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnBigint: """ Update a bigint column. Changing the `default` value will not update already existing rows. @@ -1486,6 +1512,8 @@ def update_big_int_column( Maximum value new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnBigint @@ -1518,6 +1546,8 @@ def update_big_int_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1540,6 +1570,7 @@ def create_boolean_column( required: bool, default: Optional[bool] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnBoolean: """ Create a boolean column. @@ -1558,6 +1589,8 @@ def create_boolean_column( Default value for column when not provided. Cannot be set when column is required. array : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnBoolean @@ -1587,6 +1620,8 @@ def create_boolean_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1609,6 +1644,7 @@ def update_boolean_column( required: bool, default: Optional[bool], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnBoolean: """ Update a boolean column. Changing the `default` value will not update already existing rows. @@ -1627,6 +1663,8 @@ def update_boolean_column( Default value for column when not provided. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnBoolean @@ -1655,6 +1693,8 @@ def update_boolean_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1677,6 +1717,7 @@ def create_datetime_column( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnDatetime: """ Create a date time column according to the ISO 8601 standard. @@ -1695,6 +1736,8 @@ def create_datetime_column( 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 : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnDatetime @@ -1724,6 +1767,8 @@ def create_datetime_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1746,6 +1791,7 @@ def update_datetime_column( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnDatetime: """ Update a date time column. Changing the `default` value will not update already existing rows. @@ -1764,6 +1810,8 @@ def update_datetime_column( Default value for column when not provided. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnDatetime @@ -1792,6 +1840,8 @@ def update_datetime_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1814,6 +1864,7 @@ def create_email_column( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnEmail: """ Create an email column. @@ -1832,6 +1883,8 @@ def create_email_column( Default value for column when not provided. Cannot be set when column is required. array : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnEmail @@ -1861,6 +1914,8 @@ def create_email_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -1883,6 +1938,7 @@ def update_email_column( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnEmail: """ Update an email column. Changing the `default` value will not update already existing rows. @@ -1901,6 +1957,8 @@ def update_email_column( Default value for column when not provided. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnEmail @@ -1929,6 +1987,8 @@ def update_email_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -1952,6 +2012,7 @@ def create_enum_column( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnEnum: """ Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column. @@ -1972,6 +2033,8 @@ def create_enum_column( Default value for column when not provided. Cannot be set when column is required. array : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnEnum @@ -2004,6 +2067,8 @@ def create_enum_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2027,6 +2092,7 @@ def update_enum_column( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnEnum: """ Update an enum column. Changing the `default` value will not update already existing rows. @@ -2047,6 +2113,8 @@ def update_enum_column( Default value for column when not provided. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnEnum @@ -2078,6 +2146,8 @@ def update_enum_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2102,6 +2172,7 @@ def create_float_column( max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnFloat: """ Create a float column. Optionally, minimum and maximum values can be provided. @@ -2124,6 +2195,8 @@ def create_float_column( Default value. Cannot be set when required. array : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnFloat @@ -2157,6 +2230,8 @@ def create_float_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2181,6 +2256,7 @@ def update_float_column( min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnFloat: """ Update a float column. Changing the `default` value will not update already existing rows. @@ -2203,6 +2279,8 @@ def update_float_column( Maximum value new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnFloat @@ -2235,6 +2313,8 @@ def update_float_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2259,6 +2339,7 @@ def create_integer_column( max: Optional[float] = None, default: Optional[float] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnInteger: """ Create an integer column. Optionally, minimum and maximum values can be provided. @@ -2281,6 +2362,8 @@ def create_integer_column( Default value. Cannot be set when column is required. array : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnInteger @@ -2314,6 +2397,8 @@ def create_integer_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2338,6 +2423,7 @@ def update_integer_column( min: Optional[float] = None, max: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnInteger: """ Update an integer column. Changing the `default` value will not update already existing rows. @@ -2360,6 +2446,8 @@ def update_integer_column( Maximum value new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnInteger @@ -2392,6 +2480,8 @@ def update_integer_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2414,6 +2504,7 @@ def create_ip_column( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnIp: """ Create IP address column. @@ -2432,6 +2523,8 @@ def create_ip_column( Default value. Cannot be set when column is required. array : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnIp @@ -2461,6 +2554,8 @@ def create_ip_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2483,6 +2578,7 @@ def update_ip_column( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnIp: """ Update an ip column. Changing the `default` value will not update already existing rows. @@ -2501,6 +2597,8 @@ def update_ip_column( Default value. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnIp @@ -2529,6 +2627,8 @@ def update_ip_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2550,6 +2650,7 @@ def create_line_column( key: str, required: bool, default: Optional[List[List[Any]]] = None, + description: Optional[str] = None, ) -> ColumnLine: """ Create a geometric line column. @@ -2566,6 +2667,8 @@ def create_line_column( Is column required? default : Optional[List[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. + description : Optional[str] + Optional description for the column. Returns ------- ColumnLine @@ -2593,6 +2696,8 @@ def create_line_column( api_params['required'] = self._normalize_value(required) if default is not None: api_params['default'] = self._normalize_value(default) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2615,6 +2720,7 @@ def update_line_column( required: bool, default: Optional[List[List[Any]]] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnLine: """ Update a line column. Changing the `default` value will not update already existing rows. @@ -2633,6 +2739,8 @@ def update_line_column( 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 : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnLine @@ -2662,6 +2770,8 @@ def update_line_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2685,6 +2795,7 @@ def create_longtext_column( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnLongtext: """ Create a longtext column. @@ -2705,6 +2816,8 @@ def create_longtext_column( Is column an array? 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. + description : Optional[str] + Optional description for the column. Returns ------- ColumnLongtext @@ -2736,6 +2849,8 @@ def create_longtext_column( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2758,6 +2873,7 @@ def update_longtext_column( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnLongtext: """ Update a longtext column. Changing the `default` value will not update already existing rows. @@ -2776,6 +2892,8 @@ def update_longtext_column( Default value for column when not provided. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnLongtext @@ -2804,6 +2922,8 @@ def update_longtext_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2827,6 +2947,7 @@ def create_mediumtext_column( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnMediumtext: """ Create a mediumtext column. @@ -2847,6 +2968,8 @@ def create_mediumtext_column( Is column an array? 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. + description : Optional[str] + Optional description for the column. Returns ------- ColumnMediumtext @@ -2878,6 +3001,8 @@ def create_mediumtext_column( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -2900,6 +3025,7 @@ def update_mediumtext_column( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnMediumtext: """ Update a mediumtext column. Changing the `default` value will not update already existing rows. @@ -2918,6 +3044,8 @@ def update_mediumtext_column( Default value for column when not provided. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnMediumtext @@ -2946,6 +3074,8 @@ def update_mediumtext_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -2967,6 +3097,7 @@ def create_point_column( key: str, required: bool, default: Optional[List[float]] = None, + description: Optional[str] = None, ) -> ColumnPoint: """ Create a geometric point column. @@ -2983,6 +3114,8 @@ def create_point_column( Is column required? default : Optional[List[float]] Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + description : Optional[str] + Optional description for the column. Returns ------- ColumnPoint @@ -3010,6 +3143,8 @@ def create_point_column( api_params['required'] = self._normalize_value(required) if default is not None: api_params['default'] = self._normalize_value(default) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3032,6 +3167,7 @@ def update_point_column( required: bool, default: Optional[List[float]] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnPoint: """ Update a point column. Changing the `default` value will not update already existing rows. @@ -3050,6 +3186,8 @@ def update_point_column( 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 : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnPoint @@ -3079,6 +3217,8 @@ def update_point_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3100,6 +3240,7 @@ def create_polygon_column( key: str, required: bool, default: Optional[List[List[Any]]] = None, + description: Optional[str] = None, ) -> ColumnPolygon: """ Create a geometric polygon column. @@ -3116,6 +3257,8 @@ def create_polygon_column( Is column required? default : Optional[List[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. + description : Optional[str] + Optional description for the column. Returns ------- ColumnPolygon @@ -3143,6 +3286,8 @@ def create_polygon_column( api_params['required'] = self._normalize_value(required) if default is not None: api_params['default'] = self._normalize_value(default) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3165,6 +3310,7 @@ def update_polygon_column( required: bool, default: Optional[List[List[Any]]] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnPolygon: """ Update a polygon column. Changing the `default` value will not update already existing rows. @@ -3183,6 +3329,8 @@ def update_polygon_column( 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 : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnPolygon @@ -3212,6 +3360,8 @@ def update_polygon_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3236,6 +3386,7 @@ def create_relationship_column( key: Optional[str] = None, two_way_key: Optional[str] = None, on_delete: Optional[RelationMutate] = None, + description: Optional[str] = None, ) -> ColumnRelationship: """ Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). @@ -3258,6 +3409,8 @@ def create_relationship_column( Two Way Column Key. on_delete : Optional[RelationMutate] Delete constraint. Possible values are: cascade, restrict, setNull. + description : Optional[str] + Optional description for the column. Returns ------- ColumnRelationship @@ -3291,6 +3444,8 @@ def create_relationship_column( api_params['twoWayKey'] = self._normalize_value(two_way_key) if on_delete is not None: api_params['onDelete'] = self._normalize_value(on_delete) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3312,6 +3467,7 @@ def update_relationship_column( key: str, on_delete: Optional[RelationMutate] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnRelationship: """ Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). @@ -3328,6 +3484,8 @@ def update_relationship_column( Delete constraint. Possible values are: cascade, restrict, setNull. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnRelationship @@ -3354,6 +3512,8 @@ def update_relationship_column( api_params['onDelete'] = self._normalize_value(on_delete) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3379,6 +3539,7 @@ def create_string_column( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnString: """ Create a string column. @@ -3403,6 +3564,8 @@ def create_string_column( Is column an array? 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. + description : Optional[str] + Optional description for the column. Returns ------- ColumnString @@ -3437,6 +3600,8 @@ def create_string_column( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3461,6 +3626,7 @@ def update_string_column( default: Optional[str], size: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnString: """ Update a string column. Changing the `default` value will not update already existing rows. @@ -3483,6 +3649,8 @@ def update_string_column( Maximum size of the string column. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnString @@ -3513,6 +3681,8 @@ def update_string_column( api_params['size'] = self._normalize_value(size) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3536,6 +3706,7 @@ def create_text_column( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnText: """ Create a text column. @@ -3556,6 +3727,8 @@ def create_text_column( Is column an array? 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. + description : Optional[str] + Optional description for the column. Returns ------- ColumnText @@ -3587,6 +3760,8 @@ def create_text_column( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3609,6 +3784,7 @@ def update_text_column( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnText: """ Update a text column. Changing the `default` value will not update already existing rows. @@ -3627,6 +3803,8 @@ def update_text_column( Default value for column when not provided. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnText @@ -3655,6 +3833,8 @@ def update_text_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3677,6 +3857,7 @@ def create_url_column( required: bool, default: Optional[str] = None, array: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnUrl: """ Create a URL column. @@ -3695,6 +3876,8 @@ def create_url_column( Default value for column when not provided. Cannot be set when column is required. array : Optional[bool] Is column an array? + description : Optional[str] + Optional description for the column. Returns ------- ColumnUrl @@ -3724,6 +3907,8 @@ def create_url_column( api_params['default'] = self._normalize_value(default) if array is not None: api_params['array'] = self._normalize_value(array) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3746,6 +3931,7 @@ def update_url_column( required: bool, default: Optional[str], new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnUrl: """ Update an url column. Changing the `default` value will not update already existing rows. @@ -3764,6 +3950,8 @@ def update_url_column( Default value for column when not provided. Cannot be set when column is required. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnUrl @@ -3792,6 +3980,8 @@ def update_url_column( api_params['default'] = self._normalize_value(default) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -3816,6 +4006,7 @@ def create_varchar_column( default: Optional[str] = None, array: Optional[bool] = None, encrypt: Optional[bool] = None, + description: Optional[str] = None, ) -> ColumnVarchar: """ Create a varchar column. @@ -3838,6 +4029,8 @@ def create_varchar_column( Is column an array? 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. + description : Optional[str] + Optional description for the column. Returns ------- ColumnVarchar @@ -3872,6 +4065,8 @@ def create_varchar_column( api_params['array'] = self._normalize_value(array) if encrypt is not None: api_params['encrypt'] = self._normalize_value(encrypt) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -3895,6 +4090,7 @@ def update_varchar_column( default: Optional[str], size: Optional[float] = None, new_key: Optional[str] = None, + description: Optional[str] = None, ) -> ColumnVarchar: """ Update a varchar column. Changing the `default` value will not update already existing rows. @@ -3915,6 +4111,8 @@ def update_varchar_column( Maximum size of the varchar column. new_key : Optional[str] New Column Key. + description : Optional[str] + Optional description for the column. Returns ------- ColumnVarchar @@ -3945,6 +4143,8 @@ def update_varchar_column( api_params['size'] = self._normalize_value(size) if new_key is not None: api_params['newKey'] = self._normalize_value(new_key) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'patch', @@ -4204,6 +4404,7 @@ def create_index( columns: List[str], orders: Optional[List[OrderBy]] = None, lengths: Optional[List[float]] = None, + description: Optional[str] = None, ) -> ColumnIndex: """ Creates an index on the columns listed. Your index should include all the columns you will query in a single request. @@ -4225,6 +4426,8 @@ def create_index( Array of index orders. Maximum of 100 orders are allowed. lengths : Optional[List[float]] Length of index. Maximum of 100 + description : Optional[str] + Optional description for the index. Returns ------- ColumnIndex @@ -4257,6 +4460,8 @@ def create_index( api_params['orders'] = self._normalize_value(orders) if lengths is not None: api_params['lengths'] = self._normalize_value(lengths) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -4389,6 +4594,8 @@ def list_rows( """ Get a list of all the user's rows in a given table. You can use the query params to filter your results. + Rows returned by aggregate, groupBy or distinct queries hold only the columns they select, group or aggregate, typed as a row types them, with a joined column named by its join alias (`alias.column`). The response omits their `$id`, `$sequence`, `$createdAt`, `$updatedAt`, `$permissions`, `$databaseId` and `$tableId` unless they select or group it, and those of a right or full join row that no row of this table matched. SDK row models fill omitted system columns with empty values. + Parameters ---------- database_id : str @@ -4402,7 +4609,7 @@ def list_rows( total : Optional[bool] When set to false, the total count returned will be 0 and will not be calculated. ttl : Optional[float] - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). model_type : Type[T], optional Pydantic model class for the user-defined data. Defaults to dict for backward compatibility. @@ -4770,6 +4977,77 @@ def delete_rows( return RowList.with_data(response, model_type) + def create_query( + self, + database_id: str, + table_id: str, + queries: Optional[List[str]] = None, + transaction_id: Optional[str] = None, + total: Optional[bool] = None, + ttl: Optional[float] = None, + model_type: Type[T] = dict, + ) -> RowList[T]: + """ + Get a list of all the user's rows in a given table using a POST request. This behaves identically to the list rows endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + + Parameters + ---------- + database_id : str + 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 : 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 : Optional[str] + Transaction ID to read uncommitted changes within the transaction. + total : Optional[bool] + When set to false, the total count returned will be 0 and will not be calculated. + ttl : Optional[float] + TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). + model_type : Type[T], optional + Pydantic model class for the user-defined data. Defaults to dict for backward compatibility. + + Returns + ------- + RowList[T] + API response as a typed Pydantic model + + Raises + ------ + AppwriteException + If API request fails + """ + + api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows/query' + api_params = {} + if database_id is None or database_id == '': + raise AppwriteException('Missing required parameter: "database_id"') + if table_id is None or table_id == '': + raise AppwriteException('Missing required parameter: "table_id"') + api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id))) + api_path = api_path.replace('{tableId}', str(self._normalize_value(table_id))) + if queries is not None: + api_params['queries'] = self._normalize_value(queries) + if transaction_id is not None: + api_params['transactionId'] = self._normalize_value(transaction_id) + if total is not None: + api_params['total'] = self._normalize_value(total) + if ttl is not None: + api_params['ttl'] = self._normalize_value(ttl) + + response = self.client.call( + 'post', + api_path, + { + 'X-Appwrite-Project': self.client.get_config('project'), + 'content-type': 'application/json', + 'accept': 'application/json', + }, + api_params, + ) + + return RowList.with_data(response, model_type) + def get_row( self, database_id: str, diff --git a/appwrite/services/vectors_db.py b/appwrite/services/vectors_db.py index 1cea0603..eda5f00d 100644 --- a/appwrite/services/vectors_db.py +++ b/appwrite/services/vectors_db.py @@ -78,6 +78,7 @@ def create( database_id: str, name: str, enabled: Optional[bool] = None, + description: Optional[str] = None, specification: Optional[str] = None, replicas: Optional[float] = None, sync_mode: Optional[str] = None, @@ -93,6 +94,8 @@ def create( Database name. Max length: 128 chars. 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. + description : Optional[str] + Optional description for the database. specification : Optional[str] Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. replicas : Optional[float] @@ -120,6 +123,8 @@ def create( api_params['name'] = self._normalize_value(name) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) if specification is not None: api_params['specification'] = self._normalize_value(specification) if replicas is not None: @@ -478,6 +483,7 @@ def update( database_id: str, name: str, enabled: Optional[bool] = None, + description: Optional[str] = None, specification: Optional[str] = None, replicas: Optional[float] = None, sync_mode: Optional[str] = None, @@ -493,6 +499,8 @@ def update( Database name. Max length: 128 chars. 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. + description : Optional[str] + Optional description for the database. specification : Optional[str] Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. replicas : Optional[float] @@ -520,6 +528,8 @@ def update( api_params['name'] = self._normalize_value(name) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) if specification is not None: api_params['specification'] = self._normalize_value(specification) if replicas is not None: @@ -645,6 +655,7 @@ def create_collection( permissions: Optional[List[str]] = None, document_security: Optional[bool] = None, enabled: Optional[bool] = None, + description: Optional[str] = None, ) -> VectorsdbCollection: """ 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#documentsDBCreateCollection) API or directly from your database console. @@ -665,6 +676,8 @@ def create_collection( 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 : 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. + description : Optional[str] + Optional description for the collection. Returns ------- VectorsdbCollection @@ -696,6 +709,8 @@ def create_collection( api_params['documentSecurity'] = self._normalize_value(document_security) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -765,6 +780,7 @@ def update_collection( permissions: Optional[List[str]] = None, document_security: Optional[bool] = None, enabled: Optional[bool] = None, + description: Optional[str] = None, ) -> VectorsdbCollection: """ Update a collection by its unique ID. @@ -785,6 +801,8 @@ def update_collection( 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 : 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. + description : Optional[str] + Optional description for the collection. Returns ------- VectorsdbCollection @@ -815,6 +833,8 @@ def update_collection( api_params['documentSecurity'] = self._normalize_value(document_security) if enabled is not None: api_params['enabled'] = self._normalize_value(enabled) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', @@ -1674,6 +1694,7 @@ def create_index( attributes: List[str], orders: Optional[List[OrderBy]] = None, lengths: Optional[List[float]] = None, + description: Optional[str] = None, ) -> Index: """ Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. @@ -1695,6 +1716,8 @@ def create_index( Array of index orders. Maximum of 100 orders are allowed. lengths : Optional[List[float]] Length of index. Maximum of 100 + description : Optional[str] + Optional description for the index. Returns ------- Index @@ -1727,6 +1750,8 @@ def create_index( api_params['orders'] = self._normalize_value(orders) if lengths is not None: api_params['lengths'] = self._normalize_value(lengths) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', diff --git a/appwrite/services/webhooks.py b/appwrite/services/webhooks.py index 6caa4745..41f4ef49 100644 --- a/appwrite/services/webhooks.py +++ b/appwrite/services/webhooks.py @@ -67,6 +67,7 @@ def create( auth_username: Optional[str] = None, auth_password: Optional[str] = None, secret: Optional[str] = None, + description: Optional[str] = None, ) -> Webhook: """ Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. @@ -91,6 +92,8 @@ def create( Webhook HTTP password. Max length: 2048 chars. secret : Optional[str] Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. + description : Optional[str] + Optional description for the webhook. Returns ------- Webhook @@ -126,6 +129,8 @@ def create( api_params['authPassword'] = self._normalize_value(auth_password) if secret is not None: api_params['secret'] = self._normalize_value(secret) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'post', @@ -190,6 +195,7 @@ def update( tls: Optional[bool] = None, auth_username: Optional[str] = None, auth_password: Optional[str] = None, + description: Optional[str] = None, ) -> Webhook: """ Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. @@ -212,6 +218,8 @@ def update( Webhook HTTP user. Max length: 255 chars. auth_password : Optional[str] Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled. + description : Optional[str] + Optional description for the webhook. Returns ------- Webhook @@ -245,6 +253,8 @@ def update( api_params['authUsername'] = self._normalize_value(auth_username) if auth_password is not None: api_params['authPassword'] = self._normalize_value(auth_password) + if description is not None: + api_params['description'] = self._normalize_value(description) response = self.client.call( 'put', diff --git a/docs/examples/account/list-memberships.md b/docs/examples/account/list-memberships.md new file mode 100644 index 00000000..2238f602 --- /dev/null +++ b/docs/examples/account/list-memberships.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import MembershipList + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: MembershipList = account.list_memberships( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index 17f3b67d..14dd6f7d 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key activities = Activities(client) result: ActivityEventList = activities.list_events( - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md index 3d179923..42674b17 100644 --- a/docs/examples/backups/list-archives.md +++ b/docs/examples/backups/list-archives.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key backups = Backups(client) result: BackupArchiveList = backups.list_archives( - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md index bcfb6734..65bc8c9f 100644 --- a/docs/examples/backups/list-policies.md +++ b/docs/examples/backups/list-policies.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key backups = Backups(client) result: BackupPolicyList = backups.list_policies( - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md index c353a50e..4556933b 100644 --- a/docs/examples/backups/list-restorations.md +++ b/docs/examples/backups/list-restorations.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key backups = Backups(client) result: BackupRestorationList = backups.list_restorations( - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index e55ab28c..18025ca5 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -18,7 +18,8 @@ result: AttributeBigint = databases.create_big_int_attribute( min = 0, # optional max = 1000000, # optional default = 0, # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 7c66b322..5a9a946b 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -16,7 +16,8 @@ result: AttributeBoolean = databases.create_boolean_attribute( key = '', required = False, default = False, # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 7e9afa0f..655144e3 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -20,7 +20,8 @@ result: Collection = databases.create_collection( document_security = False, # optional enabled = False, # optional attributes = [], # optional - indexes = [] # optional + indexes = [], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index d6e5a437..4e4c3702 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -16,7 +16,8 @@ result: AttributeDatetime = databases.create_datetime_attribute( key = '', required = False, default = '2020-10-15T06:38:00.000+00:00', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 8330bb9a..4745d038 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -16,7 +16,8 @@ result: AttributeEmail = databases.create_email_attribute( key = '', required = False, default = 'email@example.com', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 4710819f..d6c6f6de 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -17,7 +17,8 @@ result: AttributeEnum = databases.create_enum_attribute( elements = ["active", "inactive"], required = False, default = 'active', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index e7155081..dd76cec2 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -18,7 +18,8 @@ result: AttributeFloat = databases.create_float_attribute( min = 0, # optional max = 100, # optional default = 10.5, # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 8733b72a..8102336b 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -19,7 +19,8 @@ result: Index = databases.create_index( type = DatabasesIndexType.KEY, attributes = ["username"], orders = [OrderBy.ASC], # optional - lengths = [] # optional + lengths = [], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index c46e2295..f89a52d2 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -18,7 +18,8 @@ result: AttributeInteger = databases.create_integer_attribute( min = 0, # optional max = 100, # optional default = 10, # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 34542fa9..19f18397 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -16,7 +16,8 @@ result: AttributeIp = databases.create_ip_attribute( key = '', required = False, default = '192.0.2.0', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index 6745498a..77f1fa6d 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -15,7 +15,8 @@ result: AttributeLine = databases.create_line_attribute( collection_id = '', key = '', required = False, - default = [[1, 2], [3, 4], [5, 6]] # optional + default = [[1, 2], [3, 4], [5, 6]], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index 70b0eb48..a8cdecc5 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -17,7 +17,8 @@ result: AttributeLongtext = databases.create_longtext_attribute( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index cf3011ac..68a04431 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -17,7 +17,8 @@ result: AttributeMediumtext = databases.create_mediumtext_attribute( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index a3d12715..91859e78 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -15,7 +15,8 @@ result: AttributePoint = databases.create_point_attribute( collection_id = '', key = '', required = False, - default = [1, 2] # optional + default = [1, 2], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 4e6145f5..6651bd3e 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -15,7 +15,8 @@ result: AttributePolygon = databases.create_polygon_attribute( collection_id = '', key = '', required = False, - default = [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-query.md b/docs/examples/databases/create-query.md new file mode 100644 index 00000000..917b4254 --- /dev/null +++ b/docs/examples/databases/create-query.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result: DocumentList = databases.create_query( + database_id = '', + collection_id = '', + queries = [], # optional + transaction_id = '', # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 48821cac..a04c6e1b 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -20,7 +20,8 @@ result: AttributeRelationship = databases.create_relationship_attribute( two_way = False, # optional key = '', # optional two_way_key = '', # optional - on_delete = RelationMutate.CASCADE # optional + on_delete = RelationMutate.CASCADE, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 84089243..17d8bae1 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -18,7 +18,8 @@ result: AttributeString = databases.create_string_attribute( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index 195650ee..0271b051 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -17,7 +17,8 @@ result: AttributeText = databases.create_text_attribute( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 2fdaadac..b1b823cf 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -16,7 +16,8 @@ result: AttributeUrl = databases.create_url_attribute( key = '', required = False, default = 'https://example.com', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index b0a32221..4ebe389a 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -18,7 +18,8 @@ result: AttributeVarchar = databases.create_varchar_attribute( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 68a5b374..6d8b67bc 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -13,7 +13,8 @@ databases = Databases(client) result: Database = databases.create( database_id = '', name = '', - enabled = False # optional + enabled = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md index 84ecb942..c6390c47 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -18,7 +18,8 @@ result: AttributeBigint = databases.update_big_int_attribute( default = 0, min = 0, # optional max = 1000000, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 26ac8023..cf61992a 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -16,7 +16,8 @@ result: AttributeBoolean = databases.update_boolean_attribute( key = '', required = False, default = False, - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 85d50789..70599c47 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -19,7 +19,8 @@ result: Collection = databases.update_collection( permissions = [Permission.read(Role.any())], # optional document_security = False, # optional enabled = False, # optional - purge = False # optional + purge = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index cf80c1d7..8c93de1f 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -16,7 +16,8 @@ result: AttributeDatetime = databases.update_datetime_attribute( key = '', required = False, default = '2020-10-15T06:38:00.000+00:00', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 6a6b2d52..0317082f 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -16,7 +16,8 @@ result: AttributeEmail = databases.update_email_attribute( key = '', required = False, default = 'email@example.com', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 822f712c..fe9d8fad 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -17,7 +17,8 @@ result: AttributeEnum = databases.update_enum_attribute( elements = ["active", "inactive"], required = False, default = 'active', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 4497a4a5..5fc8bf32 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -18,7 +18,8 @@ result: AttributeFloat = databases.update_float_attribute( default = 10.5, min = 0, # optional max = 100, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 61fe8bcc..88bc6301 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -18,7 +18,8 @@ result: AttributeInteger = databases.update_integer_attribute( default = 10, min = 0, # optional max = 100, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 89945ee3..822f58a9 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -16,7 +16,8 @@ result: AttributeIp = databases.update_ip_attribute( key = '', required = False, default = '192.0.2.0', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 96d6b4e6..5bda52b3 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -16,7 +16,8 @@ result: AttributeLine = databases.update_line_attribute( key = '', required = False, default = [[1, 2], [3, 4], [5, 6]], # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index d039a6e0..38671d67 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -16,7 +16,8 @@ result: AttributeLongtext = databases.update_longtext_attribute( key = '', required = False, default = 'Hello World', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index dc960fc6..ff2364b6 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -16,7 +16,8 @@ result: AttributeMediumtext = databases.update_mediumtext_attribute( key = '', required = False, default = 'Hello World', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index bf6a94d8..bf91ea2d 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -16,7 +16,8 @@ result: AttributePoint = databases.update_point_attribute( key = '', required = False, default = [1, 2], # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index 2dd1194c..2a8d94b0 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -16,7 +16,8 @@ result: AttributePolygon = databases.update_polygon_attribute( key = '', required = False, default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index cc328d63..c39fa987 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -16,7 +16,8 @@ result: AttributeRelationship = databases.update_relationship_attribute( collection_id = '', key = '', on_delete = RelationMutate.CASCADE, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index bfe14df1..2989a4cc 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -17,7 +17,8 @@ result: AttributeString = databases.update_string_attribute( required = False, default = 'Hello World', size = 1, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 01f66d13..c28dd7f0 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -16,7 +16,8 @@ result: AttributeText = databases.update_text_attribute( key = '', required = False, default = 'Hello World', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 9f05a4a4..4f772b97 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -16,7 +16,8 @@ result: AttributeUrl = databases.update_url_attribute( key = '', required = False, default = 'https://example.com', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index b844a712..5fb7a73f 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -17,7 +17,8 @@ result: AttributeVarchar = databases.update_varchar_attribute( required = False, default = 'Hello World', size = 1, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 73458d4f..ae7b33eb 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -13,7 +13,8 @@ databases = Databases(client) result: Database = databases.update( database_id = '', name = '', # optional - enabled = False # optional + enabled = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md index b717460f..da77bced 100644 --- a/docs/examples/documentsdb/create-collection.md +++ b/docs/examples/documentsdb/create-collection.md @@ -20,7 +20,8 @@ result: Collection = documents_db.create_collection( document_security = False, # optional enabled = False, # optional attributes = [], # optional - indexes = [] # optional + indexes = [], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md index 51eea435..4e9361cd 100644 --- a/docs/examples/documentsdb/create-index.md +++ b/docs/examples/documentsdb/create-index.md @@ -19,7 +19,8 @@ result: Index = documents_db.create_index( type = DocumentsDBIndexType.KEY, attributes = ["username"], orders = [OrderBy.ASC], # optional - lengths = [] # optional + lengths = [], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/documentsdb/create-query.md b/docs/examples/documentsdb/create-query.md new file mode 100644 index 00000000..80f1298c --- /dev/null +++ b/docs/examples/documentsdb/create-query.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: DocumentList = documents_db.create_query( + database_id = '', + collection_id = '', + queries = [], # optional + transaction_id = '', # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md index b8da9d4b..9d424527 100644 --- a/docs/examples/documentsdb/create.md +++ b/docs/examples/documentsdb/create.md @@ -14,6 +14,7 @@ result: Database = documents_db.create( database_id = '', name = '', enabled = False, # optional + description = '', # optional specification = 'serverless', # optional replicas = 0, # optional sync_mode = 'async' # optional diff --git a/docs/examples/documentsdb/update-collection.md b/docs/examples/documentsdb/update-collection.md index 955fb28f..0c3d010f 100644 --- a/docs/examples/documentsdb/update-collection.md +++ b/docs/examples/documentsdb/update-collection.md @@ -19,7 +19,8 @@ result: Collection = documents_db.update_collection( permissions = [Permission.read(Role.any())], # optional document_security = False, # optional enabled = False, # optional - purge = False # optional + purge = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/documentsdb/update.md b/docs/examples/documentsdb/update.md index 03d7e861..3cd8bea3 100644 --- a/docs/examples/documentsdb/update.md +++ b/docs/examples/documentsdb/update.md @@ -14,6 +14,7 @@ result: Database = documents_db.update( database_id = '', name = '', enabled = False, # optional + description = '', # optional specification = 'serverless', # optional replicas = 0, # optional sync_mode = 'async' # optional diff --git a/docs/examples/domains/list-records.md b/docs/examples/domains/list-records.md index 9d40d255..94275a49 100644 --- a/docs/examples/domains/list-records.md +++ b/docs/examples/domains/list-records.md @@ -12,7 +12,8 @@ domains = Domains(client) result: DnsRecordsList = domains.list_records( domain_id = '', - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/domains/list.md b/docs/examples/domains/list.md index f0d15a75..602fa974 100644 --- a/docs/examples/domains/list.md +++ b/docs/examples/domains/list.md @@ -12,7 +12,8 @@ domains = Domains(client) result: DomainsList = domains.list( queries = [], # optional - search = '' # optional + search = '', # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index da323f97..6f596772 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -15,7 +15,8 @@ result: Variable = functions.create_variable( variable_id = '', key = '', value = '', - secret = False # optional + secret = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 46652c4a..4cc28c82 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -35,7 +35,8 @@ result: Function = functions.create( build_specification = 's-1vcpu-512mb', # optional runtime_specification = 's-1vcpu-512mb', # optional deployment_retention = 0, # optional - interval = 0 # optional + interval = 0, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 6aa2f98c..2368f0d2 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -15,7 +15,8 @@ result: Variable = functions.update_variable( variable_id = '', key = '', # optional value = '', # optional - secret = False # optional + secret = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 425158bb..2efde2fb 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -36,6 +36,7 @@ result: Function = functions.update( runtime_specification = 's-1vcpu-512mb', # optional deployment_retention = 0, # optional interval = 0, # optional + description = '', # optional email_enabled = False # optional ) diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index c8f278dd..6cf8f14d 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -24,7 +24,8 @@ result: Message = messaging.create_email( html = False, # optional scheduled_at = '2020-10-15T06:38:00.000+00:00', # optional reply_to_email = 'email@example.com', # optional - reply_to_name = '' # optional + reply_to_name = '', # optional + emails = [] # optional ) print(result.model_dump()) diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 93388456..6e45f73a 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -15,7 +15,8 @@ result: Topic = messaging.create_topic( name = '', subscribe = ["any"], # optional qos = 0, # optional - expiry = 0 # optional + expiry = 0, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index bf8c5ba8..38a59902 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -24,7 +24,8 @@ result: Message = messaging.update_email( scheduled_at = '2020-10-15T06:38:00.000+00:00', # optional attachments = [], # optional reply_to_email = 'email@example.com', # optional - reply_to_name = '' # optional + reply_to_name = '', # optional + emails = [] # optional ) print(result.model_dump()) diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 4870903a..65213a5c 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -15,7 +15,8 @@ result: Topic = messaging.update_topic( name = '', # optional subscribe = ["any"], # optional qos = 0, # optional - expiry = 0 # optional + expiry = 0, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/mongo/list-backup-policies.md b/docs/examples/mongo/list-backup-policies.md index c023cc1d..e79ffd33 100644 --- a/docs/examples/mongo/list-backup-policies.md +++ b/docs/examples/mongo/list-backup-policies.md @@ -12,7 +12,8 @@ mongo = Mongo(client) result: BackupPolicyList = mongo.list_backup_policies( database_id = '', - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/mongo/list-backups.md b/docs/examples/mongo/list-backups.md index bf896520..86b6bc3f 100644 --- a/docs/examples/mongo/list-backups.md +++ b/docs/examples/mongo/list-backups.md @@ -12,7 +12,8 @@ mongo = Mongo(client) result: DedicatedDatabaseBackupList = mongo.list_backups( database_id = '', - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/mongo/list.md b/docs/examples/mongo/list.md index b956cebe..c31a18c3 100644 --- a/docs/examples/mongo/list.md +++ b/docs/examples/mongo/list.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key mongo = Mongo(client) result: DedicatedDatabaseList = mongo.list( - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/mysql/list-backup-policies.md b/docs/examples/mysql/list-backup-policies.md index 0b5328d4..0297517f 100644 --- a/docs/examples/mysql/list-backup-policies.md +++ b/docs/examples/mysql/list-backup-policies.md @@ -12,7 +12,8 @@ mysql = Mysql(client) result: BackupPolicyList = mysql.list_backup_policies( database_id = '', - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/mysql/list-backups.md b/docs/examples/mysql/list-backups.md index 5a533951..0dc15e5b 100644 --- a/docs/examples/mysql/list-backups.md +++ b/docs/examples/mysql/list-backups.md @@ -12,7 +12,8 @@ mysql = Mysql(client) result: DedicatedDatabaseBackupList = mysql.list_backups( database_id = '', - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/mysql/list.md b/docs/examples/mysql/list.md index 865e474f..b5aba207 100644 --- a/docs/examples/mysql/list.md +++ b/docs/examples/mysql/list.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key mysql = Mysql(client) result: DedicatedDatabaseList = mysql.list( - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/organization/update-project-key.md b/docs/examples/organization/update-project-key.md index 7f01ddf5..ea537952 100644 --- a/docs/examples/organization/update-project-key.md +++ b/docs/examples/organization/update-project-key.md @@ -16,7 +16,8 @@ result: Key = organization.update_project_key( key_id = '', name = '', scopes = [ProjectKeyScopes.USERS_READ], - expire = '2020-10-15T06:38:00.000+00:00' # optional + expire = '2020-10-15T06:38:00.000+00:00', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/postgresql/list-backup-policies.md b/docs/examples/postgresql/list-backup-policies.md index c9000c59..2c10f860 100644 --- a/docs/examples/postgresql/list-backup-policies.md +++ b/docs/examples/postgresql/list-backup-policies.md @@ -12,7 +12,8 @@ postgresql = Postgresql(client) result: BackupPolicyList = postgresql.list_backup_policies( database_id = '', - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/postgresql/list-backups.md b/docs/examples/postgresql/list-backups.md index 85622373..ea05800f 100644 --- a/docs/examples/postgresql/list-backups.md +++ b/docs/examples/postgresql/list-backups.md @@ -12,7 +12,8 @@ postgresql = Postgresql(client) result: DedicatedDatabaseBackupList = postgresql.list_backups( database_id = '', - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/postgresql/list.md b/docs/examples/postgresql/list.md index fae83f96..41d53428 100644 --- a/docs/examples/postgresql/list.md +++ b/docs/examples/postgresql/list.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key postgresql = Postgresql(client) result: DedicatedDatabaseList = postgresql.list( - queries = [] # optional + queries = [], # optional + total = False # optional ) print(result.model_dump()) diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index 668e3548..4b73077c 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -14,7 +14,8 @@ result: Variable = project.create_variable( variable_id = '', key = '', value = '', - secret = False # optional + secret = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index a8aa7ccf..12faf365 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -15,7 +15,8 @@ result: Key = project.update_key( key_id = '', name = '', scopes = [ProjectKeyScopes.USERS_READ], - expire = '2020-10-15T06:38:00.000+00:00' # optional + expire = '2020-10-15T06:38:00.000+00:00', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md index 93e652be..53a8d71e 100644 --- a/docs/examples/project/update-password-dictionary-policy.md +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key project = Project(client) result: ProjectModel = project.update_password_dictionary_policy( - enabled = False + enabled = False, + deny_list = [] # optional ) print(result.model_dump()) diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md index 507bdac4..d9587b6a 100644 --- a/docs/examples/project/update-password-personal-data-policy.md +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -11,7 +11,8 @@ client.set_key('') # Your secret API key project = Project(client) result: ProjectModel = project.update_password_personal_data_policy( - enabled = False + enabled = False, + deny_list = [] # optional ) print(result.model_dump()) diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 3f4dac0f..abe4ae74 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -14,7 +14,8 @@ result: Variable = project.update_variable( variable_id = '', key = '', # optional value = '', # optional - secret = False # optional + secret = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index ca6d9e57..7174c1d1 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -15,7 +15,8 @@ result: Variable = sites.create_variable( variable_id = '', key = '', value = '', - secret = False # optional + secret = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 4d8e03bc..c993e6fb 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -38,7 +38,8 @@ result: Site = sites.create( build_specification = 's-1vcpu-512mb', # optional runtime_specification = 's-1vcpu-512mb', # optional deployment_retention = 0, # optional - scopes = [ProjectKeyScopes.PROJECT_READ] # optional + scopes = [ProjectKeyScopes.PROJECT_READ], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 637d2220..9293b47d 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -15,7 +15,8 @@ result: Variable = sites.update_variable( variable_id = '', key = '', # optional value = '', # optional - secret = False # optional + secret = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 59ac85ce..f6f5bbdd 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -38,7 +38,8 @@ result: Site = sites.update( build_specification = 's-1vcpu-512mb', # optional runtime_specification = 's-1vcpu-512mb', # optional deployment_retention = 0, # optional - scopes = [ProjectKeyScopes.PROJECT_READ] # optional + scopes = [ProjectKeyScopes.PROJECT_READ], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 76ec2f0e..5800deee 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -24,7 +24,9 @@ result: Bucket = storage.create_bucket( compression = Compression.NONE, # optional encryption = False, # optional antivirus = False, # optional - transformations = False # optional + transformations = False, # optional + description = '', # optional + strip_metadata = False # optional ) print(result.model_dump()) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index c9222517..b7906a36 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -24,7 +24,9 @@ result: Bucket = storage.update_bucket( compression = Compression.NONE, # optional encryption = False, # optional antivirus = False, # optional - transformations = False # optional + transformations = False, # optional + description = '', # optional + strip_metadata = False # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index cff66960..2ebb4287 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -18,7 +18,8 @@ result: ColumnBigint = tables_db.create_big_int_column( min = 0, # optional max = 1000000, # optional default = 0, # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index b325095d..c5b62657 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -16,7 +16,8 @@ result: ColumnBoolean = tables_db.create_boolean_column( key = '', required = False, default = False, # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index a4a565d0..30463a6b 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -16,7 +16,8 @@ result: ColumnDatetime = tables_db.create_datetime_column( key = '', required = False, default = '2020-10-15T06:38:00.000+00:00', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index 7315689c..cae71254 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -16,7 +16,8 @@ result: ColumnEmail = tables_db.create_email_column( key = '', required = False, default = 'email@example.com', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 3e4cb1b9..645aa8fb 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -17,7 +17,8 @@ result: ColumnEnum = tables_db.create_enum_column( elements = ["active", "inactive"], required = False, default = 'active', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 0edd6a26..b57def0a 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -18,7 +18,8 @@ result: ColumnFloat = tables_db.create_float_column( min = 0, # optional max = 100, # optional default = 10.5, # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 8ecf506d..f953466f 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -19,7 +19,8 @@ result: ColumnIndex = tables_db.create_index( type = TablesDBIndexType.KEY, columns = ["username"], orders = [OrderBy.ASC], # optional - lengths = [] # optional + lengths = [], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index bbe76889..8b989252 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -18,7 +18,8 @@ result: ColumnInteger = tables_db.create_integer_column( min = 0, # optional max = 100, # optional default = 10, # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index a0a47e67..9c510780 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -16,7 +16,8 @@ result: ColumnIp = tables_db.create_ip_column( key = '', required = False, default = '192.0.2.0', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 2fc64c4f..e32562f8 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -15,7 +15,8 @@ result: ColumnLine = tables_db.create_line_column( table_id = '', key = '', required = False, - default = [[1, 2], [3, 4], [5, 6]] # optional + default = [[1, 2], [3, 4], [5, 6]], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 1438ff8a..57ed86db 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -17,7 +17,8 @@ result: ColumnLongtext = tables_db.create_longtext_column( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index 6729b329..261d801a 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -17,7 +17,8 @@ result: ColumnMediumtext = tables_db.create_mediumtext_column( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 17c1e447..e1fdb9e7 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -15,7 +15,8 @@ result: ColumnPoint = tables_db.create_point_column( table_id = '', key = '', required = False, - default = [1, 2] # optional + default = [1, 2], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index 86fca304..08c2c1af 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -15,7 +15,8 @@ result: ColumnPolygon = tables_db.create_polygon_column( table_id = '', key = '', required = False, - default = [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-query.md b/docs/examples/tablesdb/create-query.md new file mode 100644 index 00000000..cdc0ddd5 --- /dev/null +++ b/docs/examples/tablesdb/create-query.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import RowList + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result: RowList = tables_db.create_query( + database_id = '', + table_id = '', + queries = [], # optional + transaction_id = '', # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 32fc4ba1..1287da28 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -20,7 +20,8 @@ result: ColumnRelationship = tables_db.create_relationship_column( two_way = False, # optional key = '', # optional two_way_key = '', # optional - on_delete = RelationMutate.CASCADE # optional + on_delete = RelationMutate.CASCADE, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index 85decfde..27a96af2 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -18,7 +18,8 @@ result: ColumnString = tables_db.create_string_column( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 029fb281..5ddf3b99 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -20,7 +20,8 @@ result: Table = tables_db.create_table( row_security = False, # optional enabled = False, # optional columns = [], # optional - indexes = [] # optional + indexes = [], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index f3c8df3d..f7c63339 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -17,7 +17,8 @@ result: ColumnText = tables_db.create_text_column( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index 4bfb858f..ae9a5ecc 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -16,7 +16,8 @@ result: ColumnUrl = tables_db.create_url_column( key = '', required = False, default = 'https://example.com', # optional - array = False # optional + array = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 2fb6338c..d181df49 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -18,7 +18,8 @@ result: ColumnVarchar = tables_db.create_varchar_column( required = False, default = 'Hello World', # optional array = False, # optional - encrypt = False # optional + encrypt = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index ca668875..ff89d119 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -14,6 +14,7 @@ result: Database = tables_db.create( database_id = '', name = '', enabled = False, # optional + description = '', # optional specification = 'serverless', # optional replicas = 0, # optional sync_mode = 'async' # optional diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md index f4e6e90d..76343d4c 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -18,7 +18,8 @@ result: ColumnBigint = tables_db.update_big_int_column( default = 0, min = 0, # optional max = 1000000, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 9352362c..8b2f0be8 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -16,7 +16,8 @@ result: ColumnBoolean = tables_db.update_boolean_column( key = '', required = False, default = False, - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index 70cd5754..10f3146e 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -16,7 +16,8 @@ result: ColumnDatetime = tables_db.update_datetime_column( key = '', required = False, default = '2020-10-15T06:38:00.000+00:00', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 94036baf..272d0c00 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -16,7 +16,8 @@ result: ColumnEmail = tables_db.update_email_column( key = '', required = False, default = 'email@example.com', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 0ac9ac91..41ca8bcf 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -17,7 +17,8 @@ result: ColumnEnum = tables_db.update_enum_column( elements = ["active", "inactive"], required = False, default = 'active', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 08e39be5..e851722f 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -18,7 +18,8 @@ result: ColumnFloat = tables_db.update_float_column( default = 10.5, min = 0, # optional max = 100, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index cd6831fc..6f7c7916 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -18,7 +18,8 @@ result: ColumnInteger = tables_db.update_integer_column( default = 10, min = 0, # optional max = 100, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index c3570fb1..f94638c3 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -16,7 +16,8 @@ result: ColumnIp = tables_db.update_ip_column( key = '', required = False, default = '192.0.2.0', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 052a12c0..8ef8353a 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -16,7 +16,8 @@ result: ColumnLine = tables_db.update_line_column( key = '', required = False, default = [[1, 2], [3, 4], [5, 6]], # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index 8e44bd03..154e7b36 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -16,7 +16,8 @@ result: ColumnLongtext = tables_db.update_longtext_column( key = '', required = False, default = 'Hello World', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 2412dc84..2c92bd4f 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -16,7 +16,8 @@ result: ColumnMediumtext = tables_db.update_mediumtext_column( key = '', required = False, default = 'Hello World', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 5368394e..a232c2e1 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -16,7 +16,8 @@ result: ColumnPoint = tables_db.update_point_column( key = '', required = False, default = [1, 2], # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index b7af58ae..1237ffe1 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -16,7 +16,8 @@ result: ColumnPolygon = tables_db.update_polygon_column( key = '', required = False, default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 67fb6063..3bc94157 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -16,7 +16,8 @@ result: ColumnRelationship = tables_db.update_relationship_column( table_id = '', key = '', on_delete = RelationMutate.CASCADE, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index f3375237..3dddf79b 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -17,7 +17,8 @@ result: ColumnString = tables_db.update_string_column( required = False, default = 'Hello World', size = 1, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index ee6bba02..e1d8ff90 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -19,7 +19,8 @@ result: Table = tables_db.update_table( permissions = [Permission.read(Role.any())], # optional row_security = False, # optional enabled = False, # optional - purge = False # optional + purge = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index 21e03944..b7999d41 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -16,7 +16,8 @@ result: ColumnText = tables_db.update_text_column( key = '', required = False, default = 'Hello World', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 2553957d..c4fcff52 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -16,7 +16,8 @@ result: ColumnUrl = tables_db.update_url_column( key = '', required = False, default = 'https://example.com', - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index 3f03b42f..88133183 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -17,7 +17,8 @@ result: ColumnVarchar = tables_db.update_varchar_column( required = False, default = 'Hello World', size = 1, # optional - new_key = '' # optional + new_key = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 7fc0c930..7b8b2225 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -14,6 +14,7 @@ result: Database = tables_db.update( database_id = '', name = '', # optional enabled = False, # optional + description = '', # optional specification = 'serverless', # optional replicas = 0, # optional sync_mode = 'async' # optional diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md index 6dcdeb24..6011be07 100644 --- a/docs/examples/vectorsdb/create-collection.md +++ b/docs/examples/vectorsdb/create-collection.md @@ -19,7 +19,8 @@ result: VectorsdbCollection = vectors_db.create_collection( dimension = 4, permissions = [Permission.read(Role.any())], # optional document_security = False, # optional - enabled = False # optional + enabled = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md index 71e650a6..a1fcd6f7 100644 --- a/docs/examples/vectorsdb/create-index.md +++ b/docs/examples/vectorsdb/create-index.md @@ -19,7 +19,8 @@ result: Index = vectors_db.create_index( type = VectorsDBIndexType.HNSW_EUCLIDEAN, attributes = ["embeddings"], orders = [OrderBy.ASC], # optional - lengths = [] # optional + lengths = [], # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md index a77a3a38..b133cb18 100644 --- a/docs/examples/vectorsdb/create.md +++ b/docs/examples/vectorsdb/create.md @@ -14,6 +14,7 @@ result: Database = vectors_db.create( database_id = '', name = '', enabled = False, # optional + description = '', # optional specification = 'serverless', # optional replicas = 0, # optional sync_mode = 'async' # optional diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md index 7093c0b2..e4c925e1 100644 --- a/docs/examples/vectorsdb/update-collection.md +++ b/docs/examples/vectorsdb/update-collection.md @@ -19,7 +19,8 @@ result: VectorsdbCollection = vectors_db.update_collection( dimension = 4, # optional permissions = [Permission.read(Role.any())], # optional document_security = False, # optional - enabled = False # optional + enabled = False, # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md index 23ae9429..25ee897b 100644 --- a/docs/examples/vectorsdb/update.md +++ b/docs/examples/vectorsdb/update.md @@ -14,6 +14,7 @@ result: Database = vectors_db.update( database_id = '', name = '', enabled = False, # optional + description = '', # optional specification = 'serverless', # optional replicas = 0, # optional sync_mode = 'async' # optional diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index 1585ef2b..fddd87eb 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -19,7 +19,8 @@ result: Webhook = webhooks.create( tls = False, # optional auth_username = '', # optional auth_password = 'password', # optional - secret = '' # optional + secret = '', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index 647e8618..7fa2311e 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -18,7 +18,8 @@ result: Webhook = webhooks.update( enabled = False, # optional tls = False, # optional auth_username = '', # optional - auth_password = 'password' # optional + auth_password = 'password', # optional + description = '' # optional ) print(result.model_dump()) diff --git a/pyproject.toml b/pyproject.toml index f9897243..b75f237c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "appwrite" -version = "25.0.0" +version = "26.0.0" description = "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API" readme = "README.md" requires-python = ">=3.9" @@ -30,6 +30,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] [project.optional-dependencies] diff --git a/setup.py b/setup.py index dc433792..88f54765 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name='appwrite', packages=setuptools.find_packages(), - version='25.0.0', + version='26.0.0', license='BSD-3-Clause', description='Appwrite is an open-source self-hosted backend server that abstracts and simplifies 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/25.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/26.0.0.tar.gz', install_requires=[ 'requests', 'pydantic>=2,<3', @@ -35,5 +35,6 @@ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ], ) diff --git a/test/services/test_account.py b/test/services/test_account.py index 04fb136f..e37d5b47 100644 --- a/test/services/test_account.py +++ b/test/services/test_account.py @@ -261,6 +261,22 @@ def test_delete_identity(self, m): ) self.assertEqual(response, data) + @requests_mock.Mocker() + def test_list_memberships(self, m): + data = { + "total": 5.0, + "memberships": [], + } + headers = {'Content-Type': 'application/json'} + m.request( + requests_mock.ANY, + requests_mock.ANY, + text=json.dumps(data), + headers=headers, + ) + response = self.account.list_memberships() + self.assertEqual(response.to_dict(), data) + @requests_mock.Mocker() def test_update_mfa(self, m): data = { diff --git a/test/services/test_databases.py b/test/services/test_databases.py index 733f8f08..14d81297 100644 --- a/test/services/test_databases.py +++ b/test/services/test_databases.py @@ -35,6 +35,7 @@ def test_create(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -175,6 +176,7 @@ def test_get(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -197,6 +199,7 @@ def test_update(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -256,6 +259,7 @@ def test_create_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -286,6 +290,7 @@ def test_get_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -315,6 +320,7 @@ def test_update_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -374,6 +380,7 @@ def test_list_attributes(self, m): def test_create_big_int_attribute(self, m): data = { "key": "count", + "description": "Name shown on the public profile.", "type": "bigint", "status": "available", "error": "string", @@ -400,6 +407,7 @@ def test_create_big_int_attribute(self, m): def test_update_big_int_attribute(self, m): data = { "key": "count", + "description": "Name shown on the public profile.", "type": "bigint", "status": "available", "error": "string", @@ -427,6 +435,7 @@ def test_update_big_int_attribute(self, m): def test_create_boolean_attribute(self, m): data = { "key": "isEnabled", + "description": "Name shown on the public profile.", "type": "boolean", "status": "available", "error": "string", @@ -453,6 +462,7 @@ def test_create_boolean_attribute(self, m): def test_update_boolean_attribute(self, m): data = { "key": "isEnabled", + "description": "Name shown on the public profile.", "type": "boolean", "status": "available", "error": "string", @@ -480,6 +490,7 @@ def test_update_boolean_attribute(self, m): def test_create_datetime_attribute(self, m): data = { "key": "birthDay", + "description": "Name shown on the public profile.", "type": "datetime", "status": "available", "error": "string", @@ -507,6 +518,7 @@ def test_create_datetime_attribute(self, m): def test_update_datetime_attribute(self, m): data = { "key": "birthDay", + "description": "Name shown on the public profile.", "type": "datetime", "status": "available", "error": "string", @@ -535,6 +547,7 @@ def test_update_datetime_attribute(self, m): def test_create_email_attribute(self, m): data = { "key": "userEmail", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -562,6 +575,7 @@ def test_create_email_attribute(self, m): def test_update_email_attribute(self, m): data = { "key": "userEmail", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -590,6 +604,7 @@ def test_update_email_attribute(self, m): def test_create_enum_attribute(self, m): data = { "key": "status", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -619,6 +634,7 @@ def test_create_enum_attribute(self, m): def test_update_enum_attribute(self, m): data = { "key": "status", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -649,6 +665,7 @@ def test_update_enum_attribute(self, m): def test_create_float_attribute(self, m): data = { "key": "percentageCompleted", + "description": "Name shown on the public profile.", "type": "double", "status": "available", "error": "string", @@ -675,6 +692,7 @@ def test_create_float_attribute(self, m): def test_update_float_attribute(self, m): data = { "key": "percentageCompleted", + "description": "Name shown on the public profile.", "type": "double", "status": "available", "error": "string", @@ -702,6 +720,7 @@ def test_update_float_attribute(self, m): def test_create_integer_attribute(self, m): data = { "key": "count", + "description": "Name shown on the public profile.", "type": "integer", "status": "available", "error": "string", @@ -728,6 +747,7 @@ def test_create_integer_attribute(self, m): def test_update_integer_attribute(self, m): data = { "key": "count", + "description": "Name shown on the public profile.", "type": "integer", "status": "available", "error": "string", @@ -755,6 +775,7 @@ def test_update_integer_attribute(self, m): def test_create_ip_attribute(self, m): data = { "key": "ipAddress", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -782,6 +803,7 @@ def test_create_ip_attribute(self, m): def test_update_ip_attribute(self, m): data = { "key": "ipAddress", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -810,6 +832,7 @@ def test_update_ip_attribute(self, m): def test_create_line_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -836,6 +859,7 @@ def test_create_line_attribute(self, m): def test_update_line_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -862,6 +886,7 @@ def test_update_line_attribute(self, m): def test_create_longtext_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -888,6 +913,7 @@ def test_create_longtext_attribute(self, m): def test_update_longtext_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -915,6 +941,7 @@ def test_update_longtext_attribute(self, m): def test_create_mediumtext_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -941,6 +968,7 @@ def test_create_mediumtext_attribute(self, m): def test_update_mediumtext_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -968,6 +996,7 @@ def test_update_mediumtext_attribute(self, m): def test_create_point_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -994,6 +1023,7 @@ def test_create_point_attribute(self, m): def test_update_point_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1020,6 +1050,7 @@ def test_update_point_attribute(self, m): def test_create_polygon_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1046,6 +1077,7 @@ def test_create_polygon_attribute(self, m): def test_update_polygon_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1072,6 +1104,7 @@ def test_update_polygon_attribute(self, m): def test_create_relationship_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1104,6 +1137,7 @@ def test_create_relationship_attribute(self, m): def test_update_relationship_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1135,6 +1169,7 @@ def test_update_relationship_attribute(self, m): def test_create_string_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1163,6 +1198,7 @@ def test_create_string_attribute(self, m): def test_update_string_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1191,6 +1227,7 @@ def test_update_string_attribute(self, m): def test_create_text_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1217,6 +1254,7 @@ def test_create_text_attribute(self, m): def test_update_text_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1244,6 +1282,7 @@ def test_update_text_attribute(self, m): def test_create_url_attribute(self, m): data = { "key": "githubUrl", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1271,6 +1310,7 @@ def test_create_url_attribute(self, m): def test_update_url_attribute(self, m): data = { "key": "githubUrl", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1299,6 +1339,7 @@ def test_update_url_attribute(self, m): def test_create_varchar_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1327,6 +1368,7 @@ def test_create_varchar_attribute(self, m): def test_update_varchar_attribute(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1355,6 +1397,7 @@ def test_update_varchar_attribute(self, m): def test_get_attribute(self, m): data = { "key": "isEnabled", + "description": "Name shown on the public profile.", "type": "boolean", "status": "available", "error": "string", @@ -1517,6 +1560,25 @@ def test_delete_documents(self, m): ) self.assertEqual(response.to_dict(), data) + @requests_mock.Mocker() + def test_create_query(self, m): + data = { + "total": 5.0, + "documents": [], + } + headers = {'Content-Type': 'application/json'} + m.request( + requests_mock.ANY, + requests_mock.ANY, + text=json.dumps(data), + headers=headers, + ) + response = self.databases.create_query( + '', + '', + ) + self.assertEqual(response.to_dict(), data) + @requests_mock.Mocker() def test_get_document(self, m): data = { @@ -1692,6 +1754,7 @@ def test_create_index(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", @@ -1721,6 +1784,7 @@ def test_get_index(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", diff --git a/test/services/test_documents_db.py b/test/services/test_documents_db.py index fb451c82..c9840596 100644 --- a/test/services/test_documents_db.py +++ b/test/services/test_documents_db.py @@ -35,6 +35,7 @@ def test_create(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -191,6 +192,7 @@ def test_get(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -213,6 +215,7 @@ def test_update(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -273,6 +276,7 @@ def test_create_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -303,6 +307,7 @@ def test_get_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -332,6 +337,7 @@ def test_update_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -493,6 +499,25 @@ def test_delete_documents(self, m): ) self.assertEqual(response.to_dict(), data) + @requests_mock.Mocker() + def test_create_query(self, m): + data = { + "total": 5.0, + "documents": [], + } + headers = {'Content-Type': 'application/json'} + m.request( + requests_mock.ANY, + requests_mock.ANY, + text=json.dumps(data), + headers=headers, + ) + response = self.documents_db.create_query( + '', + '', + ) + self.assertEqual(response.to_dict(), data) + @requests_mock.Mocker() def test_get_document(self, m): data = { @@ -668,6 +693,7 @@ def test_create_index(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", @@ -697,6 +723,7 @@ def test_get_index(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", diff --git a/test/services/test_functions.py b/test/services/test_functions.py index d515e891..1f63e700 100644 --- a/test/services/test_functions.py +++ b/test/services/test_functions.py @@ -38,6 +38,7 @@ def test_create(self, m): "$updatedAt": "2020-10-15T06:38:00.000+00:00", "execute": [], "name": "My Function", + "description": "Sends a welcome email to newly registered users.", "enabled": True, "live": True, "logging": True, @@ -121,6 +122,7 @@ def test_get(self, m): "$updatedAt": "2020-10-15T06:38:00.000+00:00", "execute": [], "name": "My Function", + "description": "Sends a welcome email to newly registered users.", "enabled": True, "live": True, "logging": True, @@ -170,6 +172,7 @@ def test_update(self, m): "$updatedAt": "2020-10-15T06:38:00.000+00:00", "execute": [], "name": "My Function", + "description": "Sends a welcome email to newly registered users.", "enabled": True, "live": True, "logging": True, @@ -235,6 +238,7 @@ def test_update_function_deployment(self, m): "$updatedAt": "2020-10-15T06:38:00.000+00:00", "execute": [], "name": "My Function", + "description": "Sends a welcome email to newly registered users.", "enabled": True, "live": True, "logging": True, @@ -725,6 +729,7 @@ def test_create_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", @@ -752,6 +757,7 @@ def test_get_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", @@ -777,6 +783,7 @@ def test_update_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", diff --git a/test/services/test_messaging.py b/test/services/test_messaging.py index 03c86ea6..d22f32d6 100644 --- a/test/services/test_messaging.py +++ b/test/services/test_messaging.py @@ -1165,6 +1165,7 @@ def test_create_topic(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "events", + "description": "Order status updates sent to customers.", "emailTotal": 100.0, "smsTotal": 100.0, "pushTotal": 100.0, @@ -1190,6 +1191,7 @@ def test_get_topic(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "events", + "description": "Order status updates sent to customers.", "emailTotal": 100.0, "smsTotal": 100.0, "pushTotal": 100.0, @@ -1214,6 +1216,7 @@ def test_update_topic(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "events", + "description": "Order status updates sent to customers.", "emailTotal": 100.0, "smsTotal": 100.0, "pushTotal": 100.0, diff --git a/test/services/test_organization.py b/test/services/test_organization.py index 85ed9358..41206a71 100644 --- a/test/services/test_organization.py +++ b/test/services/test_organization.py @@ -92,6 +92,7 @@ def test_get(self, m): "deploymentSize": 30.0, "buildSize": 2000.0, "functionsIntervalMinimum": 60.0, + "functionsAllowCron": True, "databasesAllowEncrypt": True, "group": "pro", "databaseComputeCredit": 10, @@ -190,6 +191,7 @@ def test_update(self, m): "deploymentSize": 30.0, "buildSize": 2000.0, "functionsIntervalMinimum": 60.0, + "functionsAllowCron": True, "databasesAllowEncrypt": True, "group": "pro", "databaseComputeCredit": 10, @@ -640,6 +642,7 @@ def test_create_ephemeral_project_key(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My API Key", + "description": "Used by the nightly backup job.", "expire": "2020-10-15T06:38:00.000+00:00", "scopes": [], "secret": "919c2d18fb5d4...a2ae413da83346ad2", @@ -667,6 +670,7 @@ def test_get_project_key(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My API Key", + "description": "Used by the nightly backup job.", "expire": "2020-10-15T06:38:00.000+00:00", "scopes": [], "secret": "919c2d18fb5d4...a2ae413da83346ad2", @@ -693,6 +697,7 @@ def test_update_project_key(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My API Key", + "description": "Used by the nightly backup job.", "expire": "2020-10-15T06:38:00.000+00:00", "scopes": [], "secret": "919c2d18fb5d4...a2ae413da83346ad2", diff --git a/test/services/test_project.py b/test/services/test_project.py index 669f0013..d0c94701 100644 --- a/test/services/test_project.py +++ b/test/services/test_project.py @@ -292,6 +292,7 @@ def test_create_ephemeral_key(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My API Key", + "description": "Used by the nightly backup job.", "expire": "2020-10-15T06:38:00.000+00:00", "scopes": [], "secret": "919c2d18fb5d4...a2ae413da83346ad2", @@ -318,6 +319,7 @@ def test_get_key(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My API Key", + "description": "Used by the nightly backup job.", "expire": "2020-10-15T06:38:00.000+00:00", "scopes": [], "secret": "919c2d18fb5d4...a2ae413da83346ad2", @@ -343,6 +345,7 @@ def test_update_key(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My API Key", + "description": "Used by the nightly backup job.", "expire": "2020-10-15T06:38:00.000+00:00", "scopes": [], "secret": "919c2d18fb5d4...a2ae413da83346ad2", @@ -2546,6 +2549,7 @@ def test_get_policy(self, m): data = { "$id": "password-dictionary", "enabled": True, + "denyList": [], } headers = {'Content-Type': 'application/json'} m.request( @@ -2787,6 +2791,7 @@ def test_create_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", @@ -2813,6 +2818,7 @@ def test_get_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", @@ -2837,6 +2843,7 @@ def test_update_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", diff --git a/test/services/test_sites.py b/test/services/test_sites.py index d7b7f32c..a1e4354e 100644 --- a/test/services/test_sites.py +++ b/test/services/test_sites.py @@ -37,6 +37,7 @@ def test_create(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Site", + "description": "Marketing site for the spring launch.", "enabled": True, "live": True, "logging": True, @@ -123,6 +124,7 @@ def test_get(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Site", + "description": "Marketing site for the spring launch.", "enabled": True, "live": True, "logging": True, @@ -174,6 +176,7 @@ def test_update(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Site", + "description": "Marketing site for the spring launch.", "enabled": True, "live": True, "logging": True, @@ -242,6 +245,7 @@ def test_update_site_deployment(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Site", + "description": "Marketing site for the spring launch.", "enabled": True, "live": True, "logging": True, @@ -700,6 +704,7 @@ def test_create_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", @@ -727,6 +732,7 @@ def test_get_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", @@ -752,6 +758,7 @@ def test_update_variable(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": True, "resourceType": "function", diff --git a/test/services/test_storage.py b/test/services/test_storage.py index d2e56d29..15c0da0a 100644 --- a/test/services/test_storage.py +++ b/test/services/test_storage.py @@ -39,6 +39,7 @@ def test_create_bucket(self, m): "$permissions": [], "fileSecurity": True, "name": "Documents", + "description": "Invoices and receipts uploaded by customers.", "enabled": True, "maximumFileSize": 100.0, "allowedFileExtensions": [], @@ -46,6 +47,7 @@ def test_create_bucket(self, m): "encryption": True, "antivirus": True, "transformations": True, + "stripMetadata": True, "totalSize": 128.0, } headers = {'Content-Type': 'application/json'} @@ -70,6 +72,7 @@ def test_get_bucket(self, m): "$permissions": [], "fileSecurity": True, "name": "Documents", + "description": "Invoices and receipts uploaded by customers.", "enabled": True, "maximumFileSize": 100.0, "allowedFileExtensions": [], @@ -77,6 +80,7 @@ def test_get_bucket(self, m): "encryption": True, "antivirus": True, "transformations": True, + "stripMetadata": True, "totalSize": 128.0, } headers = {'Content-Type': 'application/json'} @@ -100,6 +104,7 @@ def test_update_bucket(self, m): "$permissions": [], "fileSecurity": True, "name": "Documents", + "description": "Invoices and receipts uploaded by customers.", "enabled": True, "maximumFileSize": 100.0, "allowedFileExtensions": [], @@ -107,6 +112,7 @@ def test_update_bucket(self, m): "encryption": True, "antivirus": True, "transformations": True, + "stripMetadata": True, "totalSize": 128.0, } headers = {'Content-Type': 'application/json'} diff --git a/test/services/test_tables_db.py b/test/services/test_tables_db.py index b2e71905..31151822 100644 --- a/test/services/test_tables_db.py +++ b/test/services/test_tables_db.py @@ -35,6 +35,7 @@ def test_create(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -191,6 +192,7 @@ def test_get(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -213,6 +215,7 @@ def test_update(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -536,6 +539,7 @@ def test_create_table(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Table", + "description": "Movies available in the catalog.", "enabled": True, "rowSecurity": True, "columns": [], @@ -566,6 +570,7 @@ def test_get_table(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Table", + "description": "Movies available in the catalog.", "enabled": True, "rowSecurity": True, "columns": [], @@ -595,6 +600,7 @@ def test_update_table(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Table", + "description": "Movies available in the catalog.", "enabled": True, "rowSecurity": True, "columns": [], @@ -654,6 +660,7 @@ def test_list_columns(self, m): def test_create_big_int_column(self, m): data = { "key": "count", + "description": "Name shown on the public profile.", "type": "bigint", "status": "available", "error": "string", @@ -680,6 +687,7 @@ def test_create_big_int_column(self, m): def test_update_big_int_column(self, m): data = { "key": "count", + "description": "Name shown on the public profile.", "type": "bigint", "status": "available", "error": "string", @@ -707,6 +715,7 @@ def test_update_big_int_column(self, m): def test_create_boolean_column(self, m): data = { "key": "isEnabled", + "description": "Name shown on the public profile.", "type": "boolean", "status": "available", "error": "string", @@ -733,6 +742,7 @@ def test_create_boolean_column(self, m): def test_update_boolean_column(self, m): data = { "key": "isEnabled", + "description": "Name shown on the public profile.", "type": "boolean", "status": "available", "error": "string", @@ -760,6 +770,7 @@ def test_update_boolean_column(self, m): def test_create_datetime_column(self, m): data = { "key": "birthDay", + "description": "Name shown on the public profile.", "type": "datetime", "status": "available", "error": "string", @@ -787,6 +798,7 @@ def test_create_datetime_column(self, m): def test_update_datetime_column(self, m): data = { "key": "birthDay", + "description": "Name shown on the public profile.", "type": "datetime", "status": "available", "error": "string", @@ -815,6 +827,7 @@ def test_update_datetime_column(self, m): def test_create_email_column(self, m): data = { "key": "userEmail", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -842,6 +855,7 @@ def test_create_email_column(self, m): def test_update_email_column(self, m): data = { "key": "userEmail", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -870,6 +884,7 @@ def test_update_email_column(self, m): def test_create_enum_column(self, m): data = { "key": "status", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -899,6 +914,7 @@ def test_create_enum_column(self, m): def test_update_enum_column(self, m): data = { "key": "status", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -929,6 +945,7 @@ def test_update_enum_column(self, m): def test_create_float_column(self, m): data = { "key": "percentageCompleted", + "description": "Name shown on the public profile.", "type": "double", "status": "available", "error": "string", @@ -955,6 +972,7 @@ def test_create_float_column(self, m): def test_update_float_column(self, m): data = { "key": "percentageCompleted", + "description": "Name shown on the public profile.", "type": "double", "status": "available", "error": "string", @@ -982,6 +1000,7 @@ def test_update_float_column(self, m): def test_create_integer_column(self, m): data = { "key": "count", + "description": "Name shown on the public profile.", "type": "integer", "status": "available", "error": "string", @@ -1008,6 +1027,7 @@ def test_create_integer_column(self, m): def test_update_integer_column(self, m): data = { "key": "count", + "description": "Name shown on the public profile.", "type": "integer", "status": "available", "error": "string", @@ -1035,6 +1055,7 @@ def test_update_integer_column(self, m): def test_create_ip_column(self, m): data = { "key": "ipAddress", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1062,6 +1083,7 @@ def test_create_ip_column(self, m): def test_update_ip_column(self, m): data = { "key": "ipAddress", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1090,6 +1112,7 @@ def test_update_ip_column(self, m): def test_create_line_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1116,6 +1139,7 @@ def test_create_line_column(self, m): def test_update_line_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1142,6 +1166,7 @@ def test_update_line_column(self, m): def test_create_longtext_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1168,6 +1193,7 @@ def test_create_longtext_column(self, m): def test_update_longtext_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1195,6 +1221,7 @@ def test_update_longtext_column(self, m): def test_create_mediumtext_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1221,6 +1248,7 @@ def test_create_mediumtext_column(self, m): def test_update_mediumtext_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1248,6 +1276,7 @@ def test_update_mediumtext_column(self, m): def test_create_point_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1274,6 +1303,7 @@ def test_create_point_column(self, m): def test_update_point_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1300,6 +1330,7 @@ def test_update_point_column(self, m): def test_create_polygon_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1326,6 +1357,7 @@ def test_create_polygon_column(self, m): def test_update_polygon_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1352,6 +1384,7 @@ def test_update_polygon_column(self, m): def test_create_relationship_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1384,6 +1417,7 @@ def test_create_relationship_column(self, m): def test_update_relationship_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1415,6 +1449,7 @@ def test_update_relationship_column(self, m): def test_create_string_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1443,6 +1478,7 @@ def test_create_string_column(self, m): def test_update_string_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1471,6 +1507,7 @@ def test_update_string_column(self, m): def test_create_text_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1497,6 +1534,7 @@ def test_create_text_column(self, m): def test_update_text_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1524,6 +1562,7 @@ def test_update_text_column(self, m): def test_create_url_column(self, m): data = { "key": "githubUrl", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1551,6 +1590,7 @@ def test_create_url_column(self, m): def test_update_url_column(self, m): data = { "key": "githubUrl", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1579,6 +1619,7 @@ def test_update_url_column(self, m): def test_create_varchar_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1607,6 +1648,7 @@ def test_create_varchar_column(self, m): def test_update_varchar_column(self, m): data = { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -1635,6 +1677,7 @@ def test_update_varchar_column(self, m): def test_get_column(self, m): data = { "key": "isEnabled", + "description": "Name shown on the public profile.", "type": "boolean", "status": "available", "error": "string", @@ -1699,6 +1742,7 @@ def test_create_index(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", @@ -1728,6 +1772,7 @@ def test_get_index(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", @@ -1889,6 +1934,25 @@ def test_delete_rows(self, m): ) self.assertEqual(response.to_dict(), data) + @requests_mock.Mocker() + def test_create_query(self, m): + data = { + "total": 5.0, + "rows": [], + } + headers = {'Content-Type': 'application/json'} + m.request( + requests_mock.ANY, + requests_mock.ANY, + text=json.dumps(data), + headers=headers, + ) + response = self.tables_db.create_query( + '', + '', + ) + self.assertEqual(response.to_dict(), data) + @requests_mock.Mocker() def test_get_row(self, m): data = { diff --git a/test/services/test_vectors_db.py b/test/services/test_vectors_db.py index 5ed5c005..2c6f2240 100644 --- a/test/services/test_vectors_db.py +++ b/test/services/test_vectors_db.py @@ -35,6 +35,7 @@ def test_create(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -191,6 +192,7 @@ def test_get(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -213,6 +215,7 @@ def test_update(self, m): data = { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": True, @@ -273,6 +276,7 @@ def test_create_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -305,6 +309,7 @@ def test_get_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -335,6 +340,7 @@ def test_update_collection(self, m): "$permissions": [], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": True, "documentSecurity": True, "attributes": [], @@ -637,6 +643,7 @@ def test_create_index(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", @@ -666,6 +673,7 @@ def test_get_index(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", diff --git a/test/services/test_webhooks.py b/test/services/test_webhooks.py index 9d5d6237..0f65c6b2 100644 --- a/test/services/test_webhooks.py +++ b/test/services/test_webhooks.py @@ -37,6 +37,7 @@ def test_create(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Webhook", + "description": "Notifies the billing service about new users.", "url": "https:\/\/example.com\/webhook", "events": [], "tls": True, @@ -69,6 +70,7 @@ def test_get(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Webhook", + "description": "Notifies the billing service about new users.", "url": "https:\/\/example.com\/webhook", "events": [], "tls": True, @@ -98,6 +100,7 @@ def test_update(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Webhook", + "description": "Notifies the billing service about new users.", "url": "https:\/\/example.com\/webhook", "events": [], "tls": True, @@ -145,6 +148,7 @@ def test_update_secret(self, m): "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Webhook", + "description": "Notifies the billing service about new users.", "url": "https:\/\/example.com\/webhook", "events": [], "tls": True, diff --git a/test/test_query.py b/test/test_query.py index b6a92bbc..ae47a4b1 100644 --- a/test/test_query.py +++ b/test/test_query.py @@ -267,6 +267,19 @@ def test_cross_join(self): parsed(Query.cross_join('orders', 'ord')), {'method': 'crossJoin', 'attribute': 'orders', 'values': ['ord']} ) + def test_nested_join_without_alias_leaves_the_alias_to_the_server(self): + query = json.loads(Query.join('orders', [Query.on('$id', 'customerId')])) + self.assertEqual(query['method'], 'join') + self.assertEqual(query['attribute'], 'orders') + self.assertEqual(len(query['values']), 1) + self.assertEqual(query['values'][0]['method'], 'on') + + def test_cross_join_without_alias_leaves_the_alias_to_the_server(self): + query = json.loads(Query.cross_join('orders')) + self.assertEqual(query['method'], 'crossJoin') + self.assertEqual(query['attribute'], 'orders') + self.assertEqual(query.get('values') or [], []) + def test_not_covers(self): self.assertEqual( parsed(Query.not_covers('location', [1, 2])),