polar_accesslink 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +70 -0
  4. data/README.md +170 -0
  5. data/Rakefile +10 -0
  6. data/docs/Activity.md +33 -0
  7. data/docs/ActivityLog.md +17 -0
  8. data/docs/ActivityStepSample.md +19 -0
  9. data/docs/ActivityStepSamples.md +19 -0
  10. data/docs/ActivityZoneSample.md +19 -0
  11. data/docs/ActivityZoneSamples.md +19 -0
  12. data/docs/AvailableUserData.md +21 -0
  13. data/docs/AvailableUserDatas.md +17 -0
  14. data/docs/CreatedWebhook.md +17 -0
  15. data/docs/CreatedWebhookData.md +23 -0
  16. data/docs/DailyActivityApi.md +339 -0
  17. data/docs/DurationZone.md +19 -0
  18. data/docs/Error.md +25 -0
  19. data/docs/Exercise.md +47 -0
  20. data/docs/ExerciseHashId.md +45 -0
  21. data/docs/Exercises.md +17 -0
  22. data/docs/ExercisesApi.md +163 -0
  23. data/docs/HeartRate.md +19 -0
  24. data/docs/PhysicalInfoApi.md +227 -0
  25. data/docs/PhysicalInformation.md +39 -0
  26. data/docs/PhysicalInformations.md +17 -0
  27. data/docs/PullNotificationsApi.md +58 -0
  28. data/docs/Register.md +17 -0
  29. data/docs/Sample.md +21 -0
  30. data/docs/Samples.md +17 -0
  31. data/docs/TrainingDataApi.md +571 -0
  32. data/docs/TransactionLocation.md +19 -0
  33. data/docs/User.md +35 -0
  34. data/docs/UserExtraInfo.md +21 -0
  35. data/docs/UsersApi.md +166 -0
  36. data/docs/WebhookInfo.md +17 -0
  37. data/docs/WebhookInfoData.md +21 -0
  38. data/docs/WebhookPatch.md +19 -0
  39. data/docs/WebhookPayload.md +25 -0
  40. data/docs/WebhookPing.md +19 -0
  41. data/docs/WebhookRequest.md +19 -0
  42. data/docs/WebhookType.md +16 -0
  43. data/docs/WebhooksApi.md +221 -0
  44. data/docs/Zone.md +23 -0
  45. data/docs/Zones.md +17 -0
  46. data/lib/.DS_Store +0 -0
  47. data/lib/polar_accesslink/.DS_Store +0 -0
  48. data/lib/polar_accesslink/api/daily_activity_api.rb +463 -0
  49. data/lib/polar_accesslink/api/exercises_api.rb +202 -0
  50. data/lib/polar_accesslink/api/physical_info_api.rb +292 -0
  51. data/lib/polar_accesslink/api/pull_notifications_api.rb +78 -0
  52. data/lib/polar_accesslink/api/training_data_api.rb +772 -0
  53. data/lib/polar_accesslink/api/users_api.rb +218 -0
  54. data/lib/polar_accesslink/api/webhooks_api.rb +274 -0
  55. data/lib/polar_accesslink/api_client.rb +386 -0
  56. data/lib/polar_accesslink/api_error.rb +57 -0
  57. data/lib/polar_accesslink/configuration.rb +255 -0
  58. data/lib/polar_accesslink/models/activity.rb +288 -0
  59. data/lib/polar_accesslink/models/activity_log.rb +210 -0
  60. data/lib/polar_accesslink/models/activity_step_sample.rb +218 -0
  61. data/lib/polar_accesslink/models/activity_step_samples.rb +220 -0
  62. data/lib/polar_accesslink/models/activity_zone_sample.rb +220 -0
  63. data/lib/polar_accesslink/models/activity_zone_samples.rb +220 -0
  64. data/lib/polar_accesslink/models/available_user_data.rb +262 -0
  65. data/lib/polar_accesslink/models/available_user_datas.rb +210 -0
  66. data/lib/polar_accesslink/models/created_webhook.rb +206 -0
  67. data/lib/polar_accesslink/models/created_webhook_data.rb +236 -0
  68. data/lib/polar_accesslink/models/duration_zone.rb +218 -0
  69. data/lib/polar_accesslink/models/error.rb +248 -0
  70. data/lib/polar_accesslink/models/exercise.rb +357 -0
  71. data/lib/polar_accesslink/models/exercise_hash_id.rb +347 -0
  72. data/lib/polar_accesslink/models/exercises.rb +210 -0
  73. data/lib/polar_accesslink/models/heart_rate.rb +218 -0
  74. data/lib/polar_accesslink/models/physical_information.rb +352 -0
  75. data/lib/polar_accesslink/models/physical_informations.rb +210 -0
  76. data/lib/polar_accesslink/models/register.rb +213 -0
  77. data/lib/polar_accesslink/models/sample.rb +228 -0
  78. data/lib/polar_accesslink/models/samples.rb +210 -0
  79. data/lib/polar_accesslink/models/transaction_location.rb +218 -0
  80. data/lib/polar_accesslink/models/user.rb +334 -0
  81. data/lib/polar_accesslink/models/user_extra_info.rb +228 -0
  82. data/lib/polar_accesslink/models/webhook_info.rb +206 -0
  83. data/lib/polar_accesslink/models/webhook_info_data.rb +226 -0
  84. data/lib/polar_accesslink/models/webhook_patch.rb +219 -0
  85. data/lib/polar_accesslink/models/webhook_payload.rb +246 -0
  86. data/lib/polar_accesslink/models/webhook_ping.rb +252 -0
  87. data/lib/polar_accesslink/models/webhook_request.rb +229 -0
  88. data/lib/polar_accesslink/models/webhook_type.rb +37 -0
  89. data/lib/polar_accesslink/models/zone.rb +238 -0
  90. data/lib/polar_accesslink/models/zones.rb +210 -0
  91. data/lib/polar_accesslink/version.rb +15 -0
  92. data/lib/polar_accesslink.rb +79 -0
  93. data/polar_accesslink-1.0.0.gem +0 -0
  94. data/polar_accesslink.gemspec +38 -0
  95. data/spec/api/daily_activity_api_spec.rb +114 -0
  96. data/spec/api/exercises_api_spec.rb +70 -0
  97. data/spec/api/physical_info_api_spec.rb +87 -0
  98. data/spec/api/pull_notifications_api_spec.rb +46 -0
  99. data/spec/api/training_data_api_spec.rb +172 -0
  100. data/spec/api/users_api_spec.rb +71 -0
  101. data/spec/api/webhooks_api_spec.rb +83 -0
  102. data/spec/api_client_spec.rb +226 -0
  103. data/spec/configuration_spec.rb +42 -0
  104. data/spec/models/activity_log_spec.rb +41 -0
  105. data/spec/models/activity_spec.rb +89 -0
  106. data/spec/models/activity_step_sample_spec.rb +47 -0
  107. data/spec/models/activity_step_samples_spec.rb +47 -0
  108. data/spec/models/activity_zone_sample_spec.rb +47 -0
  109. data/spec/models/activity_zone_samples_spec.rb +47 -0
  110. data/spec/models/available_user_data_spec.rb +57 -0
  111. data/spec/models/available_user_datas_spec.rb +41 -0
  112. data/spec/models/created_webhook_data_spec.rb +59 -0
  113. data/spec/models/created_webhook_spec.rb +41 -0
  114. data/spec/models/duration_zone_spec.rb +47 -0
  115. data/spec/models/error_spec.rb +65 -0
  116. data/spec/models/exercise_hash_id_spec.rb +125 -0
  117. data/spec/models/exercise_spec.rb +131 -0
  118. data/spec/models/exercises_spec.rb +41 -0
  119. data/spec/models/heart_rate_spec.rb +47 -0
  120. data/spec/models/physical_information_spec.rb +111 -0
  121. data/spec/models/physical_informations_spec.rb +41 -0
  122. data/spec/models/register_spec.rb +41 -0
  123. data/spec/models/sample_spec.rb +53 -0
  124. data/spec/models/samples_spec.rb +41 -0
  125. data/spec/models/transaction_location_spec.rb +47 -0
  126. data/spec/models/user_extra_info_spec.rb +53 -0
  127. data/spec/models/user_spec.rb +99 -0
  128. data/spec/models/webhook_info_data_spec.rb +53 -0
  129. data/spec/models/webhook_info_spec.rb +41 -0
  130. data/spec/models/webhook_patch_spec.rb +47 -0
  131. data/spec/models/webhook_payload_spec.rb +65 -0
  132. data/spec/models/webhook_ping_spec.rb +51 -0
  133. data/spec/models/webhook_request_spec.rb +47 -0
  134. data/spec/models/webhook_type_spec.rb +35 -0
  135. data/spec/models/zone_spec.rb +59 -0
  136. data/spec/models/zones_spec.rb +41 -0
  137. data/spec/spec_helper.rb +111 -0
  138. metadata +282 -0
