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,744 @@
|
|
1
|
+
# PolarAccesslinkApiGem::TrainingDataApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://www.polaraccesslink.com*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**commit_exercise_transaction**](TrainingDataApi.md#commit_exercise_transaction) | **PUT** /v3/users/{user-id}/exercise-transactions/{transaction-id} | Commit transaction |
|
8
|
+
| [**create_exercise_transaction**](TrainingDataApi.md#create_exercise_transaction) | **POST** /v3/users/{user-id}/exercise-transactions | Create transaction |
|
9
|
+
| [**get_available_samples**](TrainingDataApi.md#get_available_samples) | **GET** /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples | Get available samples |
|
10
|
+
| [**get_exercise_summary**](TrainingDataApi.md#get_exercise_summary) | **GET** /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id} | Get exercise summary |
|
11
|
+
| [**get_fit**](TrainingDataApi.md#get_fit) | **GET** /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit | Get FIT (beta) |
|
12
|
+
| [**get_gpx**](TrainingDataApi.md#get_gpx) | **GET** /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx | Get GPX |
|
13
|
+
| [**get_heart_rate_zones**](TrainingDataApi.md#get_heart_rate_zones) | **GET** /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones | Get heart rate zones |
|
14
|
+
| [**get_samples**](TrainingDataApi.md#get_samples) | **GET** /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id} | Get samples |
|
15
|
+
| [**get_tcx**](TrainingDataApi.md#get_tcx) | **GET** /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx | Get TCX |
|
16
|
+
| [**list_exercises**](TrainingDataApi.md#list_exercises) | **GET** /v3/users/{user-id}/exercise-transactions/{transaction-id} | List exercises |
|
17
|
+
|
18
|
+
|
19
|
+
## commit_exercise_transaction
|
20
|
+
|
21
|
+
> commit_exercise_transaction(transaction_id, user_id)
|
22
|
+
|
23
|
+
Commit transaction
|
24
|
+
|
25
|
+
After successfully retrieving training session data within a transaction, partners are expected to commit the transaction.
|
26
|
+
|
27
|
+
### Examples
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'time'
|
31
|
+
require 'polar-accesslink-api-gem'
|
32
|
+
# setup authorization
|
33
|
+
PolarAccesslinkApiGem.configure do |config|
|
34
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
35
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
36
|
+
end
|
37
|
+
|
38
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
39
|
+
transaction_id = 789 # Integer | Transaction identifier
|
40
|
+
user_id = 56 # Integer | User identifier
|
41
|
+
|
42
|
+
begin
|
43
|
+
# Commit transaction
|
44
|
+
api_instance.commit_exercise_transaction(transaction_id, user_id)
|
45
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
46
|
+
puts "Error when calling TrainingDataApi->commit_exercise_transaction: #{e}"
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
#### Using the commit_exercise_transaction_with_http_info variant
|
51
|
+
|
52
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
53
|
+
|
54
|
+
> <Array(nil, Integer, Hash)> commit_exercise_transaction_with_http_info(transaction_id, user_id)
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
begin
|
58
|
+
# Commit transaction
|
59
|
+
data, status_code, headers = api_instance.commit_exercise_transaction_with_http_info(transaction_id, user_id)
|
60
|
+
p status_code # => 2xx
|
61
|
+
p headers # => { ... }
|
62
|
+
p data # => nil
|
63
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
64
|
+
puts "Error when calling TrainingDataApi->commit_exercise_transaction_with_http_info: #{e}"
|
65
|
+
end
|
66
|
+
```
|
67
|
+
|
68
|
+
### Parameters
|
69
|
+
|
70
|
+
| Name | Type | Description | Notes |
|
71
|
+
| ---- | ---- | ----------- | ----- |
|
72
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
73
|
+
| **user_id** | **Integer** | User identifier | |
|
74
|
+
|
75
|
+
### Return type
|
76
|
+
|
77
|
+
nil (empty response body)
|
78
|
+
|
79
|
+
### Authorization
|
80
|
+
|
81
|
+
[OAuth2](../README.md#OAuth2)
|
82
|
+
|
83
|
+
### HTTP request headers
|
84
|
+
|
85
|
+
- **Content-Type**: Not defined
|
86
|
+
- **Accept**: Not defined
|
87
|
+
|
88
|
+
|
89
|
+
## create_exercise_transaction
|
90
|
+
|
91
|
+
> <TransactionLocation> create_exercise_transaction(user_id)
|
92
|
+
|
93
|
+
Create transaction
|
94
|
+
|
95
|
+
Check for new training data and create a new transaction if found.
|
96
|
+
|
97
|
+
### Examples
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
require 'time'
|
101
|
+
require 'polar-accesslink-api-gem'
|
102
|
+
# setup authorization
|
103
|
+
PolarAccesslinkApiGem.configure do |config|
|
104
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
105
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
106
|
+
end
|
107
|
+
|
108
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
109
|
+
user_id = 56 # Integer | User identifier
|
110
|
+
|
111
|
+
begin
|
112
|
+
# Create transaction
|
113
|
+
result = api_instance.create_exercise_transaction(user_id)
|
114
|
+
p result
|
115
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
116
|
+
puts "Error when calling TrainingDataApi->create_exercise_transaction: #{e}"
|
117
|
+
end
|
118
|
+
```
|
119
|
+
|
120
|
+
#### Using the create_exercise_transaction_with_http_info variant
|
121
|
+
|
122
|
+
This returns an Array which contains the response data, status code and headers.
|
123
|
+
|
124
|
+
> <Array(<TransactionLocation>, Integer, Hash)> create_exercise_transaction_with_http_info(user_id)
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
begin
|
128
|
+
# Create transaction
|
129
|
+
data, status_code, headers = api_instance.create_exercise_transaction_with_http_info(user_id)
|
130
|
+
p status_code # => 2xx
|
131
|
+
p headers # => { ... }
|
132
|
+
p data # => <TransactionLocation>
|
133
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
134
|
+
puts "Error when calling TrainingDataApi->create_exercise_transaction_with_http_info: #{e}"
|
135
|
+
end
|
136
|
+
```
|
137
|
+
|
138
|
+
### Parameters
|
139
|
+
|
140
|
+
| Name | Type | Description | Notes |
|
141
|
+
| ---- | ---- | ----------- | ----- |
|
142
|
+
| **user_id** | **Integer** | User identifier | |
|
143
|
+
|
144
|
+
### Return type
|
145
|
+
|
146
|
+
[**TransactionLocation**](TransactionLocation.md)
|
147
|
+
|
148
|
+
### Authorization
|
149
|
+
|
150
|
+
[OAuth2](../README.md#OAuth2)
|
151
|
+
|
152
|
+
### HTTP request headers
|
153
|
+
|
154
|
+
- **Content-Type**: Not defined
|
155
|
+
- **Accept**: application/json, application/xml
|
156
|
+
|
157
|
+
|
158
|
+
## get_available_samples
|
159
|
+
|
160
|
+
> <Samples> get_available_samples(user_id, transaction_id, exercise_id)
|
161
|
+
|
162
|
+
Get available samples
|
163
|
+
|
164
|
+
Retrieve list of links to available samples in training session
|
165
|
+
|
166
|
+
### Examples
|
167
|
+
|
168
|
+
```ruby
|
169
|
+
require 'time'
|
170
|
+
require 'polar-accesslink-api-gem'
|
171
|
+
# setup authorization
|
172
|
+
PolarAccesslinkApiGem.configure do |config|
|
173
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
174
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
175
|
+
end
|
176
|
+
|
177
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
178
|
+
user_id = 56 # Integer | User identifier
|
179
|
+
transaction_id = 56 # Integer | Transaction identifier
|
180
|
+
exercise_id = 56 # Integer | Exercise identifier
|
181
|
+
|
182
|
+
begin
|
183
|
+
# Get available samples
|
184
|
+
result = api_instance.get_available_samples(user_id, transaction_id, exercise_id)
|
185
|
+
p result
|
186
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
187
|
+
puts "Error when calling TrainingDataApi->get_available_samples: #{e}"
|
188
|
+
end
|
189
|
+
```
|
190
|
+
|
191
|
+
#### Using the get_available_samples_with_http_info variant
|
192
|
+
|
193
|
+
This returns an Array which contains the response data, status code and headers.
|
194
|
+
|
195
|
+
> <Array(<Samples>, Integer, Hash)> get_available_samples_with_http_info(user_id, transaction_id, exercise_id)
|
196
|
+
|
197
|
+
```ruby
|
198
|
+
begin
|
199
|
+
# Get available samples
|
200
|
+
data, status_code, headers = api_instance.get_available_samples_with_http_info(user_id, transaction_id, exercise_id)
|
201
|
+
p status_code # => 2xx
|
202
|
+
p headers # => { ... }
|
203
|
+
p data # => <Samples>
|
204
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
205
|
+
puts "Error when calling TrainingDataApi->get_available_samples_with_http_info: #{e}"
|
206
|
+
end
|
207
|
+
```
|
208
|
+
|
209
|
+
### Parameters
|
210
|
+
|
211
|
+
| Name | Type | Description | Notes |
|
212
|
+
| ---- | ---- | ----------- | ----- |
|
213
|
+
| **user_id** | **Integer** | User identifier | |
|
214
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
215
|
+
| **exercise_id** | **Integer** | Exercise identifier | |
|
216
|
+
|
217
|
+
### Return type
|
218
|
+
|
219
|
+
[**Samples**](Samples.md)
|
220
|
+
|
221
|
+
### Authorization
|
222
|
+
|
223
|
+
[OAuth2](../README.md#OAuth2)
|
224
|
+
|
225
|
+
### HTTP request headers
|
226
|
+
|
227
|
+
- **Content-Type**: Not defined
|
228
|
+
- **Accept**: application/json, application/xml
|
229
|
+
|
230
|
+
|
231
|
+
## get_exercise_summary
|
232
|
+
|
233
|
+
> <Exercise> get_exercise_summary(user_id, transaction_id, exercise_id)
|
234
|
+
|
235
|
+
Get exercise summary
|
236
|
+
|
237
|
+
Retrieve training session summary data
|
238
|
+
|
239
|
+
### Examples
|
240
|
+
|
241
|
+
```ruby
|
242
|
+
require 'time'
|
243
|
+
require 'polar-accesslink-api-gem'
|
244
|
+
# setup authorization
|
245
|
+
PolarAccesslinkApiGem.configure do |config|
|
246
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
247
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
248
|
+
end
|
249
|
+
|
250
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
251
|
+
user_id = 56 # Integer | User identifier
|
252
|
+
transaction_id = 56 # Integer | Transaction identifier
|
253
|
+
exercise_id = 56 # Integer | Exercise identifier
|
254
|
+
|
255
|
+
begin
|
256
|
+
# Get exercise summary
|
257
|
+
result = api_instance.get_exercise_summary(user_id, transaction_id, exercise_id)
|
258
|
+
p result
|
259
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
260
|
+
puts "Error when calling TrainingDataApi->get_exercise_summary: #{e}"
|
261
|
+
end
|
262
|
+
```
|
263
|
+
|
264
|
+
#### Using the get_exercise_summary_with_http_info variant
|
265
|
+
|
266
|
+
This returns an Array which contains the response data, status code and headers.
|
267
|
+
|
268
|
+
> <Array(<Exercise>, Integer, Hash)> get_exercise_summary_with_http_info(user_id, transaction_id, exercise_id)
|
269
|
+
|
270
|
+
```ruby
|
271
|
+
begin
|
272
|
+
# Get exercise summary
|
273
|
+
data, status_code, headers = api_instance.get_exercise_summary_with_http_info(user_id, transaction_id, exercise_id)
|
274
|
+
p status_code # => 2xx
|
275
|
+
p headers # => { ... }
|
276
|
+
p data # => <Exercise>
|
277
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
278
|
+
puts "Error when calling TrainingDataApi->get_exercise_summary_with_http_info: #{e}"
|
279
|
+
end
|
280
|
+
```
|
281
|
+
|
282
|
+
### Parameters
|
283
|
+
|
284
|
+
| Name | Type | Description | Notes |
|
285
|
+
| ---- | ---- | ----------- | ----- |
|
286
|
+
| **user_id** | **Integer** | User identifier | |
|
287
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
288
|
+
| **exercise_id** | **Integer** | Exercise identifier | |
|
289
|
+
|
290
|
+
### Return type
|
291
|
+
|
292
|
+
[**Exercise**](Exercise.md)
|
293
|
+
|
294
|
+
### Authorization
|
295
|
+
|
296
|
+
[OAuth2](../README.md#OAuth2)
|
297
|
+
|
298
|
+
### HTTP request headers
|
299
|
+
|
300
|
+
- **Content-Type**: Not defined
|
301
|
+
- **Accept**: application/json, application/xml
|
302
|
+
|
303
|
+
|
304
|
+
## get_fit
|
305
|
+
|
306
|
+
> String get_fit(user_id, transaction_id, exercise_id)
|
307
|
+
|
308
|
+
Get FIT (beta)
|
309
|
+
|
310
|
+
Retrieve exercise in FIT format. **Note!** This interface is in beta phase. If there is anything we can help you with or you want to give us feedback, please contact [Support](#support).
|
311
|
+
|
312
|
+
### Examples
|
313
|
+
|
314
|
+
```ruby
|
315
|
+
require 'time'
|
316
|
+
require 'polar-accesslink-api-gem'
|
317
|
+
# setup authorization
|
318
|
+
PolarAccesslinkApiGem.configure do |config|
|
319
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
320
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
321
|
+
end
|
322
|
+
|
323
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
324
|
+
user_id = 56 # Integer | User identifier
|
325
|
+
transaction_id = 56 # Integer | Transaction identifier
|
326
|
+
exercise_id = 56 # Integer | Exercise identifier
|
327
|
+
|
328
|
+
begin
|
329
|
+
# Get FIT (beta)
|
330
|
+
result = api_instance.get_fit(user_id, transaction_id, exercise_id)
|
331
|
+
p result
|
332
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
333
|
+
puts "Error when calling TrainingDataApi->get_fit: #{e}"
|
334
|
+
end
|
335
|
+
```
|
336
|
+
|
337
|
+
#### Using the get_fit_with_http_info variant
|
338
|
+
|
339
|
+
This returns an Array which contains the response data, status code and headers.
|
340
|
+
|
341
|
+
> <Array(String, Integer, Hash)> get_fit_with_http_info(user_id, transaction_id, exercise_id)
|
342
|
+
|
343
|
+
```ruby
|
344
|
+
begin
|
345
|
+
# Get FIT (beta)
|
346
|
+
data, status_code, headers = api_instance.get_fit_with_http_info(user_id, transaction_id, exercise_id)
|
347
|
+
p status_code # => 2xx
|
348
|
+
p headers # => { ... }
|
349
|
+
p data # => String
|
350
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
351
|
+
puts "Error when calling TrainingDataApi->get_fit_with_http_info: #{e}"
|
352
|
+
end
|
353
|
+
```
|
354
|
+
|
355
|
+
### Parameters
|
356
|
+
|
357
|
+
| Name | Type | Description | Notes |
|
358
|
+
| ---- | ---- | ----------- | ----- |
|
359
|
+
| **user_id** | **Integer** | User identifier | |
|
360
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
361
|
+
| **exercise_id** | **Integer** | Exercise identifier | |
|
362
|
+
|
363
|
+
### Return type
|
364
|
+
|
365
|
+
**String**
|
366
|
+
|
367
|
+
### Authorization
|
368
|
+
|
369
|
+
[OAuth2](../README.md#OAuth2)
|
370
|
+
|
371
|
+
### HTTP request headers
|
372
|
+
|
373
|
+
- **Content-Type**: Not defined
|
374
|
+
- **Accept**: */*
|
375
|
+
|
376
|
+
|
377
|
+
## get_gpx
|
378
|
+
|
379
|
+
> String get_gpx(user_id, transaction_id, exercise_id, opts)
|
380
|
+
|
381
|
+
Get GPX
|
382
|
+
|
383
|
+
Retrieve training session summary data in GPX format
|
384
|
+
|
385
|
+
### Examples
|
386
|
+
|
387
|
+
```ruby
|
388
|
+
require 'time'
|
389
|
+
require 'polar-accesslink-api-gem'
|
390
|
+
# setup authorization
|
391
|
+
PolarAccesslinkApiGem.configure do |config|
|
392
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
393
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
394
|
+
end
|
395
|
+
|
396
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
397
|
+
user_id = 56 # Integer | User identifier
|
398
|
+
transaction_id = 56 # Integer | Transaction identifier
|
399
|
+
exercise_id = 56 # Integer | Exercise identifier
|
400
|
+
opts = {
|
401
|
+
include_pause_times: true # Boolean | Whether to add pauses as part of the route. Default is false.
|
402
|
+
}
|
403
|
+
|
404
|
+
begin
|
405
|
+
# Get GPX
|
406
|
+
result = api_instance.get_gpx(user_id, transaction_id, exercise_id, opts)
|
407
|
+
p result
|
408
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
409
|
+
puts "Error when calling TrainingDataApi->get_gpx: #{e}"
|
410
|
+
end
|
411
|
+
```
|
412
|
+
|
413
|
+
#### Using the get_gpx_with_http_info variant
|
414
|
+
|
415
|
+
This returns an Array which contains the response data, status code and headers.
|
416
|
+
|
417
|
+
> <Array(String, Integer, Hash)> get_gpx_with_http_info(user_id, transaction_id, exercise_id, opts)
|
418
|
+
|
419
|
+
```ruby
|
420
|
+
begin
|
421
|
+
# Get GPX
|
422
|
+
data, status_code, headers = api_instance.get_gpx_with_http_info(user_id, transaction_id, exercise_id, opts)
|
423
|
+
p status_code # => 2xx
|
424
|
+
p headers # => { ... }
|
425
|
+
p data # => String
|
426
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
427
|
+
puts "Error when calling TrainingDataApi->get_gpx_with_http_info: #{e}"
|
428
|
+
end
|
429
|
+
```
|
430
|
+
|
431
|
+
### Parameters
|
432
|
+
|
433
|
+
| Name | Type | Description | Notes |
|
434
|
+
| ---- | ---- | ----------- | ----- |
|
435
|
+
| **user_id** | **Integer** | User identifier | |
|
436
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
437
|
+
| **exercise_id** | **Integer** | Exercise identifier | |
|
438
|
+
| **include_pause_times** | **Boolean** | Whether to add pauses as part of the route. Default is false. | [optional][default to false] |
|
439
|
+
|
440
|
+
### Return type
|
441
|
+
|
442
|
+
**String**
|
443
|
+
|
444
|
+
### Authorization
|
445
|
+
|
446
|
+
[OAuth2](../README.md#OAuth2)
|
447
|
+
|
448
|
+
### HTTP request headers
|
449
|
+
|
450
|
+
- **Content-Type**: Not defined
|
451
|
+
- **Accept**: application/gpx+xml
|
452
|
+
|
453
|
+
|
454
|
+
## get_heart_rate_zones
|
455
|
+
|
456
|
+
> <Zones> get_heart_rate_zones(user_id, transaction_id, exercise_id)
|
457
|
+
|
458
|
+
Get heart rate zones
|
459
|
+
|
460
|
+
Retrieve heart rate zones in training session
|
461
|
+
|
462
|
+
### Examples
|
463
|
+
|
464
|
+
```ruby
|
465
|
+
require 'time'
|
466
|
+
require 'polar-accesslink-api-gem'
|
467
|
+
# setup authorization
|
468
|
+
PolarAccesslinkApiGem.configure do |config|
|
469
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
470
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
471
|
+
end
|
472
|
+
|
473
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
474
|
+
user_id = 56 # Integer | User identifier
|
475
|
+
transaction_id = 56 # Integer | Transaction identifier
|
476
|
+
exercise_id = 56 # Integer | Exercise identifier
|
477
|
+
|
478
|
+
begin
|
479
|
+
# Get heart rate zones
|
480
|
+
result = api_instance.get_heart_rate_zones(user_id, transaction_id, exercise_id)
|
481
|
+
p result
|
482
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
483
|
+
puts "Error when calling TrainingDataApi->get_heart_rate_zones: #{e}"
|
484
|
+
end
|
485
|
+
```
|
486
|
+
|
487
|
+
#### Using the get_heart_rate_zones_with_http_info variant
|
488
|
+
|
489
|
+
This returns an Array which contains the response data, status code and headers.
|
490
|
+
|
491
|
+
> <Array(<Zones>, Integer, Hash)> get_heart_rate_zones_with_http_info(user_id, transaction_id, exercise_id)
|
492
|
+
|
493
|
+
```ruby
|
494
|
+
begin
|
495
|
+
# Get heart rate zones
|
496
|
+
data, status_code, headers = api_instance.get_heart_rate_zones_with_http_info(user_id, transaction_id, exercise_id)
|
497
|
+
p status_code # => 2xx
|
498
|
+
p headers # => { ... }
|
499
|
+
p data # => <Zones>
|
500
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
501
|
+
puts "Error when calling TrainingDataApi->get_heart_rate_zones_with_http_info: #{e}"
|
502
|
+
end
|
503
|
+
```
|
504
|
+
|
505
|
+
### Parameters
|
506
|
+
|
507
|
+
| Name | Type | Description | Notes |
|
508
|
+
| ---- | ---- | ----------- | ----- |
|
509
|
+
| **user_id** | **Integer** | User identifier | |
|
510
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
511
|
+
| **exercise_id** | **Integer** | Exercise identifier | |
|
512
|
+
|
513
|
+
### Return type
|
514
|
+
|
515
|
+
[**Zones**](Zones.md)
|
516
|
+
|
517
|
+
### Authorization
|
518
|
+
|
519
|
+
[OAuth2](../README.md#OAuth2)
|
520
|
+
|
521
|
+
### HTTP request headers
|
522
|
+
|
523
|
+
- **Content-Type**: Not defined
|
524
|
+
- **Accept**: application/json, application/xml
|
525
|
+
|
526
|
+
|
527
|
+
## get_samples
|
528
|
+
|
529
|
+
> <Sample> get_samples(type_id, user_id, transaction_id, exercise_id)
|
530
|
+
|
531
|
+
Get samples
|
532
|
+
|
533
|
+
Retrieve sample data of given type
|
534
|
+
|
535
|
+
### Examples
|
536
|
+
|
537
|
+
```ruby
|
538
|
+
require 'time'
|
539
|
+
require 'polar-accesslink-api-gem'
|
540
|
+
# setup authorization
|
541
|
+
PolarAccesslinkApiGem.configure do |config|
|
542
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
543
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
544
|
+
end
|
545
|
+
|
546
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
547
|
+
type_id = BYTE_ARRAY_DATA_HERE # String | Sample type id
|
548
|
+
user_id = 56 # Integer | User identifier
|
549
|
+
transaction_id = 56 # Integer | Transaction identifier
|
550
|
+
exercise_id = 56 # Integer | Exercise identifier
|
551
|
+
|
552
|
+
begin
|
553
|
+
# Get samples
|
554
|
+
result = api_instance.get_samples(type_id, user_id, transaction_id, exercise_id)
|
555
|
+
p result
|
556
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
557
|
+
puts "Error when calling TrainingDataApi->get_samples: #{e}"
|
558
|
+
end
|
559
|
+
```
|
560
|
+
|
561
|
+
#### Using the get_samples_with_http_info variant
|
562
|
+
|
563
|
+
This returns an Array which contains the response data, status code and headers.
|
564
|
+
|
565
|
+
> <Array(<Sample>, Integer, Hash)> get_samples_with_http_info(type_id, user_id, transaction_id, exercise_id)
|
566
|
+
|
567
|
+
```ruby
|
568
|
+
begin
|
569
|
+
# Get samples
|
570
|
+
data, status_code, headers = api_instance.get_samples_with_http_info(type_id, user_id, transaction_id, exercise_id)
|
571
|
+
p status_code # => 2xx
|
572
|
+
p headers # => { ... }
|
573
|
+
p data # => <Sample>
|
574
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
575
|
+
puts "Error when calling TrainingDataApi->get_samples_with_http_info: #{e}"
|
576
|
+
end
|
577
|
+
```
|
578
|
+
|
579
|
+
### Parameters
|
580
|
+
|
581
|
+
| Name | Type | Description | Notes |
|
582
|
+
| ---- | ---- | ----------- | ----- |
|
583
|
+
| **type_id** | **String** | Sample type id | |
|
584
|
+
| **user_id** | **Integer** | User identifier | |
|
585
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
586
|
+
| **exercise_id** | **Integer** | Exercise identifier | |
|
587
|
+
|
588
|
+
### Return type
|
589
|
+
|
590
|
+
[**Sample**](Sample.md)
|
591
|
+
|
592
|
+
### Authorization
|
593
|
+
|
594
|
+
[OAuth2](../README.md#OAuth2)
|
595
|
+
|
596
|
+
### HTTP request headers
|
597
|
+
|
598
|
+
- **Content-Type**: Not defined
|
599
|
+
- **Accept**: application/json, application/xml
|
600
|
+
|
601
|
+
|
602
|
+
## get_tcx
|
603
|
+
|
604
|
+
> String get_tcx(user_id, transaction_id, exercise_id)
|
605
|
+
|
606
|
+
Get TCX
|
607
|
+
|
608
|
+
Retrieve exercise in TCX format
|
609
|
+
|
610
|
+
### Examples
|
611
|
+
|
612
|
+
```ruby
|
613
|
+
require 'time'
|
614
|
+
require 'polar-accesslink-api-gem'
|
615
|
+
# setup authorization
|
616
|
+
PolarAccesslinkApiGem.configure do |config|
|
617
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
618
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
619
|
+
end
|
620
|
+
|
621
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
622
|
+
user_id = 56 # Integer | User identifier
|
623
|
+
transaction_id = 56 # Integer | Transaction identifier
|
624
|
+
exercise_id = 56 # Integer | Exercise identifier
|
625
|
+
|
626
|
+
begin
|
627
|
+
# Get TCX
|
628
|
+
result = api_instance.get_tcx(user_id, transaction_id, exercise_id)
|
629
|
+
p result
|
630
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
631
|
+
puts "Error when calling TrainingDataApi->get_tcx: #{e}"
|
632
|
+
end
|
633
|
+
```
|
634
|
+
|
635
|
+
#### Using the get_tcx_with_http_info variant
|
636
|
+
|
637
|
+
This returns an Array which contains the response data, status code and headers.
|
638
|
+
|
639
|
+
> <Array(String, Integer, Hash)> get_tcx_with_http_info(user_id, transaction_id, exercise_id)
|
640
|
+
|
641
|
+
```ruby
|
642
|
+
begin
|
643
|
+
# Get TCX
|
644
|
+
data, status_code, headers = api_instance.get_tcx_with_http_info(user_id, transaction_id, exercise_id)
|
645
|
+
p status_code # => 2xx
|
646
|
+
p headers # => { ... }
|
647
|
+
p data # => String
|
648
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
649
|
+
puts "Error when calling TrainingDataApi->get_tcx_with_http_info: #{e}"
|
650
|
+
end
|
651
|
+
```
|
652
|
+
|
653
|
+
### Parameters
|
654
|
+
|
655
|
+
| Name | Type | Description | Notes |
|
656
|
+
| ---- | ---- | ----------- | ----- |
|
657
|
+
| **user_id** | **Integer** | User identifier | |
|
658
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
659
|
+
| **exercise_id** | **Integer** | Exercise identifier | |
|
660
|
+
|
661
|
+
### Return type
|
662
|
+
|
663
|
+
**String**
|
664
|
+
|
665
|
+
### Authorization
|
666
|
+
|
667
|
+
[OAuth2](../README.md#OAuth2)
|
668
|
+
|
669
|
+
### HTTP request headers
|
670
|
+
|
671
|
+
- **Content-Type**: Not defined
|
672
|
+
- **Accept**: application/vnd.garmin.tcx+xml
|
673
|
+
|
674
|
+
|
675
|
+
## list_exercises
|
676
|
+
|
677
|
+
> <Exercises> list_exercises(transaction_id, user_id)
|
678
|
+
|
679
|
+
List exercises
|
680
|
+
|
681
|
+
After successfully initiating a transaction, training sessions included within it can be retrieved with the provided transactionId.
|
682
|
+
|
683
|
+
### Examples
|
684
|
+
|
685
|
+
```ruby
|
686
|
+
require 'time'
|
687
|
+
require 'polar-accesslink-api-gem'
|
688
|
+
# setup authorization
|
689
|
+
PolarAccesslinkApiGem.configure do |config|
|
690
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
691
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
692
|
+
end
|
693
|
+
|
694
|
+
api_instance = PolarAccesslinkApiGem::TrainingDataApi.new
|
695
|
+
transaction_id = 789 # Integer | Transaction identifier
|
696
|
+
user_id = 56 # Integer | User identifier
|
697
|
+
|
698
|
+
begin
|
699
|
+
# List exercises
|
700
|
+
result = api_instance.list_exercises(transaction_id, user_id)
|
701
|
+
p result
|
702
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
703
|
+
puts "Error when calling TrainingDataApi->list_exercises: #{e}"
|
704
|
+
end
|
705
|
+
```
|
706
|
+
|
707
|
+
#### Using the list_exercises_with_http_info variant
|
708
|
+
|
709
|
+
This returns an Array which contains the response data, status code and headers.
|
710
|
+
|
711
|
+
> <Array(<Exercises>, Integer, Hash)> list_exercises_with_http_info(transaction_id, user_id)
|
712
|
+
|
713
|
+
```ruby
|
714
|
+
begin
|
715
|
+
# List exercises
|
716
|
+
data, status_code, headers = api_instance.list_exercises_with_http_info(transaction_id, user_id)
|
717
|
+
p status_code # => 2xx
|
718
|
+
p headers # => { ... }
|
719
|
+
p data # => <Exercises>
|
720
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
721
|
+
puts "Error when calling TrainingDataApi->list_exercises_with_http_info: #{e}"
|
722
|
+
end
|
723
|
+
```
|
724
|
+
|
725
|
+
### Parameters
|
726
|
+
|
727
|
+
| Name | Type | Description | Notes |
|
728
|
+
| ---- | ---- | ----------- | ----- |
|
729
|
+
| **transaction_id** | **Integer** | Transaction identifier | |
|
730
|
+
| **user_id** | **Integer** | User identifier | |
|
731
|
+
|
732
|
+
### Return type
|
733
|
+
|
734
|
+
[**Exercises**](Exercises.md)
|
735
|
+
|
736
|
+
### Authorization
|
737
|
+
|
738
|
+
[OAuth2](../README.md#OAuth2)
|
739
|
+
|
740
|
+
### HTTP request headers
|
741
|
+
|
742
|
+
- **Content-Type**: Not defined
|
743
|
+
- **Accept**: application/json, application/xml
|
744
|
+
|