polar-accesslink-api-gem 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +182 -0
  4. data/Rakefile +10 -0
  5. data/docs/Activity.md +34 -0
  6. data/docs/ActivityLog.md +18 -0
  7. data/docs/ActivityStepSample.md +20 -0
  8. data/docs/ActivityStepSamples.md +20 -0
  9. data/docs/ActivityZoneSample.md +20 -0
  10. data/docs/ActivityZoneSamples.md +20 -0
  11. data/docs/AvailableSleep.md +22 -0
  12. data/docs/AvailableSleeps.md +18 -0
  13. data/docs/AvailableUserData.md +22 -0
  14. data/docs/AvailableUserDatas.md +18 -0
  15. data/docs/CreatedWebhook.md +18 -0
  16. data/docs/CreatedWebhookData.md +24 -0
  17. data/docs/DailyActivityApi.md +440 -0
  18. data/docs/DurationZone.md +20 -0
  19. data/docs/Error.md +26 -0
  20. data/docs/Exercise.md +54 -0
  21. data/docs/ExerciseHashId.md +52 -0
  22. data/docs/Exercises.md +18 -0
  23. data/docs/ExercisesApi.md +214 -0
  24. data/docs/HeartRate.md +20 -0
  25. data/docs/NightlyRecharge.md +38 -0
  26. data/docs/NightlyRechargeApi.md +144 -0
  27. data/docs/Nights.md +18 -0
  28. data/docs/PhysicalInfoApi.md +294 -0
  29. data/docs/PhysicalInformation.md +40 -0
  30. data/docs/PhysicalInformations.md +18 -0
  31. data/docs/PullNotificationsApi.md +75 -0
  32. data/docs/Recharges.md +18 -0
  33. data/docs/Register.md +18 -0
  34. data/docs/Sample.md +22 -0
  35. data/docs/Samples.md +18 -0
  36. data/docs/Sleep.md +64 -0
  37. data/docs/SleepApi.md +211 -0
  38. data/docs/TrainingDataApi.md +744 -0
  39. data/docs/TransactionLocation.md +20 -0
  40. data/docs/User.md +36 -0
  41. data/docs/UserExtraInfo.md +22 -0
  42. data/docs/UsersApi.md +216 -0
  43. data/docs/WebhookInfo.md +18 -0
  44. data/docs/WebhookInfoData.md +22 -0
  45. data/docs/WebhookPatch.md +20 -0
  46. data/docs/WebhookPayloadExercise.md +26 -0
  47. data/docs/WebhookPayloadSleep.md +26 -0
  48. data/docs/WebhookPing.md +20 -0
  49. data/docs/WebhookRequest.md +20 -0
  50. data/docs/WebhookType.md +15 -0
  51. data/docs/WebhooksApi.md +289 -0
  52. data/docs/Zone.md +24 -0
  53. data/docs/Zones.md +18 -0
  54. data/git_push.sh +58 -0
  55. data/lib/polar-accesslink-api-gem/api/daily_activity_api.rb +469 -0
  56. data/lib/polar-accesslink-api-gem/api/exercises_api.rb +205 -0
  57. data/lib/polar-accesslink-api-gem/api/nightly_recharge_api.rb +142 -0
  58. data/lib/polar-accesslink-api-gem/api/physical_info_api.rb +296 -0
  59. data/lib/polar-accesslink-api-gem/api/pull_notifications_api.rb +79 -0
  60. data/lib/polar-accesslink-api-gem/api/sleep_api.rb +199 -0
  61. data/lib/polar-accesslink-api-gem/api/training_data_api.rb +785 -0
  62. data/lib/polar-accesslink-api-gem/api/users_api.rb +221 -0
  63. data/lib/polar-accesslink-api-gem/api/webhooks_api.rb +278 -0
  64. data/lib/polar-accesslink-api-gem/api_client.rb +390 -0
  65. data/lib/polar-accesslink-api-gem/api_error.rb +57 -0
  66. data/lib/polar-accesslink-api-gem/configuration.rb +284 -0
  67. data/lib/polar-accesslink-api-gem/models/activity.rb +300 -0
  68. data/lib/polar-accesslink-api-gem/models/activity_log.rb +222 -0
  69. data/lib/polar-accesslink-api-gem/models/activity_step_sample.rb +230 -0
  70. data/lib/polar-accesslink-api-gem/models/activity_step_samples.rb +232 -0
  71. data/lib/polar-accesslink-api-gem/models/activity_zone_sample.rb +232 -0
  72. data/lib/polar-accesslink-api-gem/models/activity_zone_samples.rb +232 -0
  73. data/lib/polar-accesslink-api-gem/models/available_sleep.rb +239 -0
  74. data/lib/polar-accesslink-api-gem/models/available_sleeps.rb +221 -0
  75. data/lib/polar-accesslink-api-gem/models/available_user_data.rb +274 -0
  76. data/lib/polar-accesslink-api-gem/models/available_user_datas.rb +222 -0
  77. data/lib/polar-accesslink-api-gem/models/created_webhook.rb +218 -0
  78. data/lib/polar-accesslink-api-gem/models/created_webhook_data.rb +248 -0
  79. data/lib/polar-accesslink-api-gem/models/duration_zone.rb +230 -0
  80. data/lib/polar-accesslink-api-gem/models/error.rb +260 -0
  81. data/lib/polar-accesslink-api-gem/models/exercise.rb +399 -0
  82. data/lib/polar-accesslink-api-gem/models/exercise_hash_id.rb +389 -0
  83. data/lib/polar-accesslink-api-gem/models/exercises.rb +222 -0
  84. data/lib/polar-accesslink-api-gem/models/heart_rate.rb +230 -0
  85. data/lib/polar-accesslink-api-gem/models/nightly_recharge.rb +319 -0
  86. data/lib/polar-accesslink-api-gem/models/nights.rb +222 -0
  87. data/lib/polar-accesslink-api-gem/models/physical_information.rb +364 -0
  88. data/lib/polar-accesslink-api-gem/models/physical_informations.rb +222 -0
  89. data/lib/polar-accesslink-api-gem/models/recharges.rb +222 -0
  90. data/lib/polar-accesslink-api-gem/models/register.rb +225 -0
  91. data/lib/polar-accesslink-api-gem/models/sample.rb +240 -0
  92. data/lib/polar-accesslink-api-gem/models/samples.rb +222 -0
  93. data/lib/polar-accesslink-api-gem/models/sleep.rb +449 -0
  94. data/lib/polar-accesslink-api-gem/models/transaction_location.rb +230 -0
  95. data/lib/polar-accesslink-api-gem/models/user.rb +346 -0
  96. data/lib/polar-accesslink-api-gem/models/user_extra_info.rb +240 -0
  97. data/lib/polar-accesslink-api-gem/models/webhook_info.rb +218 -0
  98. data/lib/polar-accesslink-api-gem/models/webhook_info_data.rb +238 -0
  99. data/lib/polar-accesslink-api-gem/models/webhook_patch.rb +231 -0
  100. data/lib/polar-accesslink-api-gem/models/webhook_payload_exercise.rb +260 -0
  101. data/lib/polar-accesslink-api-gem/models/webhook_payload_sleep.rb +260 -0
  102. data/lib/polar-accesslink-api-gem/models/webhook_ping.rb +264 -0
  103. data/lib/polar-accesslink-api-gem/models/webhook_request.rb +241 -0
  104. data/lib/polar-accesslink-api-gem/models/webhook_type.rb +36 -0
  105. data/lib/polar-accesslink-api-gem/models/zone.rb +250 -0
  106. data/lib/polar-accesslink-api-gem/models/zones.rb +222 -0
  107. data/lib/polar-accesslink-api-gem/version.rb +15 -0
  108. data/lib/polar-accesslink-api-gem.rb +88 -0
  109. data/polar-accesslink-api-gem.gemspec +38 -0
  110. data/spec/api/daily_activity_api_spec.rb +114 -0
  111. data/spec/api/exercises_api_spec.rb +70 -0
  112. data/spec/api/nightly_recharge_api_spec.rb +58 -0
  113. data/spec/api/physical_info_api_spec.rb +87 -0
  114. data/spec/api/pull_notifications_api_spec.rb +46 -0
  115. data/spec/api/sleep_api_spec.rb +69 -0
  116. data/spec/api/training_data_api_spec.rb +173 -0
  117. data/spec/api/users_api_spec.rb +71 -0
  118. data/spec/api/webhooks_api_spec.rb +83 -0
  119. data/spec/api_client_spec.rb +226 -0
  120. data/spec/configuration_spec.rb +42 -0
  121. data/spec/models/activity_log_spec.rb +34 -0
  122. data/spec/models/activity_spec.rb +82 -0
  123. data/spec/models/activity_step_sample_spec.rb +40 -0
  124. data/spec/models/activity_step_samples_spec.rb +40 -0
  125. data/spec/models/activity_zone_sample_spec.rb +40 -0
  126. data/spec/models/activity_zone_samples_spec.rb +40 -0
  127. data/spec/models/available_sleep_spec.rb +46 -0
  128. data/spec/models/available_sleeps_spec.rb +34 -0
  129. data/spec/models/available_user_data_spec.rb +50 -0
  130. data/spec/models/available_user_datas_spec.rb +34 -0
  131. data/spec/models/created_webhook_data_spec.rb +52 -0
  132. data/spec/models/created_webhook_spec.rb +34 -0
  133. data/spec/models/duration_zone_spec.rb +40 -0
  134. data/spec/models/error_spec.rb +58 -0
  135. data/spec/models/exercise_hash_id_spec.rb +136 -0
  136. data/spec/models/exercise_spec.rb +142 -0
  137. data/spec/models/exercises_spec.rb +34 -0
  138. data/spec/models/heart_rate_spec.rb +40 -0
  139. data/spec/models/nightly_recharge_spec.rb +94 -0
  140. data/spec/models/nights_spec.rb +34 -0
  141. data/spec/models/physical_information_spec.rb +104 -0
  142. data/spec/models/physical_informations_spec.rb +34 -0
  143. data/spec/models/recharges_spec.rb +34 -0
  144. data/spec/models/register_spec.rb +34 -0
  145. data/spec/models/sample_spec.rb +46 -0
  146. data/spec/models/samples_spec.rb +34 -0
  147. data/spec/models/sleep_spec.rb +172 -0
  148. data/spec/models/transaction_location_spec.rb +40 -0
  149. data/spec/models/user_extra_info_spec.rb +46 -0
  150. data/spec/models/user_spec.rb +92 -0
  151. data/spec/models/webhook_info_data_spec.rb +46 -0
  152. data/spec/models/webhook_info_spec.rb +34 -0
  153. data/spec/models/webhook_patch_spec.rb +40 -0
  154. data/spec/models/webhook_payload_exercise_spec.rb +58 -0
  155. data/spec/models/webhook_payload_sleep_spec.rb +58 -0
  156. data/spec/models/webhook_ping_spec.rb +44 -0
  157. data/spec/models/webhook_request_spec.rb +40 -0
  158. data/spec/models/webhook_type_spec.rb +28 -0
  159. data/spec/models/zone_spec.rb +52 -0
  160. data/spec/models/zones_spec.rb +34 -0
  161. data/spec/spec_helper.rb +111 -0
  162. metadata +295 -0
