2626class Connection (HttpClient ):
2727 """Connection class to interact with the VideoDB"""
2828
29- def __init__ (self , api_key : str , base_url : str ) -> None :
29+ def __init__ (self , api_key : str , base_url : str ) -> "Connection" :
3030 """Initializes a new instance of the Connection class with specified API credentials.
3131
32- :param api_key: API key for authentication
33- :param str base_url: (optional) Base URL of the VideoDB API
32+ Note: Users should not initialize this class directly.
33+ Instead use :meth:`videodb.connect() <videodb.connect>`
34+
35+ :param str api_key: API key for authentication
36+ :param str base_url: Base URL of the VideoDB API
3437 :raise ValueError: If the API key is not provided
3538 :return: :class:`Connection <Connection>` object, to interact with the VideoDB
3639 :rtype: :class:`videodb.client.Connection`
@@ -43,7 +46,7 @@ def __init__(self, api_key: str, base_url: str) -> None:
4346 def get_collection (self , collection_id : Optional [str ] = "default" ) -> Collection :
4447 """Get a collection object by its ID.
4548
46- :param collection_id: ID of the collection
49+ :param str collection_id: ID of the collection (optional, default: "default")
4750 :return: :class:`Collection <Collection>` object
4851 :rtype: :class:`videodb.collection.Collection`
4952 """
@@ -80,9 +83,9 @@ def create_collection(
8083 ) -> Collection :
8184 """Create a new collection.
8285
83- :param name: Name of the collection
84- :param description: Description of the collection
85- :param is_public: Make collection public
86+ :param str name: Name of the collection
87+ :param str description: Description of the collection
88+ :param bool is_public: Make collection public (optional, default: False)
8689 :return: :class:`Collection <Collection>` object
8790 :rtype: :class:`videodb.collection.Collection`
8891 """
@@ -107,8 +110,8 @@ def update_collection(self, id: str, name: str, description: str) -> Collection:
107110 """Update an existing collection.
108111
109112 :param str id: ID of the collection
110- :param name: Name of the collection
111- :param description: Description of the collection
113+ :param str name: Name of the collection
114+ :param str description: Description of the collection
112115 :return: :class:`Collection <Collection>` object
113116 :rtype: :class:`videodb.collection.Collection`
114117 """
@@ -140,7 +143,7 @@ def get_invoices(self) -> List[dict]:
140143 """Get a list of all invoices.
141144
142145 :return: List of invoices
143- :rtype: list of dict
146+ :rtype: list[ dict]
144147 """
145148 return self .get (path = f"{ ApiPath .billing } /{ ApiPath .invoices } " )
146149
@@ -171,12 +174,12 @@ def upload(
171174 ) -> Union [Video , Audio , Image , None ]:
172175 """Upload a file.
173176
174- :param file_path: Path to the file to upload
175- :param url: URL of the file to upload
176- :param MediaType media_type:(optional) MediaType object
177- :param name:(optional) Name of the file
178- :param description:(optional) Description of the file
179- :param callback_url:(optional) URL to receive the callback
177+ :param str file_path: Path to the file to upload (optional)
178+ :param str url: URL of the file to upload (optional)
179+ :param MediaType media_type: MediaType object (optional)
180+ :param str name: Name of the file (optional)
181+ :param str description: Description of the file (optional)
182+ :param str callback_url: URL to receive the callback (optional)
180183 :return: :class:`Video <Video>`, or :class:`Audio <Audio>`, or :class:`Image <Image>` object
181184 :rtype: Union[ :class:`videodb.video.Video`, :class:`videodb.audio.Audio`, :class:`videodb.image.Image`]
182185 """
0 commit comments