@@ -0,0 +1,227 @@
1
+ # PolarAccesslink::PhysicalInfoApi
2
+
3
+ All URIs are relative to *https://www.polaraccesslink.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**commit_physical_info_transaction**](PhysicalInfoApi.md#commit_physical_info_transaction) | **PUT** /v3/users/{user-id}/physical-information-transactions/{transaction-id} | Commit transaction
8
+ [**create_physical_info_transaction**](PhysicalInfoApi.md#create_physical_info_transaction) | **POST** /v3/users/{user-id}/physical-information-transactions | Create transaction
9
+ [**get_physical_info**](PhysicalInfoApi.md#get_physical_info) | **GET** /v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id} | Get physical info
10
+ [**list_physical_infos**](PhysicalInfoApi.md#list_physical_infos) | **GET** /v3/users/{user-id}/physical-information-transactions/{transaction-id} | List physical infos
11
+
12
+
13
+
14
+ ## commit_physical_info_transaction
15
+
16
+ > commit_physical_info_transaction(transaction_id, user_id)
17
+
18
+ Commit transaction
19
+
20
+ After successfully retrieving physical information within a transaction, partners are expected to commit the transaction.
21
+
22
+ ### Example
23
+
24
+ ```ruby
25
+ # load the gem
26
+ require 'openapi_client'
27
+ # setup authorization
28
+ OpenapiClient.configure do |config|
29
+ # Configure OAuth2 access token for authorization: OAuth2
30
+ config.access_token = 'YOUR ACCESS TOKEN'
31
+ end
32
+
33
+ api_instance = PolarAccesslink::PhysicalInfoApi.new
34
+ transaction_id = 56 # Integer | Transaction identifier
35
+ user_id = 56 # Integer | User identifier
36
+
37
+ begin
38
+ #Commit transaction
39
+ api_instance.commit_physical_info_transaction(transaction_id, user_id)
40
+ rescue PolarAccesslink::ApiError => e
41
+ puts "Exception when calling PhysicalInfoApi->commit_physical_info_transaction: #{e}"
42
+ end
43
+ ```
44
+
45
+ ### Parameters
46
+
47
+
48
+ Name | Type | Description | Notes
49
+ ------------- | ------------- | ------------- | -------------
50
+ **transaction_id** | **Integer**| Transaction identifier |
51
+ **user_id** | **Integer**| User identifier |
52
+
53
+ ### Return type
54
+
55
+ nil (empty response body)
56
+
57
+ ### Authorization
58
+
59
+ [OAuth2](../README.md#OAuth2)
60
+
61
+ ### HTTP request headers
62
+
63
+ - **Content-Type**: Not defined
64
+ - **Accept**: Not defined
65
+
66
+
67
+ ## create_physical_info_transaction
68
+
69
+ > TransactionLocation create_physical_info_transaction(user_id)
70
+
71
+ Create transaction
72
+
73
+ Initiate physical info transaction. Check for new physical info and create a new transaction if found.
74
+
75
+ ### Example
76
+
77
+ ```ruby
78
+ # load the gem
79
+ require 'openapi_client'
80
+ # setup authorization
81
+ OpenapiClient.configure do |config|
82
+ # Configure OAuth2 access token for authorization: OAuth2
83
+ config.access_token = 'YOUR ACCESS TOKEN'
84
+ end
85
+
86
+ api_instance = PolarAccesslink::PhysicalInfoApi.new
87
+ user_id = 56 # Integer | User identifier
88
+
89
+ begin
90
+ #Create transaction
91
+ result = api_instance.create_physical_info_transaction(user_id)
92
+ p result
93
+ rescue PolarAccesslink::ApiError => e
94
+ puts "Exception when calling PhysicalInfoApi->create_physical_info_transaction: #{e}"
95
+ end
96
+ ```
97
+
98
+ ### Parameters
99
+
100
+
101
+ Name | Type | Description | Notes
102
+ ------------- | ------------- | ------------- | -------------
103
+ **user_id** | **Integer**| User identifier |
104
+
105
+ ### Return type
106
+
107
+ [**TransactionLocation**](TransactionLocation.md)
108
+
109
+ ### Authorization
110
+
111
+ [OAuth2](../README.md#OAuth2)
112
+
113
+ ### HTTP request headers
114
+
115
+ - **Content-Type**: Not defined
116
+ - **Accept**: application/json, application/xml
117
+
118
+
119
+ ## get_physical_info
120
+
121
+ > PhysicalInformation get_physical_info(user_id, transaction_id, physical_info_id)
122
+
123
+ Get physical info
124
+
125
+ Get physical info entity data
126
+
127
+ ### Example
128
+
129
+ ```ruby
130
+ # load the gem
131
+ require 'openapi_client'
132
+ # setup authorization
133
+ OpenapiClient.configure do |config|
134
+ # Configure OAuth2 access token for authorization: OAuth2
135
+ config.access_token = 'YOUR ACCESS TOKEN'
136
+ end
137
+
138
+ api_instance = PolarAccesslink::PhysicalInfoApi.new
139
+ user_id = 56 # Integer | User identifier
140
+ transaction_id = 56 # Integer | Transaction identifier
141
+ physical_info_id = 56 # Integer | Physical information identifier
142
+
143
+ begin
144
+ #Get physical info
145
+ result = api_instance.get_physical_info(user_id, transaction_id, physical_info_id)
146
+ p result
147
+ rescue PolarAccesslink::ApiError => e
148
+ puts "Exception when calling PhysicalInfoApi->get_physical_info: #{e}"
149
+ end
150
+ ```
151
+
152
+ ### Parameters
153
+
154
+
155
+ Name | Type | Description | Notes
156
+ ------------- | ------------- | ------------- | -------------
157
+ **user_id** | **Integer**| User identifier |
158
+ **transaction_id** | **Integer**| Transaction identifier |
159
+ **physical_info_id** | **Integer**| Physical information identifier |
160
+
161
+ ### Return type
162
+
163
+ [**PhysicalInformation**](PhysicalInformation.md)
164
+
165
+ ### Authorization
166
+
167
+ [OAuth2](../README.md#OAuth2)
168
+
169
+ ### HTTP request headers
170
+
171
+ - **Content-Type**: Not defined
172
+ - **Accept**: application/json, application/xml
173
+
174
+
175
+ ## list_physical_infos
176
+
177
+ > PhysicalInformations list_physical_infos(transaction_id, user_id)
178
+
179
+ List physical infos
180
+
181
+ List new physical info data. After successfully initiating a transaction, physical infos included within it can be retrieved with the provided transactionId.
182
+
183
+ ### Example
184
+
185
+ ```ruby
186
+ # load the gem
187
+ require 'openapi_client'
188
+ # setup authorization
189
+ OpenapiClient.configure do |config|
190
+ # Configure OAuth2 access token for authorization: OAuth2
191
+ config.access_token = 'YOUR ACCESS TOKEN'
192
+ end
193
+
194
+ api_instance = PolarAccesslink::PhysicalInfoApi.new
195
+ transaction_id = 56 # Integer | Transaction identifier
196
+ user_id = 56 # Integer | User identifier
197
+
198
+ begin
199
+ #List physical infos
200
+ result = api_instance.list_physical_infos(transaction_id, user_id)
201
+ p result
202
+ rescue PolarAccesslink::ApiError => e
203
+ puts "Exception when calling PhysicalInfoApi->list_physical_infos: #{e}"
204
+ end
205
+ ```
206
+
207
+ ### Parameters
208
+
209
+
210
+ Name | Type | Description | Notes
211
+ ------------- | ------------- | ------------- | -------------
212
+ **transaction_id** | **Integer**| Transaction identifier |
213
+ **user_id** | **Integer**| User identifier |
214
+
215
+ ### Return type
216
+
217
+ [**PhysicalInformations**](PhysicalInformations.md)
218
+
219
+ ### Authorization
220
+
221
+ [OAuth2](../README.md#OAuth2)
222
+
223
+ ### HTTP request headers
224
+
225
+ - **Content-Type**: Not defined
226
+ - **Accept**: application/json, application/xml
227
+
@@ -0,0 +1,39 @@
1
+ # PolarAccesslink::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.SSS | [optional]
10
+ **polar_user** | **String** | Absolute link to user owning the activity | [optional]
11
+ **weight** | **Float** | Height | [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
+ ## Code Sample
21
+
22
+ ```ruby
23
+ require 'OpenapiClient'
24
+
25
+ instance = PolarAccesslink::PhysicalInformation.new(id: 123,
26
+ transaction_id: 179879,
27
+ created: 2016-04-27T20:11:33.000Z,
28
+ polar_user: https://www.polaraccesslink/v3/users/1,
29
+ weight: 80,
30
+ height: 180,
31
+ maximum_heart_rate: 160,
32
+ resting_heart_rate: 60,
33
+ aerobic_threshold: 123,
34
+ anaerobic_threshold: 123,
35
+ vo2_max: 12,
36
+ weight_source: SOURCE_MEASURED)
37
+ ```
38
+
39
+
@@ -0,0 +1,17 @@
1
+ # PolarAccesslink::PhysicalInformations
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **physical_informations** | **Array<String>** | Absolute links to individual physical informations within the transaction | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'OpenapiClient'
13
+
14
+ instance = PolarAccesslink::PhysicalInformations.new(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"])
15
+ ```
16
+
17
+
@@ -0,0 +1,58 @@
1
+ # PolarAccesslink::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
+
11
+ ## list
12
+
13
+ > AvailableUserDatas list
14
+
15
+ List
16
+
17
+ Get list of available exercises and activities for users
18
+
19
+ ### Example
20
+
21
+ ```ruby
22
+ # load the gem
23
+ require 'openapi_client'
24
+ # setup authorization
25
+ OpenapiClient.configure do |config|
26
+ # Configure HTTP basic authorization: Basic
27
+ config.username = 'YOUR USERNAME'
28
+ config.password = 'YOUR PASSWORD'
29
+ end
30
+
31
+ api_instance = PolarAccesslink::PullNotificationsApi.new
32
+
33
+ begin
34
+ #List
35
+ result = api_instance.list
36
+ p result
37
+ rescue PolarAccesslink::ApiError => e
38
+ puts "Exception when calling PullNotificationsApi->list: #{e}"
39
+ end
40
+ ```
41
+
42
+ ### Parameters
43
+
44
+ This endpoint does not need any parameter.
45
+
46
+ ### Return type
47
+
48
+ [**AvailableUserDatas**](AvailableUserDatas.md)
49
+
50
+ ### Authorization
51
+
52
+ [Basic](../README.md#Basic)
53
+
54
+ ### HTTP request headers
55
+
56
+ - **Content-Type**: Not defined
57
+ - **Accept**: application/json, application/xml
58
+
data/docs/Register.md ADDED
@@ -0,0 +1,17 @@
1
+ # PolarAccesslink::Register
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **member_id** | **String** | Partner's custom identifier for user. |
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'OpenapiClient'
13
+
14
+ instance = PolarAccesslink::Register.new(member_id: User_id_999)
15
+ ```
16
+
17
+
data/docs/Sample.md ADDED
@@ -0,0 +1,21 @@
1
+ # PolarAccesslink::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
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'OpenapiClient'
15
+
16
+ instance = PolarAccesslink::Sample.new(recording_rate: 5,
17
+ sample_type: null,
18
+ 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)
19
+ ```
20
+
21
+
data/docs/Samples.md ADDED
@@ -0,0 +1,17 @@
1
+ # PolarAccesslink::Samples
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **sample** | **Array<String>** | List of URIs pointing to single sample type data. | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'OpenapiClient'
13
+
14
+ instance = PolarAccesslink::Samples.new(sample: ["https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/0","https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/3"])
15
+ ```
16
+
17
+