merge-api / merge-python-client

The Python SDK for accessing various Merge Unified APIs
Other
6 stars 11 forks source link

Filestorage files download casts/returns None instead of returning the downloaded bytes #6

Closed lucasgadams closed 1 year ago

lucasgadams commented 1 year ago

The download function of file_storage Files class returns and casts to None when it should return the downloaded bytes of the file. Code here.

If you change that to:

        return self._get(
            f"/filestorage/v1/files/{id}/download",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            #cast_to=NoneType,
            cast_to=httpx.Response,
        )

You can get the Httpx.Response object and access response.content to get the actual data. Otherwise None is returned and you can't download anything.

rmkonnur commented 1 year ago

Hello! Apologies on the delay getting back to you on this issue. This package is in beta for a new SDK generation process. We've updated how we generate our SDKs in the latest version (v0.1.1) which will lead to better SDK generation. The File Storage category is also still in a beta period, so it's not yet available in the new SDK. We plan on doing a full release of the category this week, and the SDK supporting File Storage will follow shortly after. The issue you raised will be addressed in that release. Please update to the latest version of this package if you would like to use the newest SDK we're offering. If you'd like to use File Storage you'll have to use the API directly for now. We'll follow up once this issues is resolved!

rmkonnur commented 1 year ago

Hi again! As mentioned a few days ago, we have released the File Storage category in the new SDK (v0.2.0). If you upgrade to the latest version, you will be able to download Files as expected! Please raise any additional issues that may arise. Thanks!