@@ -54,6 +54,7 @@ def get_collection(self, collection_id: Optional[str] = "default") -> Collection
5454 self .collection_id ,
5555 collection_data .get ("name" ),
5656 collection_data .get ("description" ),
57+ collection_data .get ("is_public" , False ),
5758 )
5859
5960 def get_collections (self ) -> List [Collection ]:
@@ -69,15 +70,19 @@ def get_collections(self) -> List[Collection]:
6970 collection .get ("id" ),
7071 collection .get ("name" ),
7172 collection .get ("description" ),
73+ collection .get ("is_public" , False ),
7274 )
7375 for collection in collections_data .get ("collections" )
7476 ]
7577
76- def create_collection (self , name : str , description : str ) -> Collection :
78+ def create_collection (
79+ self , name : str , description : str , is_public : bool = False
80+ ) -> Collection :
7781 """Create a new collection.
7882
7983 :param name: Name of the collection
8084 :param description: Description of the collection
85+ :param is_public: Make collection public
8186 :return: :class:`Collection <Collection>` object
8287 :rtype: :class:`videodb.collection.Collection`
8388 """
@@ -86,6 +91,7 @@ def create_collection(self, name: str, description: str) -> Collection:
8691 data = {
8792 "name" : name ,
8893 "description" : description ,
94+ "is_public" : is_public ,
8995 },
9096 )
9197 self .collection_id = collection_data .get ("id" , "default" )
@@ -94,6 +100,7 @@ def create_collection(self, name: str, description: str) -> Collection:
94100 collection_data .get ("id" ),
95101 collection_data .get ("name" ),
96102 collection_data .get ("description" ),
103+ collection_data .get ("is_public" , False ),
97104 )
98105
99106 def update_collection (self , id : str , name : str , description : str ) -> Collection :
@@ -118,6 +125,7 @@ def update_collection(self, id: str, name: str, description: str) -> Collection:
118125 collection_data .get ("id" ),
119126 collection_data .get ("name" ),
120127 collection_data .get ("description" ),
128+ collection_data .get ("is_public" , False ),
121129 )
122130
123131 def check_usage (self ) -> dict :
@@ -136,6 +144,15 @@ def get_invoices(self) -> List[dict]:
136144 """
137145 return self .get (path = f"{ ApiPath .billing } /{ ApiPath .invoices } " )
138146
147+ def download (self , stream_link : str , name : str ) -> dict :
148+ return self .post (
149+ path = f"{ ApiPath .download } " ,
150+ data = {
151+ "stream_link" : stream_link ,
152+ "name" : name ,
153+ },
154+ )
155+
139156 def upload (
140157 self ,
141158 file_path : str = None ,
0 commit comments