Go client for the Runalyze Personal API.
This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.
- API version: 1.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen
Put the package under your project folder and add the following in import:
import "./runalyze"
All URIs are relative to https://runalyze.com
Class | Method | HTTP request | Description |
---|---|---|---|
ActivityUploadApi | GetActivityByID | Get /api/v1/activities/uploads/{id} | |
ActivityUploadApi | UploadActivity | Post /api/v1/activities/uploads | |
HealthMetricsApi | CreateBloodPressure | Post /api/v1/metrics/bloodPressure | Creates a new blood pressure entry |
HealthMetricsApi | CreateBodyComposition | Post /api/v1/metrics/bodyComposition | Creates a new body composition entry |
HealthMetricsApi | CreateHeartRateMax | Post /api/v1/metrics/heartRateMax | Creates a new maximum heart rate entry |
HealthMetricsApi | CreateHeartRateRest | Post /api/v1/metrics/heartRateRest | Creates a new resting heart rate entry |
HealthMetricsApi | CreateMental | Post /api/v1/metrics/mental | Creates a new mental state entry |
HealthMetricsApi | CreateMetrics | Post /api/v1/metrics | Creates bulk entries of all existing metrics |
HealthMetricsApi | CreateSleep | Post /api/v1/metrics/sleep | Creates a new sleeping entry |
Endpoints do not require authorization.
- Download the swagger spec from the docs:
$ mkdir meta
$ pup -f <(curl -sL https://runalyze.com/doc/personal) script#swagger-data text{} | jq -r .spec > meta/runalyze.json
I couldn't find the path to the file but saw the spec in the HTML 😉.
-
As the spec isn't complete, we need to manually edit the
runalyze.json
file and... -
Add a description to the
info
section, -
Add
"servers": [{"url": "https://runalyze.com"}],
before"paths"
-
give all operations meaningful names, ie replace the
null
in alloperationId
props with something useful likeCreateMetrics
-
Create a Go specific config file:
$ echo '{"packageName":"runalyze"}' > meta/config.json
- Generate the Go library code:
$ swagger-codegen generate --input-spec meta/runalyze.json --config meta/config.json --lang go --output .
- Append this README to the end of the generated README:
$ cat meta/README.md >> README.md
- Download the swagger spec from the docs:
$ mkdir meta
$ pup -f <(curl -sL https://runalyze.com/doc/personal) script#swagger-data text{} | jq -r .spec > meta/runalyze.json
I couldn't find the path to the file but saw the spec in the HTML 😉.
-
As the spec isn't complete, we need to manually edit the
runalyze.json
file and... -
Add a description to the
info
section, -
Add
"servers": [{"url": "https://runalyze.com"}],
before"paths"
-
give all operations meaningful names, ie replace the
null
in alloperationId
props with something useful likeCreateMetrics
-
Create a Go specific config file:
$ echo '{"packageName":"runalyze"}' > meta/config.json
- Generate the Go library code:
$ swagger-codegen generate --input-spec meta/runalyze.json --config meta/config.json --lang go --output .
- Append this README to the end of the generated README:
$ cat meta/README.md >> README.md
Note: Additional tweaks will be needed to the README.