Skip to content

GET: Nutrition and Nutrition timeseries #1

@galeone

Description

@galeone

The Fitbit client misses the support for (at least all the GET endpoints of):

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions