-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloud Storage Rest API: Downloading objects #52
Comments
Thanks for reporting this 👍🏻 Oh dear, Google cloud storage API is a mess. gcloud-protos-generator/openapi/google/storage-v1/ext/apis/objects_api.rs So, I'd suggest to include some additional implementation as you did. The only thing we need is also the streaming version as well, so if you have big files not to allocate everything in the memory (for upload we have 2 version of the function for this). Want to give a try with the PR, or I can look into this a bit later myself? |
Ok, I extracted your code to some extension functions here: Will release shortly! Thanks for sharing the code - it made my life a bit easier :) |
This is released now in Feel free to reopen this if you find issues |
Sorry for the late response, and thank you! That works perfectly :) |
Thanks for checking it! |
Hi! Thanks for this library. I've run into an issue related to the google cloud storage API.
Apparently the way to download the contents of an object via the cloud storage API is to include an
alt=media
parameter to theGET https://storage.googleapis.com/storage/v1/b/bucket/o/object
endpoint. This corresponds to thestorage_objects_get
function:Unfortunately this function expects the API to return an
Object
instance, so when you pass "media" as thealt
parameter, the result is a serde deserialisation error.I've fixed this locally by adding a new function
storage_objects_get_bytes
which always providesalt=media
and has this signature:This is my local change, but I'm not sure if I've put it in the right place to play nice with the codegen.
What do you suggest is the best approach here?
The text was updated successfully, but these errors were encountered: