#  Rubio - Rubika API library for python
#  Copyright (C) 2025-present Rubio <https://github.com/RubioTeam>
#  Github - https://github.com/RubioTeam/rubio.core


from typing import Union
import rubio.core


class GetFile:
    
    __slots__ = ()

    async def get_file(
        self: "rubio.core.Client",
        file_id: str
    ) -> Union[str, None]:
        """
        Retrieve the download URL of a file by its ID.

        Parameters:
            file_id (str):
                Unique identifier of the file on the Rubika server.

        Returns:
            Union[str, None]:
                The download URL of the file if found, otherwise None.

        Example:
        .. code-block:: python
            url = await client.get_file(file_id="file_id")
        """
        response = await self.request("getFile", {"file_id": file_id})
        return response.get("download_url")