help wanted
Metriche repository
- Star
- (10 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
The Fitbit client misses the support for (at least all the GET endpoints of):
- nutrition https://dev.fitbit.com/build/reference/web-api/nutrition/
- nutrition timeseries: https://dev.fitbit.com/build/reference/web-api/nutrition-timeseries/
I don't log the food, so I don't have data for automatically generating with galeone/rts the structs, and thus there's no support for this (yet).
If someone want's to help, it only needs to follow the steps in the readme to create an application, and than use rts in this way:
var req *http.Client
req, err = fitbitAuthorizer.HTTP()
if err != nil {
return err
}
// Build the various requests path (pay attention to the parameters)
// and foreach of this `dest`
if res, err = req.Get(dest); err != nil {
return err
}
var body []byte
if body, err = io.ReadAll(res.Body); err != nil {
return err
}
bodyString := string(body)
// RTS usage: creates the content inside a "types" package
if pack, err = rts.DoRaw("types", bodyString); err != nil {ù
return err
}
// Save the content.
Once you have the generated content saved, you have to manually edit all the Foo structures (it's easy, just look at the documentation for the fields) and organized the structs in the very same way these are already organized in the types folder.