polar-accesslink-api-gem 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +182 -0
- data/Rakefile +10 -0
- data/docs/Activity.md +34 -0
- data/docs/ActivityLog.md +18 -0
- data/docs/ActivityStepSample.md +20 -0
- data/docs/ActivityStepSamples.md +20 -0
- data/docs/ActivityZoneSample.md +20 -0
- data/docs/ActivityZoneSamples.md +20 -0
- data/docs/AvailableSleep.md +22 -0
- data/docs/AvailableSleeps.md +18 -0
- data/docs/AvailableUserData.md +22 -0
- data/docs/AvailableUserDatas.md +18 -0
- data/docs/CreatedWebhook.md +18 -0
- data/docs/CreatedWebhookData.md +24 -0
- data/docs/DailyActivityApi.md +440 -0
- data/docs/DurationZone.md +20 -0
- data/docs/Error.md +26 -0
- data/docs/Exercise.md +54 -0
- data/docs/ExerciseHashId.md +52 -0
- data/docs/Exercises.md +18 -0
- data/docs/ExercisesApi.md +214 -0
- data/docs/HeartRate.md +20 -0
- data/docs/NightlyRecharge.md +38 -0
- data/docs/NightlyRechargeApi.md +144 -0
- data/docs/Nights.md +18 -0
- data/docs/PhysicalInfoApi.md +294 -0
- data/docs/PhysicalInformation.md +40 -0
- data/docs/PhysicalInformations.md +18 -0
- data/docs/PullNotificationsApi.md +75 -0
- data/docs/Recharges.md +18 -0
- data/docs/Register.md +18 -0
- data/docs/Sample.md +22 -0
- data/docs/Samples.md +18 -0
- data/docs/Sleep.md +64 -0
- data/docs/SleepApi.md +211 -0
- data/docs/TrainingDataApi.md +744 -0
- data/docs/TransactionLocation.md +20 -0
- data/docs/User.md +36 -0
- data/docs/UserExtraInfo.md +22 -0
- data/docs/UsersApi.md +216 -0
- data/docs/WebhookInfo.md +18 -0
- data/docs/WebhookInfoData.md +22 -0
- data/docs/WebhookPatch.md +20 -0
- data/docs/WebhookPayloadExercise.md +26 -0
- data/docs/WebhookPayloadSleep.md +26 -0
- data/docs/WebhookPing.md +20 -0
- data/docs/WebhookRequest.md +20 -0
- data/docs/WebhookType.md +15 -0
- data/docs/WebhooksApi.md +289 -0
- data/docs/Zone.md +24 -0
- data/docs/Zones.md +18 -0
- data/git_push.sh +58 -0
- data/lib/polar-accesslink-api-gem/api/daily_activity_api.rb +469 -0
- data/lib/polar-accesslink-api-gem/api/exercises_api.rb +205 -0
- data/lib/polar-accesslink-api-gem/api/nightly_recharge_api.rb +142 -0
- data/lib/polar-accesslink-api-gem/api/physical_info_api.rb +296 -0
- data/lib/polar-accesslink-api-gem/api/pull_notifications_api.rb +79 -0
- data/lib/polar-accesslink-api-gem/api/sleep_api.rb +199 -0
- data/lib/polar-accesslink-api-gem/api/training_data_api.rb +785 -0
- data/lib/polar-accesslink-api-gem/api/users_api.rb +221 -0
- data/lib/polar-accesslink-api-gem/api/webhooks_api.rb +278 -0
- data/lib/polar-accesslink-api-gem/api_client.rb +390 -0
- data/lib/polar-accesslink-api-gem/api_error.rb +57 -0
- data/lib/polar-accesslink-api-gem/configuration.rb +284 -0
- data/lib/polar-accesslink-api-gem/models/activity.rb +300 -0
- data/lib/polar-accesslink-api-gem/models/activity_log.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/activity_step_sample.rb +230 -0
- data/lib/polar-accesslink-api-gem/models/activity_step_samples.rb +232 -0
- data/lib/polar-accesslink-api-gem/models/activity_zone_sample.rb +232 -0
- data/lib/polar-accesslink-api-gem/models/activity_zone_samples.rb +232 -0
- data/lib/polar-accesslink-api-gem/models/available_sleep.rb +239 -0
- data/lib/polar-accesslink-api-gem/models/available_sleeps.rb +221 -0
- data/lib/polar-accesslink-api-gem/models/available_user_data.rb +274 -0
- data/lib/polar-accesslink-api-gem/models/available_user_datas.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/created_webhook.rb +218 -0
- data/lib/polar-accesslink-api-gem/models/created_webhook_data.rb +248 -0
- data/lib/polar-accesslink-api-gem/models/duration_zone.rb +230 -0
- data/lib/polar-accesslink-api-gem/models/error.rb +260 -0
- data/lib/polar-accesslink-api-gem/models/exercise.rb +399 -0
- data/lib/polar-accesslink-api-gem/models/exercise_hash_id.rb +389 -0
- data/lib/polar-accesslink-api-gem/models/exercises.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/heart_rate.rb +230 -0
- data/lib/polar-accesslink-api-gem/models/nightly_recharge.rb +319 -0
- data/lib/polar-accesslink-api-gem/models/nights.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/physical_information.rb +364 -0
- data/lib/polar-accesslink-api-gem/models/physical_informations.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/recharges.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/register.rb +225 -0
- data/lib/polar-accesslink-api-gem/models/sample.rb +240 -0
- data/lib/polar-accesslink-api-gem/models/samples.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/sleep.rb +449 -0
- data/lib/polar-accesslink-api-gem/models/transaction_location.rb +230 -0
- data/lib/polar-accesslink-api-gem/models/user.rb +346 -0
- data/lib/polar-accesslink-api-gem/models/user_extra_info.rb +240 -0
- data/lib/polar-accesslink-api-gem/models/webhook_info.rb +218 -0
- data/lib/polar-accesslink-api-gem/models/webhook_info_data.rb +238 -0
- data/lib/polar-accesslink-api-gem/models/webhook_patch.rb +231 -0
- data/lib/polar-accesslink-api-gem/models/webhook_payload_exercise.rb +260 -0
- data/lib/polar-accesslink-api-gem/models/webhook_payload_sleep.rb +260 -0
- data/lib/polar-accesslink-api-gem/models/webhook_ping.rb +264 -0
- data/lib/polar-accesslink-api-gem/models/webhook_request.rb +241 -0
- data/lib/polar-accesslink-api-gem/models/webhook_type.rb +36 -0
- data/lib/polar-accesslink-api-gem/models/zone.rb +250 -0
- data/lib/polar-accesslink-api-gem/models/zones.rb +222 -0
- data/lib/polar-accesslink-api-gem/version.rb +15 -0
- data/lib/polar-accesslink-api-gem.rb +88 -0
- data/polar-accesslink-api-gem.gemspec +38 -0
- data/spec/api/daily_activity_api_spec.rb +114 -0
- data/spec/api/exercises_api_spec.rb +70 -0
- data/spec/api/nightly_recharge_api_spec.rb +58 -0
- data/spec/api/physical_info_api_spec.rb +87 -0
- data/spec/api/pull_notifications_api_spec.rb +46 -0
- data/spec/api/sleep_api_spec.rb +69 -0
- data/spec/api/training_data_api_spec.rb +173 -0
- data/spec/api/users_api_spec.rb +71 -0
- data/spec/api/webhooks_api_spec.rb +83 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/activity_log_spec.rb +34 -0
- data/spec/models/activity_spec.rb +82 -0
- data/spec/models/activity_step_sample_spec.rb +40 -0
- data/spec/models/activity_step_samples_spec.rb +40 -0
- data/spec/models/activity_zone_sample_spec.rb +40 -0
- data/spec/models/activity_zone_samples_spec.rb +40 -0
- data/spec/models/available_sleep_spec.rb +46 -0
- data/spec/models/available_sleeps_spec.rb +34 -0
- data/spec/models/available_user_data_spec.rb +50 -0
- data/spec/models/available_user_datas_spec.rb +34 -0
- data/spec/models/created_webhook_data_spec.rb +52 -0
- data/spec/models/created_webhook_spec.rb +34 -0
- data/spec/models/duration_zone_spec.rb +40 -0
- data/spec/models/error_spec.rb +58 -0
- data/spec/models/exercise_hash_id_spec.rb +136 -0
- data/spec/models/exercise_spec.rb +142 -0
- data/spec/models/exercises_spec.rb +34 -0
- data/spec/models/heart_rate_spec.rb +40 -0
- data/spec/models/nightly_recharge_spec.rb +94 -0
- data/spec/models/nights_spec.rb +34 -0
- data/spec/models/physical_information_spec.rb +104 -0
- data/spec/models/physical_informations_spec.rb +34 -0
- data/spec/models/recharges_spec.rb +34 -0
- data/spec/models/register_spec.rb +34 -0
- data/spec/models/sample_spec.rb +46 -0
- data/spec/models/samples_spec.rb +34 -0
- data/spec/models/sleep_spec.rb +172 -0
- data/spec/models/transaction_location_spec.rb +40 -0
- data/spec/models/user_extra_info_spec.rb +46 -0
- data/spec/models/user_spec.rb +92 -0
- data/spec/models/webhook_info_data_spec.rb +46 -0
- data/spec/models/webhook_info_spec.rb +34 -0
- data/spec/models/webhook_patch_spec.rb +40 -0
- data/spec/models/webhook_payload_exercise_spec.rb +58 -0
- data/spec/models/webhook_payload_sleep_spec.rb +58 -0
- data/spec/models/webhook_ping_spec.rb +44 -0
- data/spec/models/webhook_request_spec.rb +40 -0
- data/spec/models/webhook_type_spec.rb +28 -0
- data/spec/models/zone_spec.rb +52 -0
- data/spec/models/zones_spec.rb +34 -0
- data/spec/spec_helper.rb +111 -0
- metadata +295 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
# PolarAccesslinkApiGem::DurationZone
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **index** | **Integer** | Activity zone index | [optional] |
|
8
|
+
| **inzone** | **String** | Time duration spent in the zone ISO 8601 | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'polar-accesslink-api-gem'
|
14
|
+
|
15
|
+
instance = PolarAccesslinkApiGem::DurationZone.new(
|
16
|
+
index: 1,
|
17
|
+
inzone: PT51M5S
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/Error.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# PolarAccesslinkApiGem::Error
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **timestamp** | [**Timestamp**](Timestamp.md) | Timestamp of the error. | [optional] |
|
8
|
+
| **status** | **Integer** | Http status code | [optional] |
|
9
|
+
| **error_type** | **String** | Error type. | [optional] |
|
10
|
+
| **message** | **String** | Human readable error message. | [optional] |
|
11
|
+
| **corr_id** | **String** | Correlation id of the response for problem solving and debugging use. | [optional] |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'polar-accesslink-api-gem'
|
17
|
+
|
18
|
+
instance = PolarAccesslinkApiGem::Error.new(
|
19
|
+
timestamp: null,
|
20
|
+
status: null,
|
21
|
+
error_type: null,
|
22
|
+
message: null,
|
23
|
+
corr_id: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
data/docs/Exercise.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# PolarAccesslinkApiGem::Exercise
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **Integer** | Id of the trainining session | [optional] |
|
8
|
+
| **upload_time** | **String** | Time of the transfer from wrist unit to Polar database | [optional] |
|
9
|
+
| **polar_user** | **String** | Absolute link to Polar user owning the training | [optional] |
|
10
|
+
| **transaction_id** | **Integer** | Id of the exercise-transaction this training was transferred in | [optional] |
|
11
|
+
| **device** | **String** | Polar product used in training | [optional] |
|
12
|
+
| **start_time** | **String** | Start time of the training session in local time | [optional] |
|
13
|
+
| **duration** | **String** | The duration of the training session as specified in ISO8601 | [optional] |
|
14
|
+
| **calories** | **Integer** | Expended calories during training in kilocalories | [optional] |
|
15
|
+
| **distance** | **Float** | Distance in meters travelled during training | [optional] |
|
16
|
+
| **heart_rate** | [**HeartRate**](HeartRate.md) | | [optional] |
|
17
|
+
| **training_load** | **Float** | Training load effect to user | [optional] |
|
18
|
+
| **sport** | **String** | Sport name | [optional] |
|
19
|
+
| **has_route** | **Boolean** | Boolean indicating if the exercise has route data | [optional] |
|
20
|
+
| **club_id** | **Integer** | Has value if the exercise is from \"Flow For Club\", otherwise not printed. Value -1 indicates that there were errors finding the club | [optional] |
|
21
|
+
| **club_name** | **String** | Has value if the exercise is from \"Flow For Club\", otherwise not printed. Value \"Ambiguous club location. Please contact support.\" is printed in case of error (and the club-id is -1). | [optional] |
|
22
|
+
| **detailed_sport_info** | **String** | String containing the name of a Polar Flow-compatible sport, if one is set for the exercise. | [optional] |
|
23
|
+
| **fat_percentage** | **Integer** | Fat percentage of exercise calories. Has value if the exercise is from training device supporting Energy sources, otherwise not printed. | [optional] |
|
24
|
+
| **carbohydrate_percentage** | **Integer** | Carbohydrate percentage of exercise calories. Has value if the exercise is from training device supporting Energy sources, otherwise not printed. | [optional] |
|
25
|
+
| **protein_percentage** | **Integer** | Protein percentage of exercise calories. Has value if the exercise is from training device supporting Energy sources, otherwise not printed. | [optional] |
|
26
|
+
|
27
|
+
## Example
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'polar-accesslink-api-gem'
|
31
|
+
|
32
|
+
instance = PolarAccesslinkApiGem::Exercise.new(
|
33
|
+
id: 1937529874,
|
34
|
+
upload_time: 2008-10-13T10:40:02.000Z,
|
35
|
+
polar_user: https://www.polaraccesslink/v3/users/1,
|
36
|
+
transaction_id: 179879,
|
37
|
+
device: Polar M400,
|
38
|
+
start_time: 2008-10-13T10:40:02.000Z,
|
39
|
+
duration: PT2H44M,
|
40
|
+
calories: 530,
|
41
|
+
distance: 1600,
|
42
|
+
heart_rate: null,
|
43
|
+
training_load: 143.22,
|
44
|
+
sport: OTHER,
|
45
|
+
has_route: true,
|
46
|
+
club_id: 999,
|
47
|
+
club_name: Polar Club,
|
48
|
+
detailed_sport_info: WATERSPORTS_WATERSKI,
|
49
|
+
fat_percentage: 60,
|
50
|
+
carbohydrate_percentage: 38,
|
51
|
+
protein_percentage: 2
|
52
|
+
)
|
53
|
+
```
|
54
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# PolarAccesslinkApiGem::ExerciseHashId
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | Hashed id of the trainining session | [optional] |
|
8
|
+
| **upload_time** | **String** | Time of the transfer from wrist unit to Polar database | [optional] |
|
9
|
+
| **polar_user** | **String** | Absolute link to Polar user owning the training | [optional] |
|
10
|
+
| **device** | **String** | Polar product used in training | [optional] |
|
11
|
+
| **start_time** | **String** | Start time of the training session in local time | [optional] |
|
12
|
+
| **duration** | **String** | The duration of the training session as specified in ISO8601 | [optional] |
|
13
|
+
| **calories** | **Integer** | Expended calories during training in kilocalories | [optional] |
|
14
|
+
| **distance** | **Float** | Distance in meters travelled during training | [optional] |
|
15
|
+
| **heart_rate** | [**HeartRate**](HeartRate.md) | | [optional] |
|
16
|
+
| **training_load** | **Float** | Training load effect to user | [optional] |
|
17
|
+
| **sport** | **String** | Sport name | [optional] |
|
18
|
+
| **has_route** | **Boolean** | Boolean indicating if the exercise has route data | [optional] |
|
19
|
+
| **club_id** | **Integer** | Has value if the exercise is from \"Flow For Club\", otherwise not printed. Value -1 indicates that there were errors finding the club | [optional] |
|
20
|
+
| **club_name** | **String** | Has value if the exercise is from \"Flow For Club\", otherwise not printed. Value \"Ambiguous club location. Please contact support.\" is printed in case of error (and the club-id is -1). | [optional] |
|
21
|
+
| **detailed_sport_info** | **String** | String containing the name of a Polar Flow-compatible sport, if one is set for the exercise. | [optional] |
|
22
|
+
| **fat_percentage** | **Integer** | Fat percentage of exercise calories. Has value if the exercise is from training device supporting Energy sources, otherwise not printed. | [optional] |
|
23
|
+
| **carbohydrate_percentage** | **Integer** | Carbohydrate percentage of exercise calories. Has value if the exercise is from training device supporting Energy sources, otherwise not printed. | [optional] |
|
24
|
+
| **protein_percentage** | **Integer** | Protein percentage of exercise calories. Has value if the exercise is from training device supporting Energy sources, otherwise not printed. | [optional] |
|
25
|
+
|
26
|
+
## Example
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'polar-accesslink-api-gem'
|
30
|
+
|
31
|
+
instance = PolarAccesslinkApiGem::ExerciseHashId.new(
|
32
|
+
id: 2AC312F,
|
33
|
+
upload_time: 2008-10-13T10:40:02.000Z,
|
34
|
+
polar_user: https://www.polaraccesslink/v3/users/1,
|
35
|
+
device: Polar M400,
|
36
|
+
start_time: 2008-10-13T10:40:02.000,
|
37
|
+
duration: PT2H44M,
|
38
|
+
calories: 530,
|
39
|
+
distance: 1600,
|
40
|
+
heart_rate: null,
|
41
|
+
training_load: 143.22,
|
42
|
+
sport: OTHER,
|
43
|
+
has_route: true,
|
44
|
+
club_id: 999,
|
45
|
+
club_name: Polar Club,
|
46
|
+
detailed_sport_info: WATERSPORTS_WATERSKI,
|
47
|
+
fat_percentage: 60,
|
48
|
+
carbohydrate_percentage: 38,
|
49
|
+
protein_percentage: 2
|
50
|
+
)
|
51
|
+
```
|
52
|
+
|
data/docs/Exercises.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# PolarAccesslinkApiGem::Exercises
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **exercises** | **Array<String>** | Absolute links to individual exercises within the transaction | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'polar-accesslink-api-gem'
|
13
|
+
|
14
|
+
instance = PolarAccesslinkApiGem::Exercises.new(
|
15
|
+
exercises: ["https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56","https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/120"]
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,214 @@
|
|
1
|
+
# PolarAccesslinkApiGem::ExercisesApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://www.polaraccesslink.com*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**get_exercise_fit_without_transaction**](ExercisesApi.md#get_exercise_fit_without_transaction) | **GET** /v3/exercises/{exerciseId}/fit | Get exercise FIT |
|
8
|
+
| [**get_exercise_without_transaction**](ExercisesApi.md#get_exercise_without_transaction) | **GET** /v3/exercises/{exerciseId} | Get exercise |
|
9
|
+
| [**list_exercises_without_transaction**](ExercisesApi.md#list_exercises_without_transaction) | **GET** /v3/exercises | List exercises |
|
10
|
+
|
11
|
+
|
12
|
+
## get_exercise_fit_without_transaction
|
13
|
+
|
14
|
+
> String get_exercise_fit_without_transaction(exercise_id)
|
15
|
+
|
16
|
+
Get exercise FIT
|
17
|
+
|
18
|
+
FIT file for users exercise.
|
19
|
+
|
20
|
+
### Examples
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require 'time'
|
24
|
+
require 'polar-accesslink-api-gem'
|
25
|
+
# setup authorization
|
26
|
+
PolarAccesslinkApiGem.configure do |config|
|
27
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
28
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
29
|
+
end
|
30
|
+
|
31
|
+
api_instance = PolarAccesslinkApiGem::ExercisesApi.new
|
32
|
+
exercise_id = 'exercise_id_example' # String | Hashed exercise id.
|
33
|
+
|
34
|
+
begin
|
35
|
+
# Get exercise FIT
|
36
|
+
result = api_instance.get_exercise_fit_without_transaction(exercise_id)
|
37
|
+
p result
|
38
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
39
|
+
puts "Error when calling ExercisesApi->get_exercise_fit_without_transaction: #{e}"
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
#### Using the get_exercise_fit_without_transaction_with_http_info variant
|
44
|
+
|
45
|
+
This returns an Array which contains the response data, status code and headers.
|
46
|
+
|
47
|
+
> <Array(String, Integer, Hash)> get_exercise_fit_without_transaction_with_http_info(exercise_id)
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
begin
|
51
|
+
# Get exercise FIT
|
52
|
+
data, status_code, headers = api_instance.get_exercise_fit_without_transaction_with_http_info(exercise_id)
|
53
|
+
p status_code # => 2xx
|
54
|
+
p headers # => { ... }
|
55
|
+
p data # => String
|
56
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
57
|
+
puts "Error when calling ExercisesApi->get_exercise_fit_without_transaction_with_http_info: #{e}"
|
58
|
+
end
|
59
|
+
```
|
60
|
+
|
61
|
+
### Parameters
|
62
|
+
|
63
|
+
| Name | Type | Description | Notes |
|
64
|
+
| ---- | ---- | ----------- | ----- |
|
65
|
+
| **exercise_id** | **String** | Hashed exercise id. | |
|
66
|
+
|
67
|
+
### Return type
|
68
|
+
|
69
|
+
**String**
|
70
|
+
|
71
|
+
### Authorization
|
72
|
+
|
73
|
+
[OAuth2](../README.md#OAuth2)
|
74
|
+
|
75
|
+
### HTTP request headers
|
76
|
+
|
77
|
+
- **Content-Type**: Not defined
|
78
|
+
- **Accept**: */*
|
79
|
+
|
80
|
+
|
81
|
+
## get_exercise_without_transaction
|
82
|
+
|
83
|
+
> <ExerciseHashId> get_exercise_without_transaction(exercise_id)
|
84
|
+
|
85
|
+
Get exercise
|
86
|
+
|
87
|
+
Get users exercise using hashed id.
|
88
|
+
|
89
|
+
### Examples
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
require 'time'
|
93
|
+
require 'polar-accesslink-api-gem'
|
94
|
+
# setup authorization
|
95
|
+
PolarAccesslinkApiGem.configure do |config|
|
96
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
97
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
98
|
+
end
|
99
|
+
|
100
|
+
api_instance = PolarAccesslinkApiGem::ExercisesApi.new
|
101
|
+
exercise_id = 'exercise_id_example' # String | Hashed exercise id.
|
102
|
+
|
103
|
+
begin
|
104
|
+
# Get exercise
|
105
|
+
result = api_instance.get_exercise_without_transaction(exercise_id)
|
106
|
+
p result
|
107
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
108
|
+
puts "Error when calling ExercisesApi->get_exercise_without_transaction: #{e}"
|
109
|
+
end
|
110
|
+
```
|
111
|
+
|
112
|
+
#### Using the get_exercise_without_transaction_with_http_info variant
|
113
|
+
|
114
|
+
This returns an Array which contains the response data, status code and headers.
|
115
|
+
|
116
|
+
> <Array(<ExerciseHashId>, Integer, Hash)> get_exercise_without_transaction_with_http_info(exercise_id)
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
begin
|
120
|
+
# Get exercise
|
121
|
+
data, status_code, headers = api_instance.get_exercise_without_transaction_with_http_info(exercise_id)
|
122
|
+
p status_code # => 2xx
|
123
|
+
p headers # => { ... }
|
124
|
+
p data # => <ExerciseHashId>
|
125
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
126
|
+
puts "Error when calling ExercisesApi->get_exercise_without_transaction_with_http_info: #{e}"
|
127
|
+
end
|
128
|
+
```
|
129
|
+
|
130
|
+
### Parameters
|
131
|
+
|
132
|
+
| Name | Type | Description | Notes |
|
133
|
+
| ---- | ---- | ----------- | ----- |
|
134
|
+
| **exercise_id** | **String** | Hashed exercise id. | |
|
135
|
+
|
136
|
+
### Return type
|
137
|
+
|
138
|
+
[**ExerciseHashId**](ExerciseHashId.md)
|
139
|
+
|
140
|
+
### Authorization
|
141
|
+
|
142
|
+
[OAuth2](../README.md#OAuth2)
|
143
|
+
|
144
|
+
### HTTP request headers
|
145
|
+
|
146
|
+
- **Content-Type**: Not defined
|
147
|
+
- **Accept**: application/json
|
148
|
+
|
149
|
+
|
150
|
+
## list_exercises_without_transaction
|
151
|
+
|
152
|
+
> <Array<ExerciseHashId>> list_exercises_without_transaction
|
153
|
+
|
154
|
+
List exercises
|
155
|
+
|
156
|
+
List users exercises available in Accesslink.
|
157
|
+
|
158
|
+
### Examples
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
require 'time'
|
162
|
+
require 'polar-accesslink-api-gem'
|
163
|
+
# setup authorization
|
164
|
+
PolarAccesslinkApiGem.configure do |config|
|
165
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
166
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
167
|
+
end
|
168
|
+
|
169
|
+
api_instance = PolarAccesslinkApiGem::ExercisesApi.new
|
170
|
+
|
171
|
+
begin
|
172
|
+
# List exercises
|
173
|
+
result = api_instance.list_exercises_without_transaction
|
174
|
+
p result
|
175
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
176
|
+
puts "Error when calling ExercisesApi->list_exercises_without_transaction: #{e}"
|
177
|
+
end
|
178
|
+
```
|
179
|
+
|
180
|
+
#### Using the list_exercises_without_transaction_with_http_info variant
|
181
|
+
|
182
|
+
This returns an Array which contains the response data, status code and headers.
|
183
|
+
|
184
|
+
> <Array(<Array<ExerciseHashId>>, Integer, Hash)> list_exercises_without_transaction_with_http_info
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
begin
|
188
|
+
# List exercises
|
189
|
+
data, status_code, headers = api_instance.list_exercises_without_transaction_with_http_info
|
190
|
+
p status_code # => 2xx
|
191
|
+
p headers # => { ... }
|
192
|
+
p data # => <Array<ExerciseHashId>>
|
193
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
194
|
+
puts "Error when calling ExercisesApi->list_exercises_without_transaction_with_http_info: #{e}"
|
195
|
+
end
|
196
|
+
```
|
197
|
+
|
198
|
+
### Parameters
|
199
|
+
|
200
|
+
This endpoint does not need any parameter.
|
201
|
+
|
202
|
+
### Return type
|
203
|
+
|
204
|
+
[**Array<ExerciseHashId>**](ExerciseHashId.md)
|
205
|
+
|
206
|
+
### Authorization
|
207
|
+
|
208
|
+
[OAuth2](../README.md#OAuth2)
|
209
|
+
|
210
|
+
### HTTP request headers
|
211
|
+
|
212
|
+
- **Content-Type**: Not defined
|
213
|
+
- **Accept**: application/json
|
214
|
+
|
data/docs/HeartRate.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# PolarAccesslinkApiGem::HeartRate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **average** | **Integer** | Average heart-rate | [optional] |
|
8
|
+
| **maximum** | **Integer** | Maximum heart-rate | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'polar-accesslink-api-gem'
|
14
|
+
|
15
|
+
instance = PolarAccesslinkApiGem::HeartRate.new(
|
16
|
+
average: 129,
|
17
|
+
maximum: 147
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# PolarAccesslinkApiGem::NightlyRecharge
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **polar_user** | **String** | Absolute link to user owning the sleep | [optional] |
|
8
|
+
| **date** | **Date** | Result date of the Nightly Recharge | [optional] |
|
9
|
+
| **heart_rate_avg** | **Integer** | Average heart rate as beats per minute (bpm) during a 4-hour period starting at 30 minutes after falling asleep. | [optional] |
|
10
|
+
| **beat_to_beat_avg** | **Integer** | Average time in milliseconds (ms) between successive heart beats during a 4-hour period starting at 30 minutes after falling asleep. | [optional] |
|
11
|
+
| **heart_rate_variability_avg** | **Integer** | Average variation in the time in milliseconds (ms) between successive heart beats during a 4-hour period starting at 30 minutes after falling asleep. The Heart rate variability is Root Mean Square of Successive Differences (RMSSD) in beat-to-beat intervals. | [optional] |
|
12
|
+
| **breathing_rate_avg** | **Float** | Average breathing rate as breaths per minute (bpm) during a 4-hour period starting at 30 minutes after falling asleep. | [optional] |
|
13
|
+
| **nightly_recharge_status** | **Integer** | The Nightly Recharge status shows how your body was able to recover from training and stress during the night. Scores for both ANS charge and sleep charge are taken into account. Nightly Recharge status has the following (6-item) scale: very poor (1) – poor (2) – compromised (3) – OK (4) – good (5) – very good (6). | [optional] |
|
14
|
+
| **ans_charge** | **Float** | ANS stands for autonomic nervous system. ANS charge is formed by measuring heart rate, heart rate variability and breathing rate during roughly the first four hours of your sleep. It is formed comparing your last night to your usual levels from the past 28 days. The scale is from -10.0 to +10.0. Around zero is your usual level. | [optional] |
|
15
|
+
| **ans_charge_status** | **Integer** | ANS charge status = much below usual (1) - below usual (2) - usual (3) - above usual (4) - much above usual (5) | [optional] |
|
16
|
+
| **hrv_samples** | **Object** | 5-minute average samples of heart rate variability. Unit of samples is milliseconds(ms). You can request access to this data at https://www.polar.com/en/science/polar-accesslink-api-extended-content | [optional] |
|
17
|
+
| **breathing_samples** | **Object** | 5-minute average samples of breathing rate. Unit of samples is breaths per minute (bpm). You can request access to this data at https://www.polar.com/en/science/polar-accesslink-api-extended-content | [optional] |
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'polar-accesslink-api-gem'
|
23
|
+
|
24
|
+
instance = PolarAccesslinkApiGem::NightlyRecharge.new(
|
25
|
+
polar_user: https://www.polaraccesslink/v3/users/1,
|
26
|
+
date: Wed Jan 01 01:00:00 CET 2020,
|
27
|
+
heart_rate_avg: 70,
|
28
|
+
beat_to_beat_avg: 816,
|
29
|
+
heart_rate_variability_avg: 28,
|
30
|
+
breathing_rate_avg: 14.1,
|
31
|
+
nightly_recharge_status: 3,
|
32
|
+
ans_charge: 0.0,
|
33
|
+
ans_charge_status: 3,
|
34
|
+
hrv_samples: {"00:41":14,"00:46":14,"00:51":15},
|
35
|
+
breathing_samples: {"00:39":13.4,"00:44":13.5,"00:49":13.5}
|
36
|
+
)
|
37
|
+
```
|
38
|
+
|