polar-accesslink-api-gem 0.1.0
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.
- 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
data/docs/WebhookType.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# PolarAccesslinkApiGem::WebhookType
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
|
|
8
|
+
## Example
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
require 'polar-accesslink-api-gem'
|
|
12
|
+
|
|
13
|
+
instance = PolarAccesslinkApiGem::WebhookType.new()
|
|
14
|
+
```
|
|
15
|
+
|
data/docs/WebhooksApi.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# PolarAccesslinkApiGem::WebhooksApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://www.polaraccesslink.com*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**create_webhook**](WebhooksApi.md#create_webhook) | **POST** /v3/webhooks | Create webhook |
|
|
8
|
+
| [**delete_webhook**](WebhooksApi.md#delete_webhook) | **DELETE** /v3/webhooks/{webhook-id} | Delete webhook |
|
|
9
|
+
| [**get_webhook**](WebhooksApi.md#get_webhook) | **GET** /v3/webhooks | Get webhook |
|
|
10
|
+
| [**update_webhook**](WebhooksApi.md#update_webhook) | **PATCH** /v3/webhooks/{webhook-id} | Update webhook |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## create_webhook
|
|
14
|
+
|
|
15
|
+
> <CreatedWebhook> create_webhook(webhook_request)
|
|
16
|
+
|
|
17
|
+
Create webhook
|
|
18
|
+
|
|
19
|
+
Create new webhook. When creating webhook the Accesslink sends a ping message to the url in request body. The ping message must be answered with 200 OK or otherwise the webhook is not created. **Note!** Save the *signature_secret_key* from response since this is the only chance to get it.
|
|
20
|
+
|
|
21
|
+
### Examples
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
require 'time'
|
|
25
|
+
require 'polar-accesslink-api-gem'
|
|
26
|
+
# setup authorization
|
|
27
|
+
PolarAccesslinkApiGem.configure do |config|
|
|
28
|
+
# Configure HTTP basic authorization: Basic
|
|
29
|
+
config.username = 'YOUR USERNAME'
|
|
30
|
+
config.password = 'YOUR PASSWORD'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
api_instance = PolarAccesslinkApiGem::WebhooksApi.new
|
|
34
|
+
webhook_request = PolarAccesslinkApiGem::WebhookRequest.new({events: [PolarAccesslinkApiGem::WebhookType::EXERCISE_SLEEP], url: 'https://myapp.example.com/acl_webhook'}) # WebhookRequest | Webhook to create.
|
|
35
|
+
|
|
36
|
+
begin
|
|
37
|
+
# Create webhook
|
|
38
|
+
result = api_instance.create_webhook(webhook_request)
|
|
39
|
+
p result
|
|
40
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
|
41
|
+
puts "Error when calling WebhooksApi->create_webhook: #{e}"
|
|
42
|
+
end
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Using the create_webhook_with_http_info variant
|
|
46
|
+
|
|
47
|
+
This returns an Array which contains the response data, status code and headers.
|
|
48
|
+
|
|
49
|
+
> <Array(<CreatedWebhook>, Integer, Hash)> create_webhook_with_http_info(webhook_request)
|
|
50
|
+
|
|
51
|
+
```ruby
|
|
52
|
+
begin
|
|
53
|
+
# Create webhook
|
|
54
|
+
data, status_code, headers = api_instance.create_webhook_with_http_info(webhook_request)
|
|
55
|
+
p status_code # => 2xx
|
|
56
|
+
p headers # => { ... }
|
|
57
|
+
p data # => <CreatedWebhook>
|
|
58
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
|
59
|
+
puts "Error when calling WebhooksApi->create_webhook_with_http_info: #{e}"
|
|
60
|
+
end
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
| Name | Type | Description | Notes |
|
|
66
|
+
| ---- | ---- | ----------- | ----- |
|
|
67
|
+
| **webhook_request** | [**WebhookRequest**](WebhookRequest.md) | Webhook to create. | |
|
|
68
|
+
|
|
69
|
+
### Return type
|
|
70
|
+
|
|
71
|
+
[**CreatedWebhook**](CreatedWebhook.md)
|
|
72
|
+
|
|
73
|
+
### Authorization
|
|
74
|
+
|
|
75
|
+
[Basic](../README.md#Basic)
|
|
76
|
+
|
|
77
|
+
### HTTP request headers
|
|
78
|
+
|
|
79
|
+
- **Content-Type**: application/json
|
|
80
|
+
- **Accept**: application/json
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## delete_webhook
|
|
84
|
+
|
|
85
|
+
> delete_webhook(webhook_id)
|
|
86
|
+
|
|
87
|
+
Delete webhook
|
|
88
|
+
|
|
89
|
+
Delete webhook by id.
|
|
90
|
+
|
|
91
|
+
### Examples
|
|
92
|
+
|
|
93
|
+
```ruby
|
|
94
|
+
require 'time'
|
|
95
|
+
require 'polar-accesslink-api-gem'
|
|
96
|
+
# setup authorization
|
|
97
|
+
PolarAccesslinkApiGem.configure do |config|
|
|
98
|
+
# Configure HTTP basic authorization: Basic
|
|
99
|
+
config.username = 'YOUR USERNAME'
|
|
100
|
+
config.password = 'YOUR PASSWORD'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
api_instance = PolarAccesslinkApiGem::WebhooksApi.new
|
|
104
|
+
webhook_id = 56 # Integer | Webhook id to delete
|
|
105
|
+
|
|
106
|
+
begin
|
|
107
|
+
# Delete webhook
|
|
108
|
+
api_instance.delete_webhook(webhook_id)
|
|
109
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
|
110
|
+
puts "Error when calling WebhooksApi->delete_webhook: #{e}"
|
|
111
|
+
end
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Using the delete_webhook_with_http_info variant
|
|
115
|
+
|
|
116
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
117
|
+
|
|
118
|
+
> <Array(nil, Integer, Hash)> delete_webhook_with_http_info(webhook_id)
|
|
119
|
+
|
|
120
|
+
```ruby
|
|
121
|
+
begin
|
|
122
|
+
# Delete webhook
|
|
123
|
+
data, status_code, headers = api_instance.delete_webhook_with_http_info(webhook_id)
|
|
124
|
+
p status_code # => 2xx
|
|
125
|
+
p headers # => { ... }
|
|
126
|
+
p data # => nil
|
|
127
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
|
128
|
+
puts "Error when calling WebhooksApi->delete_webhook_with_http_info: #{e}"
|
|
129
|
+
end
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Parameters
|
|
133
|
+
|
|
134
|
+
| Name | Type | Description | Notes |
|
|
135
|
+
| ---- | ---- | ----------- | ----- |
|
|
136
|
+
| **webhook_id** | **Integer** | Webhook id to delete | |
|
|
137
|
+
|
|
138
|
+
### Return type
|
|
139
|
+
|
|
140
|
+
nil (empty response body)
|
|
141
|
+
|
|
142
|
+
### Authorization
|
|
143
|
+
|
|
144
|
+
[Basic](../README.md#Basic)
|
|
145
|
+
|
|
146
|
+
### HTTP request headers
|
|
147
|
+
|
|
148
|
+
- **Content-Type**: Not defined
|
|
149
|
+
- **Accept**: application/json
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
## get_webhook
|
|
153
|
+
|
|
154
|
+
> <WebhookInfo> get_webhook
|
|
155
|
+
|
|
156
|
+
Get webhook
|
|
157
|
+
|
|
158
|
+
Returns created webhook if exists.
|
|
159
|
+
|
|
160
|
+
### Examples
|
|
161
|
+
|
|
162
|
+
```ruby
|
|
163
|
+
require 'time'
|
|
164
|
+
require 'polar-accesslink-api-gem'
|
|
165
|
+
# setup authorization
|
|
166
|
+
PolarAccesslinkApiGem.configure do |config|
|
|
167
|
+
# Configure HTTP basic authorization: Basic
|
|
168
|
+
config.username = 'YOUR USERNAME'
|
|
169
|
+
config.password = 'YOUR PASSWORD'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
api_instance = PolarAccesslinkApiGem::WebhooksApi.new
|
|
173
|
+
|
|
174
|
+
begin
|
|
175
|
+
# Get webhook
|
|
176
|
+
result = api_instance.get_webhook
|
|
177
|
+
p result
|
|
178
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
|
179
|
+
puts "Error when calling WebhooksApi->get_webhook: #{e}"
|
|
180
|
+
end
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### Using the get_webhook_with_http_info variant
|
|
184
|
+
|
|
185
|
+
This returns an Array which contains the response data, status code and headers.
|
|
186
|
+
|
|
187
|
+
> <Array(<WebhookInfo>, Integer, Hash)> get_webhook_with_http_info
|
|
188
|
+
|
|
189
|
+
```ruby
|
|
190
|
+
begin
|
|
191
|
+
# Get webhook
|
|
192
|
+
data, status_code, headers = api_instance.get_webhook_with_http_info
|
|
193
|
+
p status_code # => 2xx
|
|
194
|
+
p headers # => { ... }
|
|
195
|
+
p data # => <WebhookInfo>
|
|
196
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
|
197
|
+
puts "Error when calling WebhooksApi->get_webhook_with_http_info: #{e}"
|
|
198
|
+
end
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Parameters
|
|
202
|
+
|
|
203
|
+
This endpoint does not need any parameter.
|
|
204
|
+
|
|
205
|
+
### Return type
|
|
206
|
+
|
|
207
|
+
[**WebhookInfo**](WebhookInfo.md)
|
|
208
|
+
|
|
209
|
+
### Authorization
|
|
210
|
+
|
|
211
|
+
[Basic](../README.md#Basic)
|
|
212
|
+
|
|
213
|
+
### HTTP request headers
|
|
214
|
+
|
|
215
|
+
- **Content-Type**: Not defined
|
|
216
|
+
- **Accept**: application/json
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
## update_webhook
|
|
220
|
+
|
|
221
|
+
> <WebhookInfo> update_webhook(webhook_id, webhook_patch)
|
|
222
|
+
|
|
223
|
+
Update webhook
|
|
224
|
+
|
|
225
|
+
Edit webhook event types and/or url. When updating webhook url the Accesslink sends a ping message to the new address. The ping message must be answered with 200 OK or otherwise the webhook is not updated.
|
|
226
|
+
|
|
227
|
+
### Examples
|
|
228
|
+
|
|
229
|
+
```ruby
|
|
230
|
+
require 'time'
|
|
231
|
+
require 'polar-accesslink-api-gem'
|
|
232
|
+
# setup authorization
|
|
233
|
+
PolarAccesslinkApiGem.configure do |config|
|
|
234
|
+
# Configure HTTP basic authorization: Basic
|
|
235
|
+
config.username = 'YOUR USERNAME'
|
|
236
|
+
config.password = 'YOUR PASSWORD'
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
api_instance = PolarAccesslinkApiGem::WebhooksApi.new
|
|
240
|
+
webhook_id = 56 # Integer | Webhook id to update
|
|
241
|
+
webhook_patch = PolarAccesslinkApiGem::WebhookPatch.new # WebhookPatch | New value(s) for events and/or url.
|
|
242
|
+
|
|
243
|
+
begin
|
|
244
|
+
# Update webhook
|
|
245
|
+
result = api_instance.update_webhook(webhook_id, webhook_patch)
|
|
246
|
+
p result
|
|
247
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
|
248
|
+
puts "Error when calling WebhooksApi->update_webhook: #{e}"
|
|
249
|
+
end
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### Using the update_webhook_with_http_info variant
|
|
253
|
+
|
|
254
|
+
This returns an Array which contains the response data, status code and headers.
|
|
255
|
+
|
|
256
|
+
> <Array(<WebhookInfo>, Integer, Hash)> update_webhook_with_http_info(webhook_id, webhook_patch)
|
|
257
|
+
|
|
258
|
+
```ruby
|
|
259
|
+
begin
|
|
260
|
+
# Update webhook
|
|
261
|
+
data, status_code, headers = api_instance.update_webhook_with_http_info(webhook_id, webhook_patch)
|
|
262
|
+
p status_code # => 2xx
|
|
263
|
+
p headers # => { ... }
|
|
264
|
+
p data # => <WebhookInfo>
|
|
265
|
+
rescue PolarAccesslinkApiGem::ApiError => e
|
|
266
|
+
puts "Error when calling WebhooksApi->update_webhook_with_http_info: #{e}"
|
|
267
|
+
end
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Parameters
|
|
271
|
+
|
|
272
|
+
| Name | Type | Description | Notes |
|
|
273
|
+
| ---- | ---- | ----------- | ----- |
|
|
274
|
+
| **webhook_id** | **Integer** | Webhook id to update | |
|
|
275
|
+
| **webhook_patch** | [**WebhookPatch**](WebhookPatch.md) | New value(s) for events and/or url. | |
|
|
276
|
+
|
|
277
|
+
### Return type
|
|
278
|
+
|
|
279
|
+
[**WebhookInfo**](WebhookInfo.md)
|
|
280
|
+
|
|
281
|
+
### Authorization
|
|
282
|
+
|
|
283
|
+
[Basic](../README.md#Basic)
|
|
284
|
+
|
|
285
|
+
### HTTP request headers
|
|
286
|
+
|
|
287
|
+
- **Content-Type**: application/json
|
|
288
|
+
- **Accept**: application/json
|
|
289
|
+
|
data/docs/Zone.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# PolarAccesslinkApiGem::Zone
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **index** | **Integer** | Zone list index | [optional] |
|
|
8
|
+
| **lower_limit** | **Integer** | Lower heart-rate boundary of the zone | [optional] |
|
|
9
|
+
| **upper_limit** | **Integer** | Upper heart-rate boundary of the zone | [optional] |
|
|
10
|
+
| **in_zone** | **String** | Time duration spent in the zone ISO 8601 | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'polar-accesslink-api-gem'
|
|
16
|
+
|
|
17
|
+
instance = PolarAccesslinkApiGem::Zone.new(
|
|
18
|
+
index: 1,
|
|
19
|
+
lower_limit: 110,
|
|
20
|
+
upper_limit: 130,
|
|
21
|
+
in_zone: PT4S
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
data/docs/Zones.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# PolarAccesslinkApiGem::Zones
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **zone** | [**Array<Zone>**](Zone.md) | List of heart rate zones. | [optional] |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'polar-accesslink-api-gem'
|
|
13
|
+
|
|
14
|
+
instance = PolarAccesslinkApiGem::Zones.new(
|
|
15
|
+
zone: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
data/git_push.sh
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
|
3
|
+
#
|
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
|
5
|
+
|
|
6
|
+
git_user_id=$1
|
|
7
|
+
git_repo_id=$2
|
|
8
|
+
release_note=$3
|
|
9
|
+
git_host=$4
|
|
10
|
+
|
|
11
|
+
if [ "$git_host" = "" ]; then
|
|
12
|
+
git_host="github.com"
|
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
|
17
|
+
git_user_id="GIT_USER_ID"
|
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
if [ "$release_note" = "" ]; then
|
|
27
|
+
release_note="Minor update"
|
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Initialize the local directory as a Git repository
|
|
32
|
+
git init
|
|
33
|
+
|
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
|
35
|
+
git add .
|
|
36
|
+
|
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
|
38
|
+
git commit -m "$release_note"
|
|
39
|
+
|
|
40
|
+
# Sets the new remote
|
|
41
|
+
git_remote=`git remote`
|
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
|
43
|
+
|
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
|
47
|
+
else
|
|
48
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
git pull origin master
|
|
54
|
+
|
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
|
58
|
+
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Polar Accesslink API
|
|
3
|
+
|
|
4
|
+
#Polar Accesslink API documentation
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 3.78.0
|
|
7
|
+
Contact: b2bhelpdesk@polar.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 5.2.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module PolarAccesslinkApiGem
|
|
16
|
+
class DailyActivityApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Commit transaction
|
|
23
|
+
# After successfully retrieving activity summary data within a transaction, partners are expected to commit the transaction.
|
|
24
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
25
|
+
# @param user_id [Integer] User identifier
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [nil]
|
|
28
|
+
def commit_activity_transaction(transaction_id, user_id, opts = {})
|
|
29
|
+
commit_activity_transaction_with_http_info(transaction_id, user_id, opts)
|
|
30
|
+
nil
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Commit transaction
|
|
34
|
+
# After successfully retrieving activity summary data within a transaction, partners are expected to commit the transaction.
|
|
35
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
36
|
+
# @param user_id [Integer] User identifier
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
39
|
+
def commit_activity_transaction_with_http_info(transaction_id, user_id, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: DailyActivityApi.commit_activity_transaction ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'transaction_id' is set
|
|
44
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.commit_activity_transaction"
|
|
46
|
+
end
|
|
47
|
+
pattern = Regexp.new(/[0-9]+/)
|
|
48
|
+
if @api_client.config.client_side_validation && transaction_id !~ pattern
|
|
49
|
+
fail ArgumentError, "invalid value for 'transaction_id' when calling DailyActivityApi.commit_activity_transaction, must conform to the pattern #{pattern}."
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# verify the required parameter 'user_id' is set
|
|
53
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
54
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.commit_activity_transaction"
|
|
55
|
+
end
|
|
56
|
+
pattern = Regexp.new(/[0-9]+/)
|
|
57
|
+
if @api_client.config.client_side_validation && user_id !~ pattern
|
|
58
|
+
fail ArgumentError, "invalid value for 'user_id' when calling DailyActivityApi.commit_activity_transaction, must conform to the pattern #{pattern}."
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# resource path
|
|
62
|
+
local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
|
|
63
|
+
|
|
64
|
+
# query parameters
|
|
65
|
+
query_params = opts[:query_params] || {}
|
|
66
|
+
|
|
67
|
+
# header parameters
|
|
68
|
+
header_params = opts[:header_params] || {}
|
|
69
|
+
|
|
70
|
+
# form parameters
|
|
71
|
+
form_params = opts[:form_params] || {}
|
|
72
|
+
|
|
73
|
+
# http body (model)
|
|
74
|
+
post_body = opts[:debug_body]
|
|
75
|
+
|
|
76
|
+
# return_type
|
|
77
|
+
return_type = opts[:debug_return_type]
|
|
78
|
+
|
|
79
|
+
# auth_names
|
|
80
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
|
81
|
+
|
|
82
|
+
new_options = opts.merge(
|
|
83
|
+
:operation => :"DailyActivityApi.commit_activity_transaction",
|
|
84
|
+
:header_params => header_params,
|
|
85
|
+
:query_params => query_params,
|
|
86
|
+
:form_params => form_params,
|
|
87
|
+
:body => post_body,
|
|
88
|
+
:auth_names => auth_names,
|
|
89
|
+
:return_type => return_type
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
93
|
+
if @api_client.config.debugging
|
|
94
|
+
@api_client.config.logger.debug "API called: DailyActivityApi#commit_activity_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
95
|
+
end
|
|
96
|
+
return data, status_code, headers
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Create transaction
|
|
100
|
+
# Initiate activity transaction. Check for new activity summaries and create a new transaction if found.
|
|
101
|
+
# @param user_id [Integer] User identifier
|
|
102
|
+
# @param [Hash] opts the optional parameters
|
|
103
|
+
# @return [TransactionLocation]
|
|
104
|
+
def create_activity_transaction(user_id, opts = {})
|
|
105
|
+
data, _status_code, _headers = create_activity_transaction_with_http_info(user_id, opts)
|
|
106
|
+
data
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Create transaction
|
|
110
|
+
# Initiate activity transaction. Check for new activity summaries and create a new transaction if found.
|
|
111
|
+
# @param user_id [Integer] User identifier
|
|
112
|
+
# @param [Hash] opts the optional parameters
|
|
113
|
+
# @return [Array<(TransactionLocation, Integer, Hash)>] TransactionLocation data, response status code and response headers
|
|
114
|
+
def create_activity_transaction_with_http_info(user_id, opts = {})
|
|
115
|
+
if @api_client.config.debugging
|
|
116
|
+
@api_client.config.logger.debug 'Calling API: DailyActivityApi.create_activity_transaction ...'
|
|
117
|
+
end
|
|
118
|
+
# verify the required parameter 'user_id' is set
|
|
119
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
120
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.create_activity_transaction"
|
|
121
|
+
end
|
|
122
|
+
pattern = Regexp.new(/[0-9]+/)
|
|
123
|
+
if @api_client.config.client_side_validation && user_id !~ pattern
|
|
124
|
+
fail ArgumentError, "invalid value for 'user_id' when calling DailyActivityApi.create_activity_transaction, must conform to the pattern #{pattern}."
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# resource path
|
|
128
|
+
local_var_path = '/v3/users/{user-id}/activity-transactions'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
|
|
129
|
+
|
|
130
|
+
# query parameters
|
|
131
|
+
query_params = opts[:query_params] || {}
|
|
132
|
+
|
|
133
|
+
# header parameters
|
|
134
|
+
header_params = opts[:header_params] || {}
|
|
135
|
+
# HTTP header 'Accept' (if needed)
|
|
136
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
|
137
|
+
|
|
138
|
+
# form parameters
|
|
139
|
+
form_params = opts[:form_params] || {}
|
|
140
|
+
|
|
141
|
+
# http body (model)
|
|
142
|
+
post_body = opts[:debug_body]
|
|
143
|
+
|
|
144
|
+
# return_type
|
|
145
|
+
return_type = opts[:debug_return_type] || 'TransactionLocation'
|
|
146
|
+
|
|
147
|
+
# auth_names
|
|
148
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
|
149
|
+
|
|
150
|
+
new_options = opts.merge(
|
|
151
|
+
:operation => :"DailyActivityApi.create_activity_transaction",
|
|
152
|
+
:header_params => header_params,
|
|
153
|
+
:query_params => query_params,
|
|
154
|
+
:form_params => form_params,
|
|
155
|
+
:body => post_body,
|
|
156
|
+
:auth_names => auth_names,
|
|
157
|
+
:return_type => return_type
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug "API called: DailyActivityApi#create_activity_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
163
|
+
end
|
|
164
|
+
return data, status_code, headers
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Get activity summary
|
|
168
|
+
# @param user_id [Integer] User identifier
|
|
169
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
170
|
+
# @param activity_id [Integer] Activity summary identifier
|
|
171
|
+
# @param [Hash] opts the optional parameters
|
|
172
|
+
# @return [Activity]
|
|
173
|
+
def get_activity_summary(user_id, transaction_id, activity_id, opts = {})
|
|
174
|
+
data, _status_code, _headers = get_activity_summary_with_http_info(user_id, transaction_id, activity_id, opts)
|
|
175
|
+
data
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Get activity summary
|
|
179
|
+
# @param user_id [Integer] User identifier
|
|
180
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
181
|
+
# @param activity_id [Integer] Activity summary identifier
|
|
182
|
+
# @param [Hash] opts the optional parameters
|
|
183
|
+
# @return [Array<(Activity, Integer, Hash)>] Activity data, response status code and response headers
|
|
184
|
+
def get_activity_summary_with_http_info(user_id, transaction_id, activity_id, opts = {})
|
|
185
|
+
if @api_client.config.debugging
|
|
186
|
+
@api_client.config.logger.debug 'Calling API: DailyActivityApi.get_activity_summary ...'
|
|
187
|
+
end
|
|
188
|
+
# verify the required parameter 'user_id' is set
|
|
189
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
190
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.get_activity_summary"
|
|
191
|
+
end
|
|
192
|
+
# verify the required parameter 'transaction_id' is set
|
|
193
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
|
194
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.get_activity_summary"
|
|
195
|
+
end
|
|
196
|
+
# verify the required parameter 'activity_id' is set
|
|
197
|
+
if @api_client.config.client_side_validation && activity_id.nil?
|
|
198
|
+
fail ArgumentError, "Missing the required parameter 'activity_id' when calling DailyActivityApi.get_activity_summary"
|
|
199
|
+
end
|
|
200
|
+
# resource path
|
|
201
|
+
local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'activity-id' + '}', CGI.escape(activity_id.to_s))
|
|
202
|
+
|
|
203
|
+
# query parameters
|
|
204
|
+
query_params = opts[:query_params] || {}
|
|
205
|
+
|
|
206
|
+
# header parameters
|
|
207
|
+
header_params = opts[:header_params] || {}
|
|
208
|
+
# HTTP header 'Accept' (if needed)
|
|
209
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
|
210
|
+
|
|
211
|
+
# form parameters
|
|
212
|
+
form_params = opts[:form_params] || {}
|
|
213
|
+
|
|
214
|
+
# http body (model)
|
|
215
|
+
post_body = opts[:debug_body]
|
|
216
|
+
|
|
217
|
+
# return_type
|
|
218
|
+
return_type = opts[:debug_return_type] || 'Activity'
|
|
219
|
+
|
|
220
|
+
# auth_names
|
|
221
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
|
222
|
+
|
|
223
|
+
new_options = opts.merge(
|
|
224
|
+
:operation => :"DailyActivityApi.get_activity_summary",
|
|
225
|
+
:header_params => header_params,
|
|
226
|
+
:query_params => query_params,
|
|
227
|
+
:form_params => form_params,
|
|
228
|
+
:body => post_body,
|
|
229
|
+
:auth_names => auth_names,
|
|
230
|
+
:return_type => return_type
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
234
|
+
if @api_client.config.debugging
|
|
235
|
+
@api_client.config.logger.debug "API called: DailyActivityApi#get_activity_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
236
|
+
end
|
|
237
|
+
return data, status_code, headers
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Get step samples
|
|
241
|
+
# Get activity step samples. Example data can be seen from [appendix](#activity-step-time-series).
|
|
242
|
+
# @param user_id [Integer] User identifier
|
|
243
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
244
|
+
# @param activity_id [Integer] Activity summary identifier
|
|
245
|
+
# @param [Hash] opts the optional parameters
|
|
246
|
+
# @return [ActivityStepSamples]
|
|
247
|
+
def get_step_samples(user_id, transaction_id, activity_id, opts = {})
|
|
248
|
+
data, _status_code, _headers = get_step_samples_with_http_info(user_id, transaction_id, activity_id, opts)
|
|
249
|
+
data
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Get step samples
|
|
253
|
+
# Get activity step samples. Example data can be seen from [appendix](#activity-step-time-series).
|
|
254
|
+
# @param user_id [Integer] User identifier
|
|
255
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
256
|
+
# @param activity_id [Integer] Activity summary identifier
|
|
257
|
+
# @param [Hash] opts the optional parameters
|
|
258
|
+
# @return [Array<(ActivityStepSamples, Integer, Hash)>] ActivityStepSamples data, response status code and response headers
|
|
259
|
+
def get_step_samples_with_http_info(user_id, transaction_id, activity_id, opts = {})
|
|
260
|
+
if @api_client.config.debugging
|
|
261
|
+
@api_client.config.logger.debug 'Calling API: DailyActivityApi.get_step_samples ...'
|
|
262
|
+
end
|
|
263
|
+
# verify the required parameter 'user_id' is set
|
|
264
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
265
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.get_step_samples"
|
|
266
|
+
end
|
|
267
|
+
# verify the required parameter 'transaction_id' is set
|
|
268
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
|
269
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.get_step_samples"
|
|
270
|
+
end
|
|
271
|
+
# verify the required parameter 'activity_id' is set
|
|
272
|
+
if @api_client.config.client_side_validation && activity_id.nil?
|
|
273
|
+
fail ArgumentError, "Missing the required parameter 'activity_id' when calling DailyActivityApi.get_step_samples"
|
|
274
|
+
end
|
|
275
|
+
# resource path
|
|
276
|
+
local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'activity-id' + '}', CGI.escape(activity_id.to_s))
|
|
277
|
+
|
|
278
|
+
# query parameters
|
|
279
|
+
query_params = opts[:query_params] || {}
|
|
280
|
+
|
|
281
|
+
# header parameters
|
|
282
|
+
header_params = opts[:header_params] || {}
|
|
283
|
+
# HTTP header 'Accept' (if needed)
|
|
284
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
|
285
|
+
|
|
286
|
+
# form parameters
|
|
287
|
+
form_params = opts[:form_params] || {}
|
|
288
|
+
|
|
289
|
+
# http body (model)
|
|
290
|
+
post_body = opts[:debug_body]
|
|
291
|
+
|
|
292
|
+
# return_type
|
|
293
|
+
return_type = opts[:debug_return_type] || 'ActivityStepSamples'
|
|
294
|
+
|
|
295
|
+
# auth_names
|
|
296
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
|
297
|
+
|
|
298
|
+
new_options = opts.merge(
|
|
299
|
+
:operation => :"DailyActivityApi.get_step_samples",
|
|
300
|
+
:header_params => header_params,
|
|
301
|
+
:query_params => query_params,
|
|
302
|
+
:form_params => form_params,
|
|
303
|
+
:body => post_body,
|
|
304
|
+
:auth_names => auth_names,
|
|
305
|
+
:return_type => return_type
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
309
|
+
if @api_client.config.debugging
|
|
310
|
+
@api_client.config.logger.debug "API called: DailyActivityApi#get_step_samples\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
311
|
+
end
|
|
312
|
+
return data, status_code, headers
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
# Get zone samples
|
|
316
|
+
# Get activity zone samples. Example data can be seen from [appendix](#activity-zone-time-series).
|
|
317
|
+
# @param user_id [Integer] User identifier
|
|
318
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
319
|
+
# @param activity_id [Integer] Activity summary identifier
|
|
320
|
+
# @param [Hash] opts the optional parameters
|
|
321
|
+
# @return [ActivityZoneSamples]
|
|
322
|
+
def get_zone_samples(user_id, transaction_id, activity_id, opts = {})
|
|
323
|
+
data, _status_code, _headers = get_zone_samples_with_http_info(user_id, transaction_id, activity_id, opts)
|
|
324
|
+
data
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# Get zone samples
|
|
328
|
+
# Get activity zone samples. Example data can be seen from [appendix](#activity-zone-time-series).
|
|
329
|
+
# @param user_id [Integer] User identifier
|
|
330
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
331
|
+
# @param activity_id [Integer] Activity summary identifier
|
|
332
|
+
# @param [Hash] opts the optional parameters
|
|
333
|
+
# @return [Array<(ActivityZoneSamples, Integer, Hash)>] ActivityZoneSamples data, response status code and response headers
|
|
334
|
+
def get_zone_samples_with_http_info(user_id, transaction_id, activity_id, opts = {})
|
|
335
|
+
if @api_client.config.debugging
|
|
336
|
+
@api_client.config.logger.debug 'Calling API: DailyActivityApi.get_zone_samples ...'
|
|
337
|
+
end
|
|
338
|
+
# verify the required parameter 'user_id' is set
|
|
339
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
340
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.get_zone_samples"
|
|
341
|
+
end
|
|
342
|
+
# verify the required parameter 'transaction_id' is set
|
|
343
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
|
344
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.get_zone_samples"
|
|
345
|
+
end
|
|
346
|
+
# verify the required parameter 'activity_id' is set
|
|
347
|
+
if @api_client.config.client_side_validation && activity_id.nil?
|
|
348
|
+
fail ArgumentError, "Missing the required parameter 'activity_id' when calling DailyActivityApi.get_zone_samples"
|
|
349
|
+
end
|
|
350
|
+
# resource path
|
|
351
|
+
local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'activity-id' + '}', CGI.escape(activity_id.to_s))
|
|
352
|
+
|
|
353
|
+
# query parameters
|
|
354
|
+
query_params = opts[:query_params] || {}
|
|
355
|
+
|
|
356
|
+
# header parameters
|
|
357
|
+
header_params = opts[:header_params] || {}
|
|
358
|
+
# HTTP header 'Accept' (if needed)
|
|
359
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
|
360
|
+
|
|
361
|
+
# form parameters
|
|
362
|
+
form_params = opts[:form_params] || {}
|
|
363
|
+
|
|
364
|
+
# http body (model)
|
|
365
|
+
post_body = opts[:debug_body]
|
|
366
|
+
|
|
367
|
+
# return_type
|
|
368
|
+
return_type = opts[:debug_return_type] || 'ActivityZoneSamples'
|
|
369
|
+
|
|
370
|
+
# auth_names
|
|
371
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
|
372
|
+
|
|
373
|
+
new_options = opts.merge(
|
|
374
|
+
:operation => :"DailyActivityApi.get_zone_samples",
|
|
375
|
+
:header_params => header_params,
|
|
376
|
+
:query_params => query_params,
|
|
377
|
+
:form_params => form_params,
|
|
378
|
+
:body => post_body,
|
|
379
|
+
:auth_names => auth_names,
|
|
380
|
+
:return_type => return_type
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
384
|
+
if @api_client.config.debugging
|
|
385
|
+
@api_client.config.logger.debug "API called: DailyActivityApi#get_zone_samples\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
386
|
+
end
|
|
387
|
+
return data, status_code, headers
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
# List activities
|
|
391
|
+
# List new activity data. After successfully initiating a transaction, activity summaries included within it can be retrieved with the provided transactionId.
|
|
392
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
393
|
+
# @param user_id [Integer] User identifier
|
|
394
|
+
# @param [Hash] opts the optional parameters
|
|
395
|
+
# @return [ActivityLog]
|
|
396
|
+
def list_activities(transaction_id, user_id, opts = {})
|
|
397
|
+
data, _status_code, _headers = list_activities_with_http_info(transaction_id, user_id, opts)
|
|
398
|
+
data
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
# List activities
|
|
402
|
+
# List new activity data. After successfully initiating a transaction, activity summaries included within it can be retrieved with the provided transactionId.
|
|
403
|
+
# @param transaction_id [Integer] Transaction identifier
|
|
404
|
+
# @param user_id [Integer] User identifier
|
|
405
|
+
# @param [Hash] opts the optional parameters
|
|
406
|
+
# @return [Array<(ActivityLog, Integer, Hash)>] ActivityLog data, response status code and response headers
|
|
407
|
+
def list_activities_with_http_info(transaction_id, user_id, opts = {})
|
|
408
|
+
if @api_client.config.debugging
|
|
409
|
+
@api_client.config.logger.debug 'Calling API: DailyActivityApi.list_activities ...'
|
|
410
|
+
end
|
|
411
|
+
# verify the required parameter 'transaction_id' is set
|
|
412
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
|
413
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.list_activities"
|
|
414
|
+
end
|
|
415
|
+
pattern = Regexp.new(/[0-9]+/)
|
|
416
|
+
if @api_client.config.client_side_validation && transaction_id !~ pattern
|
|
417
|
+
fail ArgumentError, "invalid value for 'transaction_id' when calling DailyActivityApi.list_activities, must conform to the pattern #{pattern}."
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
# verify the required parameter 'user_id' is set
|
|
421
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
422
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.list_activities"
|
|
423
|
+
end
|
|
424
|
+
pattern = Regexp.new(/[0-9]+/)
|
|
425
|
+
if @api_client.config.client_side_validation && user_id !~ pattern
|
|
426
|
+
fail ArgumentError, "invalid value for 'user_id' when calling DailyActivityApi.list_activities, must conform to the pattern #{pattern}."
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# resource path
|
|
430
|
+
local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
|
|
431
|
+
|
|
432
|
+
# query parameters
|
|
433
|
+
query_params = opts[:query_params] || {}
|
|
434
|
+
|
|
435
|
+
# header parameters
|
|
436
|
+
header_params = opts[:header_params] || {}
|
|
437
|
+
# HTTP header 'Accept' (if needed)
|
|
438
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
|
439
|
+
|
|
440
|
+
# form parameters
|
|
441
|
+
form_params = opts[:form_params] || {}
|
|
442
|
+
|
|
443
|
+
# http body (model)
|
|
444
|
+
post_body = opts[:debug_body]
|
|
445
|
+
|
|
446
|
+
# return_type
|
|
447
|
+
return_type = opts[:debug_return_type] || 'ActivityLog'
|
|
448
|
+
|
|
449
|
+
# auth_names
|
|
450
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
|
451
|
+
|
|
452
|
+
new_options = opts.merge(
|
|
453
|
+
:operation => :"DailyActivityApi.list_activities",
|
|
454
|
+
:header_params => header_params,
|
|
455
|
+
:query_params => query_params,
|
|
456
|
+
:form_params => form_params,
|
|
457
|
+
:body => post_body,
|
|
458
|
+
:auth_names => auth_names,
|
|
459
|
+
:return_type => return_type
|
|
460
|
+
)
|
|
461
|
+
|
|
462
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
463
|
+
if @api_client.config.debugging
|
|
464
|
+
@api_client.config.logger.debug "API called: DailyActivityApi#list_activities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
465
|
+
end
|
|
466
|
+
return data, status_code, headers
|
|
467
|
+
end
|
|
468
|
+
end
|
|
469
|
+
end
|