google-apis-rs / google-cloud-rs

Asynchronous Rust bindings for Google Cloud Platform APIs.
176 stars 48 forks source link

Deserialize Bucket retention policy from String to u64 #67

Open amuhle opened 2 years ago

amuhle commented 2 years ago

Currently when a bucket has retention policy enabled and we try to get the bucket it fails when deserializing it. Google Storage API is sending a String when a u64 is expected based on their documentation.

This PR creates a specific deserializer for u64 when a String or 64 is being sent. I tried to find an existing crate which already solves this but couldn't find anything. However, as this is pretty simple to solve I thought I would just add the code in a new module and if in the future there's a well maintained crate to solve this kind of issues, then it will be pretty straightforward to refactor.