@@ -0,0 +1,40 @@
1
+ # PolarAccesslinkApiGem::PhysicalInformation
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **Integer** | Physical information id | [optional] |
8
+ | **transaction_id** | **Integer** | Id of the physical-information-transaction this training was transferred in | [optional] |
9
+ | **created** | **String** | The time physical information was created in Accesslink, in format YYYY-MM-DDTHH:mm:ss.SSSZ | [optional] |
10
+ | **polar_user** | **String** | Absolute link to user owning the activity | [optional] |
11
+ | **weight** | **Float** | Weight | [optional] |
12
+ | **height** | **Float** | Height | [optional] |
13
+ | **maximum_heart_rate** | **Integer** | Maximum heart rate | [optional] |
14
+ | **resting_heart_rate** | **Integer** | Resting hear rate | [optional] |
15
+ | **aerobic_threshold** | **Integer** | Aerobic threshold | [optional] |
16
+ | **anaerobic_threshold** | **Integer** | Anaerobic threshold | [optional] |
17
+ | **vo2_max** | **Integer** | VO2 max | [optional] |
18
+ | **weight_source** | **String** | Weight source | [optional] |
19
+
20
+ ## Example
21
+
22
+ ```ruby
23
+ require 'polar-accesslink-api-gem'
24
+
25
+ instance = PolarAccesslinkApiGem::PhysicalInformation.new(
26
+ id: 123,
27
+ transaction_id: 179879,
28
+ created: 2016-04-27T20:11:33.000Z,
29
+ polar_user: https://www.polaraccesslink/v3/users/1,
30
+ weight: 80,
31
+ height: 180,
32
+ maximum_heart_rate: 160,
33
+ resting_heart_rate: 60,
34
+ aerobic_threshold: 123,
35
+ anaerobic_threshold: 123,
36
+ vo2_max: 12,
37
+ weight_source: SOURCE_MEASURED
38
+ )
39
+ ```
40
+
@@ -0,0 +1,18 @@
1
+ # PolarAccesslinkApiGem::PhysicalInformations
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **physical_informations** | **Array<String>** | Absolute links to individual physical information within the transaction | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'polar-accesslink-api-gem'
13
+
14
+ instance = PolarAccesslinkApiGem::PhysicalInformations.new(
15
+ physical_informations: ["https://www.polaraccesslink.com/v3/users/12/physical-information-transactions/12/physical-informations/56","https://www.polaraccesslink.com/v3/users/12/physical-information-transactions/12/physical-informations/120"]
16
+ )
17
+ ```
18
+
@@ -0,0 +1,75 @@
1
+ # PolarAccesslinkApiGem::PullNotificationsApi
2
+
3
+ All URIs are relative to *https://www.polaraccesslink.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**list**](PullNotificationsApi.md#list) | **GET** /v3/notifications | List |
8
+
9
+
10
+ ## list
11
+
12
+ > <AvailableUserDatas> list
13
+
14
+ List
15
+
16
+ Get list of available exercises and activities for users
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'polar-accesslink-api-gem'
23
+ # setup authorization
24
+ PolarAccesslinkApiGem.configure do |config|
25
+ # Configure HTTP basic authorization: Basic
26
+ config.username = 'YOUR USERNAME'
27
+ config.password = 'YOUR PASSWORD'
28
+ end
29
+
30
+ api_instance = PolarAccesslinkApiGem::PullNotificationsApi.new
31
+
32
+ begin
33
+ # List
34
+ result = api_instance.list
35
+ p result
36
+ rescue PolarAccesslinkApiGem::ApiError => e
37
+ puts "Error when calling PullNotificationsApi->list: #{e}"
38
+ end
39
+ ```
40
+
41
+ #### Using the list_with_http_info variant
42
+
43
+ This returns an Array which contains the response data, status code and headers.
44
+
45
+ > <Array(<AvailableUserDatas>, Integer, Hash)> list_with_http_info
46
+
47
+ ```ruby
48
+ begin
49
+ # List
50
+ data, status_code, headers = api_instance.list_with_http_info
51
+ p status_code # => 2xx
52
+ p headers # => { ... }
53
+ p data # => <AvailableUserDatas>
54
+ rescue PolarAccesslinkApiGem::ApiError => e
55
+ puts "Error when calling PullNotificationsApi->list_with_http_info: #{e}"
56
+ end
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+ This endpoint does not need any parameter.
62
+
63
+ ### Return type
64
+
65
+ [**AvailableUserDatas**](AvailableUserDatas.md)
66
+
67
+ ### Authorization
68
+
69
+ [Basic](../README.md#Basic)
70
+
71
+ ### HTTP request headers
72
+
73
+ - **Content-Type**: Not defined
74
+ - **Accept**: application/json, application/xml
75
+
data/docs/Recharges.md ADDED
@@ -0,0 +1,18 @@
1
+ # PolarAccesslinkApiGem::Recharges
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **recharges** | [**Array&lt;NightlyRecharge&gt;**](NightlyRecharge.md) | List of Nightly Recharge objects | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'polar-accesslink-api-gem'
13
+
14
+ instance = PolarAccesslinkApiGem::Recharges.new(
15
+ recharges: null
16
+ )
17
+ ```
18
+
data/docs/Register.md ADDED
@@ -0,0 +1,18 @@
1
+ # PolarAccesslinkApiGem::Register
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **member_id** | **String** | Partner&#39;s custom identifier for user. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'polar-accesslink-api-gem'
13
+
14
+ instance = PolarAccesslinkApiGem::Register.new(
15
+ member_id: User_id_999
16
+ )
17
+ ```
18
+
data/docs/Sample.md ADDED
@@ -0,0 +1,22 @@
1
+ # PolarAccesslinkApiGem::Sample
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **recording_rate** | **Integer** | Sample recording rate in seconds. Null when recording rate is not applicable - currently only with RR-data. | [optional] |
8
+ | **sample_type** | **String** | Sample type | [optional] |
9
+ | **data** | **String** | Sample values as a comma-separated list of strings. Can contain null -values which indicate a situtation where sensor was offline. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'polar-accesslink-api-gem'
15
+
16
+ instance = PolarAccesslinkApiGem::Sample.new(
17
+ recording_rate: 5,
18
+ sample_type: null,
19
+ data: 0,100,102,97,97,101,103,106,96,89,88,87,98,108,113,112,114,115,118,121,121,121,121,123,117,119,122
20
+ )
21
+ ```
22
+
data/docs/Samples.md ADDED
@@ -0,0 +1,18 @@
1
+ # PolarAccesslinkApiGem::Samples
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **sample** | **Array&lt;String&gt;** | List of URIs pointing to single sample type data. | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'polar-accesslink-api-gem'
13
+
14
+ instance = PolarAccesslinkApiGem::Samples.new(
15
+ sample: [&quot;https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/0&quot;,&quot;https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/3&quot;]
16
+ )
17
+ ```
18
+
data/docs/Sleep.md ADDED
@@ -0,0 +1,64 @@
1
+ # PolarAccesslinkApiGem::Sleep
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 sleep | [optional] |
9
+ | **sleep_start_time** | **Time** | Start timestamp of the sleep as ISO-8601 datetime string | [optional] |
10
+ | **sleep_end_time** | **Time** | End timestamp of the sleep as ISO-8601 datetime string | [optional] |
11
+ | **device_id** | **String** | Id of the device the sleep was measured with | [optional] |
12
+ | **continuity** | **Float** | Continuity is an estimate of how continuous the sleep was on a scale of 1.0 – 5.0, where 5.0 reflects uninterrupted sleep. The lower the value the more fragmented the sleep was. | [optional] |
13
+ | **continuity_class** | **Integer** | Verbal assessments of sleep continuity Very continuous sleep (5) Continuous sleep (4) Fairly continuous sleep (3) Fairly fragmented sleep (2) Fragmented sleep (1) | [optional] |
14
+ | **light_sleep** | **Integer** | Total time in seconds spent in light sleep stage between when you fell asleep and when you woke up. Corresponds to N1+ N2 according to AASM classification. | [optional] |
15
+ | **deep_sleep** | **Integer** | Total time in seconds spent in the deep sleep stage between when you fell asleep and when you woke up. Corresponds to N3 according to AASM classification. | [optional] |
16
+ | **rem_sleep** | **Integer** | Total time in seconds spent in REM sleep stage between when you fell asleep and when you woke up. REM stands for rapid eye movement. | [optional] |
17
+ | **unrecognized_sleep_stage** | **Integer** | Total time in seconds spent in unrecognised sleep stage. Sometimes it&#39;s impossible to recognize sleep stages. This might happen when, for example, the wrist strap is not tight enough, or if you sleep on your hand. | [optional] |
18
+ | **sleep_score** | **Integer** | Sleep score summarizes the amount and quality of your sleep into a single number on a scale of 1 – 100. Sleep score tells you how well you slept compared to the indicators of a good night&#39;s sleep based on the current sleep science. It consists of six components; sleep time, long interruptions, continuity, actual sleep, REM sleep, and deep sleep. | [optional] |
19
+ | **total_interruption_duration** | **Integer** | The total time in seconds you spent awake between when you fell asleep and when you woke up. | [optional] |
20
+ | **sleep_charge** | **Integer** | Sleep score compared to your usual level from the past 28 days.Scale: much below usual (1) – below usual (2) – usual (3) – above usual (4) – much above usual(5). | [optional] |
21
+ | **sleep_goal** | **Integer** | Time goal in seconds for sleep selectedby user. A default value of the setting is based on age-related sleep duration recommendations. | [optional] |
22
+ | **sleep_rating** | **Integer** | Numeric value given by user for representing the quality of sleep. Selection scale: Very poorly(1), poorly(2), ok(3), well(4), very well(5). 0 means no value is given. | [optional] |
23
+ | **short_interruption_duration** | **Integer** | Total time in seconds of short interruptions. Short interruption is interruption in sleep of less than 90 seconds. | [optional] |
24
+ | **long_interruption_duration** | **Integer** | Total time in seconds of long interruptions. Long interruption is interruption in sleep of 90 seconds or more. | [optional] |
25
+ | **sleep_cycles** | **Integer** | Number of sleep cycles. | [optional] |
26
+ | **group_duration_score** | **Float** | Sleep score consists of six components that are grouped under three themes. Score for sleep duration theme looks at your sleep time compared to your ‘preferred sleep time’ setting and the age-related duration recommendations. Group duration score ranges from 1.0 to 100.0. It is interpreted as textual feedback: poor, moderate or good amount. | [optional] |
27
+ | **group_solidity_score** | **Float** | Sleep score consists of six components that are grouped under three themes. Score for sleep solidity theme is the average of the component scores of long interruptions, continuity and actual sleep. Group solidity score ranges from 1.0 to 100.0. It is interpreted as textual feedback: poor, moderate or good solidity. | [optional] |
28
+ | **group_regeneration_score** | **Float** | Sleep score consists of six components that are grouped under three themes. Score for regeneration theme is the average of the scores of REM sleep and deep sleep. Group regeneration score ranges from 1.0 to 100.0. It is interpreted as textual feedback: poor, moderate or good regeneration | [optional] |
29
+ | **hypnogram** | **Object** | The time span between when you fell asleep and when you woke up is classified into light, deep or REM sleep, or unrecognised or wake in 30-s epochs. 0 &#x3D; WAKE, 1 &#x3D; REM, 2 &#x3D; LIGHTER NON-REM, 3 &#x3D; LIGHT NON-REM, 4 &#x3D; DEEP NON-REM, 5 &#x3D; UNKNOWN (eg. due to bad skin contact). You can request access to this data at https://www.polar.com/en/science/polar-accesslink-api-extended-content | [optional] |
30
+ | **heart_rate_samples** | **Object** | 5 min average samples of heart rate from the duration of the sleep. Default time between samples is 5 minutes. There may be periods with samples more often than every 5 minutes. Unit of samples is beats per minute (bpm). You can request access to this data at https://www.polar.com/en/science/polar-accesslink-api-extended-content | [optional] |
31
+
32
+ ## Example
33
+
34
+ ```ruby
35
+ require 'polar-accesslink-api-gem'
36
+
37
+ instance = PolarAccesslinkApiGem::Sleep.new(
38
+ polar_user: https://www.polaraccesslink/v3/users/1,
39
+ date: Wed Jan 01 01:00:00 CET 2020,
40
+ sleep_start_time: 2020-01-01T00:39:07+03:00,
41
+ sleep_end_time: 2020-01-01T09:19:37+03:00,
42
+ device_id: 1111AAAA,
43
+ continuity: 2.1,
44
+ continuity_class: 2,
45
+ light_sleep: 1000,
46
+ deep_sleep: 1000,
47
+ rem_sleep: 1000,
48
+ unrecognized_sleep_stage: 1000,
49
+ sleep_score: 80,
50
+ total_interruption_duration: 1000,
51
+ sleep_charge: 3,
52
+ sleep_goal: 28800,
53
+ sleep_rating: 3,
54
+ short_interruption_duration: 500,
55
+ long_interruption_duration: 300,
56
+ sleep_cycles: 6,
57
+ group_duration_score: 100.0,
58
+ group_solidity_score: 75.0,
59
+ group_regeneration_score: 54.2,
60
+ hypnogram: {&quot;00:39&quot;:2,&quot;00:50&quot;:3,&quot;01:23&quot;:6},
61
+ heart_rate_samples: {&quot;00:41&quot;:76,&quot;00:46&quot;:77,&quot;00:51&quot;:76}
62
+ )
63
+ ```
64
+
data/docs/SleepApi.md ADDED
@@ -0,0 +1,211 @@
1
+ # PolarAccesslinkApiGem::SleepApi
2
+
3
+ All URIs are relative to *https://www.polaraccesslink.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**list_nights**](SleepApi.md#list_nights) | **GET** /v3/users/sleep | List nights |
8
+ | [**v3_users_sleep_available_get**](SleepApi.md#v3_users_sleep_available_get) | **GET** /v3/users/sleep/available | Get available sleep times |
9
+ | [**v3_users_sleep_date_get**](SleepApi.md#v3_users_sleep_date_get) | **GET** /v3/users/sleep/{date} | Get Sleep |
10
+
11
+
12
+ ## list_nights
13
+
14
+ > <Nights> list_nights
15
+
16
+ List nights
17
+
18
+ List sleep data of user for the last 28 days.
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::SleepApi.new
32
+
33
+ begin
34
+ # List nights
35
+ result = api_instance.list_nights
36
+ p result
37
+ rescue PolarAccesslinkApiGem::ApiError => e
38
+ puts "Error when calling SleepApi->list_nights: #{e}"
39
+ end
40
+ ```
41
+
42
+ #### Using the list_nights_with_http_info variant
43
+
44
+ This returns an Array which contains the response data, status code and headers.
45
+
46
+ > <Array(<Nights>, Integer, Hash)> list_nights_with_http_info
47
+
48
+ ```ruby
49
+ begin
50
+ # List nights
51
+ data, status_code, headers = api_instance.list_nights_with_http_info
52
+ p status_code # => 2xx
53
+ p headers # => { ... }
54
+ p data # => <Nights>
55
+ rescue PolarAccesslinkApiGem::ApiError => e
56
+ puts "Error when calling SleepApi->list_nights_with_http_info: #{e}"
57
+ end
58
+ ```
59
+
60
+ ### Parameters
61
+
62
+ This endpoint does not need any parameter.
63
+
64
+ ### Return type
65
+
66
+ [**Nights**](Nights.md)
67
+
68
+ ### Authorization
69
+
70
+ [OAuth2](../README.md#OAuth2)
71
+
72
+ ### HTTP request headers
73
+
74
+ - **Content-Type**: Not defined
75
+ - **Accept**: application/json
76
+
77
+
78
+ ## v3_users_sleep_available_get
79
+
80
+ > <AvailableSleeps> v3_users_sleep_available_get
81
+
82
+ Get available sleep times
83
+
84
+ Get the dates with sleep start and end times, where user has sleep data available in the last 28 days.
85
+
86
+ ### Examples
87
+
88
+ ```ruby
89
+ require 'time'
90
+ require 'polar-accesslink-api-gem'
91
+ # setup authorization
92
+ PolarAccesslinkApiGem.configure do |config|
93
+ # Configure OAuth2 access token for authorization: OAuth2
94
+ config.access_token = 'YOUR ACCESS TOKEN'
95
+ end
96
+
97
+ api_instance = PolarAccesslinkApiGem::SleepApi.new
98
+
99
+ begin
100
+ # Get available sleep times
101
+ result = api_instance.v3_users_sleep_available_get
102
+ p result
103
+ rescue PolarAccesslinkApiGem::ApiError => e
104
+ puts "Error when calling SleepApi->v3_users_sleep_available_get: #{e}"
105
+ end
106
+ ```
107
+
108
+ #### Using the v3_users_sleep_available_get_with_http_info variant
109
+
110
+ This returns an Array which contains the response data, status code and headers.
111
+
112
+ > <Array(<AvailableSleeps>, Integer, Hash)> v3_users_sleep_available_get_with_http_info
113
+
114
+ ```ruby
115
+ begin
116
+ # Get available sleep times
117
+ data, status_code, headers = api_instance.v3_users_sleep_available_get_with_http_info
118
+ p status_code # => 2xx
119
+ p headers # => { ... }
120
+ p data # => <AvailableSleeps>
121
+ rescue PolarAccesslinkApiGem::ApiError => e
122
+ puts "Error when calling SleepApi->v3_users_sleep_available_get_with_http_info: #{e}"
123
+ end
124
+ ```
125
+
126
+ ### Parameters
127
+
128
+ This endpoint does not need any parameter.
129
+
130
+ ### Return type
131
+
132
+ [**AvailableSleeps**](AvailableSleeps.md)
133
+
134
+ ### Authorization
135
+
136
+ [OAuth2](../README.md#OAuth2)
137
+
138
+ ### HTTP request headers
139
+
140
+ - **Content-Type**: Not defined
141
+ - **Accept**: application/json
142
+
143
+
144
+ ## v3_users_sleep_date_get
145
+
146
+ > <Sleep> v3_users_sleep_date_get(date)
147
+
148
+ Get Sleep
149
+
150
+ Get Users sleep data for given date.
151
+
152
+ ### Examples
153
+
154
+ ```ruby
155
+ require 'time'
156
+ require 'polar-accesslink-api-gem'
157
+ # setup authorization
158
+ PolarAccesslinkApiGem.configure do |config|
159
+ # Configure OAuth2 access token for authorization: OAuth2
160
+ config.access_token = 'YOUR ACCESS TOKEN'
161
+ end
162
+
163
+ api_instance = PolarAccesslinkApiGem::SleepApi.new
164
+ date = 'date_example' # String | Date of sleep as ISO-8601 date string, example: \"2020-01-01\"
165
+
166
+ begin
167
+ # Get Sleep
168
+ result = api_instance.v3_users_sleep_date_get(date)
169
+ p result
170
+ rescue PolarAccesslinkApiGem::ApiError => e
171
+ puts "Error when calling SleepApi->v3_users_sleep_date_get: #{e}"
172
+ end
173
+ ```
174
+
175
+ #### Using the v3_users_sleep_date_get_with_http_info variant
176
+
177
+ This returns an Array which contains the response data, status code and headers.
178
+
179
+ > <Array(<Sleep>, Integer, Hash)> v3_users_sleep_date_get_with_http_info(date)
180
+
181
+ ```ruby
182
+ begin
183
+ # Get Sleep
184
+ data, status_code, headers = api_instance.v3_users_sleep_date_get_with_http_info(date)
185
+ p status_code # => 2xx
186
+ p headers # => { ... }
187
+ p data # => <Sleep>
188
+ rescue PolarAccesslinkApiGem::ApiError => e
189
+ puts "Error when calling SleepApi->v3_users_sleep_date_get_with_http_info: #{e}"
190
+ end
191
+ ```
192
+
193
+ ### Parameters
194
+
195
+ | Name | Type | Description | Notes |
196
+ | ---- | ---- | ----------- | ----- |
197
+ | **date** | **String** | Date of sleep as ISO-8601 date string, example: \&quot;2020-01-01\&quot; | |
198
+
199
+ ### Return type
200
+
201
+ [**Sleep**](Sleep.md)
202
+
203
+ ### Authorization
204
+
205
+ [OAuth2](../README.md#OAuth2)
206
+
207
+ ### HTTP request headers
208
+
209
+ - **Content-Type**: Not defined
210
+ - **Accept**: application/json
211
+