1
1
from ..service import Service
2
+ from typing import List
2
3
from ..exception import AppwriteException
3
4
from ..enums .relationship_type import RelationshipType ;
4
5
from ..enums .relation_mutate import RelationMutate ;
@@ -9,7 +10,7 @@ class Databases(Service):
9
10
def __init__ (self , client ):
10
11
super (Databases , self ).__init__ (client )
11
12
12
- def list (self , queries : list [str ] = None , search : str = None ):
13
+ def list (self , queries : List [str ] = None , search : str = None ):
13
14
"""List databases"""
14
15
15
16
api_path = '/databases'
@@ -92,7 +93,7 @@ def delete(self, database_id: str):
92
93
'content-type' : 'application/json' ,
93
94
}, api_params )
94
95
95
- def list_collections (self , database_id : str , queries : list [str ] = None , search : str = None ):
96
+ def list_collections (self , database_id : str , queries : List [str ] = None , search : str = None ):
96
97
"""List collections"""
97
98
98
99
api_path = '/databases/{databaseId}/collections'
@@ -109,7 +110,7 @@ def list_collections(self, database_id: str, queries: list[str] = None, search:
109
110
'content-type' : 'application/json' ,
110
111
}, api_params )
111
112
112
- def create_collection (self , database_id : str , collection_id : str , name : str , permissions : list [str ] = None , document_security : bool = None , enabled : bool = None ):
113
+ def create_collection (self , database_id : str , collection_id : str , name : str , permissions : List [str ] = None , document_security : bool = None , enabled : bool = None ):
113
114
"""Create collection"""
114
115
115
116
api_path = '/databases/{databaseId}/collections'
@@ -154,7 +155,7 @@ def get_collection(self, database_id: str, collection_id: str):
154
155
'content-type' : 'application/json' ,
155
156
}, api_params )
156
157
157
- def update_collection (self , database_id : str , collection_id : str , name : str , permissions : list [str ] = None , document_security : bool = None , enabled : bool = None ):
158
+ def update_collection (self , database_id : str , collection_id : str , name : str , permissions : List [str ] = None , document_security : bool = None , enabled : bool = None ):
158
159
"""Update collection"""
159
160
160
161
api_path = '/databases/{databaseId}/collections/{collectionId}'
@@ -199,7 +200,7 @@ def delete_collection(self, database_id: str, collection_id: str):
199
200
'content-type' : 'application/json' ,
200
201
}, api_params )
201
202
202
- def list_attributes (self , database_id : str , collection_id : str , queries : list [str ] = None ):
203
+ def list_attributes (self , database_id : str , collection_id : str , queries : List [str ] = None ):
203
204
"""List attributes"""
204
205
205
206
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes'
@@ -393,7 +394,7 @@ def update_email_attribute(self, database_id: str, collection_id: str, key: str,
393
394
'content-type' : 'application/json' ,
394
395
}, api_params )
395
396
396
- def create_enum_attribute (self , database_id : str , collection_id : str , key : str , elements : list [str ], required : bool , default : str = None , array : bool = None ):
397
+ def create_enum_attribute (self , database_id : str , collection_id : str , key : str , elements : List [str ], required : bool , default : str = None , array : bool = None ):
397
398
"""Create enum attribute"""
398
399
399
400
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'
@@ -426,7 +427,7 @@ def create_enum_attribute(self, database_id: str, collection_id: str, key: str,
426
427
'content-type' : 'application/json' ,
427
428
}, api_params )
428
429
429
- def update_enum_attribute (self , database_id : str , collection_id : str , key : str , elements : list [str ], required : bool , default : str , new_key : str = None ):
430
+ def update_enum_attribute (self , database_id : str , collection_id : str , key : str , elements : List [str ], required : bool , default : str , new_key : str = None ):
430
431
"""Update enum attribute"""
431
432
432
433
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'
@@ -865,7 +866,7 @@ def update_relationship_attribute(self, database_id: str, collection_id: str, ke
865
866
'content-type' : 'application/json' ,
866
867
}, api_params )
867
868
868
- def list_documents (self , database_id : str , collection_id : str , queries : list [str ] = None ):
869
+ def list_documents (self , database_id : str , collection_id : str , queries : List [str ] = None ):
869
870
"""List documents"""
870
871
871
872
api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
@@ -885,7 +886,7 @@ def list_documents(self, database_id: str, collection_id: str, queries: list[str
885
886
'content-type' : 'application/json' ,
886
887
}, api_params )
887
888
888
- def create_document (self , database_id : str , collection_id : str , document_id : str , data : dict , permissions : list [str ] = None ):
889
+ def create_document (self , database_id : str , collection_id : str , document_id : str , data : dict , permissions : List [str ] = None ):
889
890
"""Create document"""
890
891
891
892
api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
@@ -913,7 +914,7 @@ def create_document(self, database_id: str, collection_id: str, document_id: str
913
914
'content-type' : 'application/json' ,
914
915
}, api_params )
915
916
916
- def get_document (self , database_id : str , collection_id : str , document_id : str , queries : list [str ] = None ):
917
+ def get_document (self , database_id : str , collection_id : str , document_id : str , queries : List [str ] = None ):
917
918
"""Get document"""
918
919
919
920
api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
@@ -937,7 +938,7 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q
937
938
'content-type' : 'application/json' ,
938
939
}, api_params )
939
940
940
- def update_document (self , database_id : str , collection_id : str , document_id : str , data : dict = None , permissions : list [str ] = None ):
941
+ def update_document (self , database_id : str , collection_id : str , document_id : str , data : dict = None , permissions : List [str ] = None ):
941
942
"""Update document"""
942
943
943
944
api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
@@ -985,7 +986,7 @@ def delete_document(self, database_id: str, collection_id: str, document_id: str
985
986
'content-type' : 'application/json' ,
986
987
}, api_params )
987
988
988
- def list_indexes (self , database_id : str , collection_id : str , queries : list [str ] = None ):
989
+ def list_indexes (self , database_id : str , collection_id : str , queries : List [str ] = None ):
989
990
"""List indexes"""
990
991
991
992
api_path = '/databases/{databaseId}/collections/{collectionId}/indexes'
@@ -1005,7 +1006,7 @@ def list_indexes(self, database_id: str, collection_id: str, queries: list[str]
1005
1006
'content-type' : 'application/json' ,
1006
1007
}, api_params )
1007
1008
1008
- def create_index (self , database_id : str , collection_id : str , key : str , type : IndexType , attributes : list [str ], orders : list [str ] = None ):
1009
+ def create_index (self , database_id : str , collection_id : str , key : str , type : IndexType , attributes : List [str ], orders : List [str ] = None ):
1009
1010
"""Create index"""
1010
1011
1011
1012
api_path = '/databases/{databaseId}/collections/{collectionId}/indexes'
0 commit comments