Skip to content
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

Create* API #3

Open
galeone opened this issue Nov 6, 2022 · 0 comments
Open

Create* API #3

galeone opened this issue Nov 6, 2022 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@galeone
Copy link
Owner

galeone commented Nov 6, 2022

Right now the fitbit/client package only allows to GET data from the Fitbit API.

All the other methods haven't been implemented.

The implementation should be trivial. for example for implementing the Create Activity Goal one should:

  1. Analyze the endpoint: there are 2 possible "periods", thus we can have 2 separate methods.
  2. Is a "user" method (works on the authorized user).
  3. It's an activity.
  4. Therefore, in the fitbit/client folder we already have the user_activities.go file containing all the GET implementations, and this is the correct location for adding this method.
  5. The convention to use is Create + User + $what. For example: CreateUserActivityDailyGoal and CreateUserActivityWeeklyGoal are the 2 methods to implement. NOTE: there are already the corresponding GET methods, therefore the naming should match (e.g. we have UserActivityDailyGoal for GET, therefore for the POST we must have CreateUserActivityDailyGoal
  6. If the Response matches one of the already existing types (it should), then return this type. Otherwise, create a new one.
@galeone galeone added the help wanted Extra attention is needed label Nov 6, 2022
@galeone galeone mentioned this issue Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant