polar_accesslink 1.0.2 → 1.0.3
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 +4 -4
- data/Gemfile.lock +9 -5
- data/README.md +20 -65
- data/Rakefile +0 -2
- data/docs/DailyActivityApi.md +96 -123
- data/docs/ExercisesApi.md +35 -55
- data/docs/NightlyRechargeApi.md +96 -0
- data/docs/PhysicalInfoApi.md +60 -79
- data/docs/PullNotificationsApi.md +11 -20
- data/docs/SleepApi.md +137 -0
- data/docs/TrainingDataApi.md +175 -213
- data/docs/UsersApi.md +33 -56
- data/docs/WebhooksApi.md +43 -80
- data/git_push.sh +55 -0
- data/lib/polar_accesslink.rb +5 -36
- data/lib/polar_accesslink/api/daily_activity_api.rb +101 -201
- data/lib/polar_accesslink/api/exercises_api.rb +43 -81
- data/lib/polar_accesslink/api/nightly_recharge_api.rb +115 -0
- data/lib/polar_accesslink/api/physical_info_api.rb +65 -114
- data/lib/polar_accesslink/api/pull_notifications_api.rb +15 -27
- data/lib/polar_accesslink/api/sleep_api.rb +158 -0
- data/lib/polar_accesslink/api/training_data_api.rb +178 -332
- data/lib/polar_accesslink/api/users_api.rb +42 -96
- data/lib/polar_accesslink/api/webhooks_api.rb +59 -126
- data/lib/polar_accesslink/api_client.rb +45 -41
- data/lib/polar_accesslink/api_error.rb +3 -22
- data/lib/polar_accesslink/configuration.rb +9 -62
- data/lib/polar_accesslink/version.rb +3 -3
- data/polar_accesslink.gemspec +2 -1
- data/spec/api/daily_activity_api_spec.rb +11 -11
- data/spec/api/exercises_api_spec.rb +9 -9
- data/spec/api/nightly_recharge_api_spec.rb +58 -0
- data/spec/api/physical_info_api_spec.rb +9 -9
- data/spec/api/pull_notifications_api_spec.rb +7 -7
- data/spec/api/sleep_api_spec.rb +69 -0
- data/spec/api/training_data_api_spec.rb +16 -15
- data/spec/api/users_api_spec.rb +8 -9
- data/spec/api/webhooks_api_spec.rb +11 -13
- data/spec/api_client_spec.rb +21 -4
- data/spec/configuration_spec.rb +6 -6
- data/spec/spec_helper.rb +3 -3
- metadata +36 -145
- data/docs/Activity.md +0 -33
- data/docs/ActivityLog.md +0 -17
- data/docs/ActivityStepSample.md +0 -19
- data/docs/ActivityStepSamples.md +0 -19
- data/docs/ActivityZoneSample.md +0 -19
- data/docs/ActivityZoneSamples.md +0 -19
- data/docs/AvailableUserData.md +0 -21
- data/docs/AvailableUserDatas.md +0 -17
- data/docs/CreatedWebhook.md +0 -17
- data/docs/CreatedWebhookData.md +0 -23
- data/docs/DurationZone.md +0 -19
- data/docs/Error.md +0 -25
- data/docs/Exercise.md +0 -47
- data/docs/ExerciseHashId.md +0 -45
- data/docs/Exercises.md +0 -17
- data/docs/HeartRate.md +0 -19
- data/docs/PhysicalInformation.md +0 -39
- data/docs/PhysicalInformations.md +0 -17
- data/docs/Register.md +0 -17
- data/docs/Sample.md +0 -21
- data/docs/Samples.md +0 -17
- data/docs/TransactionLocation.md +0 -19
- data/docs/User.md +0 -35
- data/docs/UserExtraInfo.md +0 -21
- data/docs/WebhookInfo.md +0 -17
- data/docs/WebhookInfoData.md +0 -21
- data/docs/WebhookPatch.md +0 -19
- data/docs/WebhookPayload.md +0 -25
- data/docs/WebhookPing.md +0 -19
- data/docs/WebhookRequest.md +0 -19
- data/docs/WebhookType.md +0 -16
- data/docs/Zone.md +0 -23
- data/docs/Zones.md +0 -17
- data/lib/polar_accesslink/models/activity.rb +0 -288
- data/lib/polar_accesslink/models/activity_log.rb +0 -210
- data/lib/polar_accesslink/models/activity_step_sample.rb +0 -218
- data/lib/polar_accesslink/models/activity_step_samples.rb +0 -220
- data/lib/polar_accesslink/models/activity_zone_sample.rb +0 -220
- data/lib/polar_accesslink/models/activity_zone_samples.rb +0 -220
- data/lib/polar_accesslink/models/available_user_data.rb +0 -262
- data/lib/polar_accesslink/models/available_user_datas.rb +0 -210
- data/lib/polar_accesslink/models/created_webhook.rb +0 -206
- data/lib/polar_accesslink/models/created_webhook_data.rb +0 -236
- data/lib/polar_accesslink/models/duration_zone.rb +0 -218
- data/lib/polar_accesslink/models/error.rb +0 -248
- data/lib/polar_accesslink/models/exercise.rb +0 -357
- data/lib/polar_accesslink/models/exercise_hash_id.rb +0 -347
- data/lib/polar_accesslink/models/exercises.rb +0 -210
- data/lib/polar_accesslink/models/heart_rate.rb +0 -218
- data/lib/polar_accesslink/models/physical_information.rb +0 -352
- data/lib/polar_accesslink/models/physical_informations.rb +0 -210
- data/lib/polar_accesslink/models/register.rb +0 -213
- data/lib/polar_accesslink/models/sample.rb +0 -228
- data/lib/polar_accesslink/models/samples.rb +0 -210
- data/lib/polar_accesslink/models/transaction_location.rb +0 -218
- data/lib/polar_accesslink/models/user.rb +0 -334
- data/lib/polar_accesslink/models/user_extra_info.rb +0 -228
- data/lib/polar_accesslink/models/webhook_info.rb +0 -206
- data/lib/polar_accesslink/models/webhook_info_data.rb +0 -226
- data/lib/polar_accesslink/models/webhook_patch.rb +0 -219
- data/lib/polar_accesslink/models/webhook_payload.rb +0 -246
- data/lib/polar_accesslink/models/webhook_ping.rb +0 -252
- data/lib/polar_accesslink/models/webhook_request.rb +0 -229
- data/lib/polar_accesslink/models/webhook_type.rb +0 -37
- data/lib/polar_accesslink/models/zone.rb +0 -238
- data/lib/polar_accesslink/models/zones.rb +0 -210
- data/spec/models/activity_log_spec.rb +0 -41
- data/spec/models/activity_spec.rb +0 -89
- data/spec/models/activity_step_sample_spec.rb +0 -47
- data/spec/models/activity_step_samples_spec.rb +0 -47
- data/spec/models/activity_zone_sample_spec.rb +0 -47
- data/spec/models/activity_zone_samples_spec.rb +0 -47
- data/spec/models/available_user_data_spec.rb +0 -57
- data/spec/models/available_user_datas_spec.rb +0 -41
- data/spec/models/created_webhook_data_spec.rb +0 -59
- data/spec/models/created_webhook_spec.rb +0 -41
- data/spec/models/duration_zone_spec.rb +0 -47
- data/spec/models/error_spec.rb +0 -65
- data/spec/models/exercise_hash_id_spec.rb +0 -125
- data/spec/models/exercise_spec.rb +0 -131
- data/spec/models/exercises_spec.rb +0 -41
- data/spec/models/heart_rate_spec.rb +0 -47
- data/spec/models/physical_information_spec.rb +0 -111
- data/spec/models/physical_informations_spec.rb +0 -41
- data/spec/models/register_spec.rb +0 -41
- data/spec/models/sample_spec.rb +0 -53
- data/spec/models/samples_spec.rb +0 -41
- data/spec/models/transaction_location_spec.rb +0 -47
- data/spec/models/user_extra_info_spec.rb +0 -53
- data/spec/models/user_spec.rb +0 -99
- data/spec/models/webhook_info_data_spec.rb +0 -53
- data/spec/models/webhook_info_spec.rb +0 -41
- data/spec/models/webhook_patch_spec.rb +0 -47
- data/spec/models/webhook_payload_spec.rb +0 -65
- data/spec/models/webhook_ping_spec.rb +0 -51
- data/spec/models/webhook_request_spec.rb +0 -47
- data/spec/models/webhook_type_spec.rb +0 -35
- data/spec/models/zone_spec.rb +0 -59
- data/spec/models/zones_spec.rb +0 -41
@@ -3,14 +3,14 @@
|
|
3
3
|
|
4
4
|
#Polar Accesslink API documentation
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 3.59.0
|
7
7
|
Contact: b2bhelpdesk@polar.com
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.16
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'uri'
|
14
14
|
|
15
15
|
module PolarAccesslink
|
16
16
|
class UsersApi
|
@@ -21,7 +21,7 @@ module PolarAccesslink
|
|
21
21
|
end
|
22
22
|
# Delete user
|
23
23
|
# When partner wishes no longer to receive user data, user can be de-registered.This will revoke the access token authorized by user.
|
24
|
-
# @param user_id
|
24
|
+
# @param user_id User identifier
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @return [nil]
|
27
27
|
def delete_user(user_id, opts = {})
|
@@ -31,9 +31,9 @@ module PolarAccesslink
|
|
31
31
|
|
32
32
|
# Delete user
|
33
33
|
# When partner wishes no longer to receive user data, user can be de-registered.This will revoke the access token authorized by user.
|
34
|
-
# @param user_id
|
34
|
+
# @param user_id User identifier
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
|
-
# @return [Array<(nil,
|
36
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
37
37
|
def delete_user_with_http_info(user_id, opts = {})
|
38
38
|
if @api_client.config.debugging
|
39
39
|
@api_client.config.logger.debug 'Calling API: UsersApi.delete_user ...'
|
@@ -42,63 +42,47 @@ module PolarAccesslink
|
|
42
42
|
if @api_client.config.client_side_validation && user_id.nil?
|
43
43
|
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user"
|
44
44
|
end
|
45
|
-
pattern = Regexp.new(/[0-9]+/)
|
46
|
-
if @api_client.config.client_side_validation && user_id !~ pattern
|
47
|
-
fail ArgumentError, "invalid value for 'user_id' when calling UsersApi.delete_user, must conform to the pattern #{pattern}."
|
48
|
-
end
|
49
|
-
|
50
45
|
# resource path
|
51
|
-
local_var_path = '/v3/users/{user-id}'.sub('{' + 'user-id' + '}',
|
46
|
+
local_var_path = '/v3/users/{user-id}'.sub('{' + 'user-id' + '}', user_id.to_s)
|
52
47
|
|
53
48
|
# query parameters
|
54
|
-
query_params =
|
49
|
+
query_params = {}
|
55
50
|
|
56
51
|
# header parameters
|
57
|
-
header_params =
|
52
|
+
header_params = {}
|
58
53
|
|
59
54
|
# form parameters
|
60
|
-
form_params =
|
55
|
+
form_params = {}
|
61
56
|
|
62
57
|
# http body (model)
|
63
|
-
post_body =
|
64
|
-
|
65
|
-
|
66
|
-
return_type = opts[:return_type]
|
67
|
-
|
68
|
-
# auth_names
|
69
|
-
auth_names = opts[:auth_names] || ['OAuth2']
|
70
|
-
|
71
|
-
new_options = opts.merge(
|
58
|
+
post_body = nil
|
59
|
+
auth_names = []
|
60
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
72
61
|
:header_params => header_params,
|
73
62
|
:query_params => query_params,
|
74
63
|
:form_params => form_params,
|
75
64
|
:body => post_body,
|
76
|
-
:auth_names => auth_names
|
77
|
-
:return_type => return_type
|
78
|
-
)
|
79
|
-
|
80
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
65
|
+
:auth_names => auth_names)
|
81
66
|
if @api_client.config.debugging
|
82
67
|
@api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
83
68
|
end
|
84
69
|
return data, status_code, headers
|
85
70
|
end
|
86
|
-
|
87
71
|
# Get user information
|
88
72
|
# List user basic information. Note: Although it is possible to get users weight and height from this resource, the [get physical info](#get-physical-info) should be used instead.
|
89
|
-
# @param user_id
|
73
|
+
# @param user_id User identifier
|
90
74
|
# @param [Hash] opts the optional parameters
|
91
|
-
# @return [
|
75
|
+
# @return [nil]
|
92
76
|
def get_user_information(user_id, opts = {})
|
93
|
-
|
94
|
-
|
77
|
+
get_user_information_with_http_info(user_id, opts)
|
78
|
+
nil
|
95
79
|
end
|
96
80
|
|
97
81
|
# Get user information
|
98
82
|
# List user basic information. Note: Although it is possible to get users weight and height from this resource, the [get physical info](#get-physical-info) should be used instead.
|
99
|
-
# @param user_id
|
83
|
+
# @param user_id User identifier
|
100
84
|
# @param [Hash] opts the optional parameters
|
101
|
-
# @return [Array<(
|
85
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
102
86
|
def get_user_information_with_http_info(user_id, opts = {})
|
103
87
|
if @api_client.config.debugging
|
104
88
|
@api_client.config.logger.debug 'Calling API: UsersApi.get_user_information ...'
|
@@ -107,108 +91,70 @@ module PolarAccesslink
|
|
107
91
|
if @api_client.config.client_side_validation && user_id.nil?
|
108
92
|
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_information"
|
109
93
|
end
|
110
|
-
pattern = Regexp.new(/[0-9]+/)
|
111
|
-
if @api_client.config.client_side_validation && user_id !~ pattern
|
112
|
-
fail ArgumentError, "invalid value for 'user_id' when calling UsersApi.get_user_information, must conform to the pattern #{pattern}."
|
113
|
-
end
|
114
|
-
|
115
94
|
# resource path
|
116
|
-
local_var_path = '/v3/users/{user-id}'.sub('{' + 'user-id' + '}',
|
95
|
+
local_var_path = '/v3/users/{user-id}'.sub('{' + 'user-id' + '}', user_id.to_s)
|
117
96
|
|
118
97
|
# query parameters
|
119
|
-
query_params =
|
98
|
+
query_params = {}
|
120
99
|
|
121
100
|
# header parameters
|
122
|
-
header_params =
|
123
|
-
# HTTP header 'Accept' (if needed)
|
124
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
101
|
+
header_params = {}
|
125
102
|
|
126
103
|
# form parameters
|
127
|
-
form_params =
|
104
|
+
form_params = {}
|
128
105
|
|
129
106
|
# http body (model)
|
130
|
-
post_body =
|
131
|
-
|
132
|
-
|
133
|
-
return_type = opts[:return_type] || 'User'
|
134
|
-
|
135
|
-
# auth_names
|
136
|
-
auth_names = opts[:auth_names] || ['OAuth2']
|
137
|
-
|
138
|
-
new_options = opts.merge(
|
107
|
+
post_body = nil
|
108
|
+
auth_names = []
|
109
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
139
110
|
:header_params => header_params,
|
140
111
|
:query_params => query_params,
|
141
112
|
:form_params => form_params,
|
142
113
|
:body => post_body,
|
143
|
-
:auth_names => auth_names
|
144
|
-
:return_type => return_type
|
145
|
-
)
|
146
|
-
|
147
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
114
|
+
:auth_names => auth_names)
|
148
115
|
if @api_client.config.debugging
|
149
116
|
@api_client.config.logger.debug "API called: UsersApi#get_user_information\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
150
117
|
end
|
151
118
|
return data, status_code, headers
|
152
119
|
end
|
153
|
-
|
154
120
|
# Register user
|
155
121
|
# Once partner has been authorized by user, partner must register user before being able to access her data.
|
156
|
-
# @param register [Register]
|
157
122
|
# @param [Hash] opts the optional parameters
|
158
|
-
# @return [
|
159
|
-
def register_user(
|
160
|
-
|
161
|
-
|
123
|
+
# @return [nil]
|
124
|
+
def register_user(opts = {})
|
125
|
+
register_user_with_http_info(opts)
|
126
|
+
nil
|
162
127
|
end
|
163
128
|
|
164
129
|
# Register user
|
165
130
|
# Once partner has been authorized by user, partner must register user before being able to access her data.
|
166
|
-
# @param register [Register]
|
167
131
|
# @param [Hash] opts the optional parameters
|
168
|
-
# @return [Array<(
|
169
|
-
def register_user_with_http_info(
|
132
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
133
|
+
def register_user_with_http_info(opts = {})
|
170
134
|
if @api_client.config.debugging
|
171
135
|
@api_client.config.logger.debug 'Calling API: UsersApi.register_user ...'
|
172
136
|
end
|
173
|
-
# verify the required parameter 'register' is set
|
174
|
-
if @api_client.config.client_side_validation && register.nil?
|
175
|
-
fail ArgumentError, "Missing the required parameter 'register' when calling UsersApi.register_user"
|
176
|
-
end
|
177
137
|
# resource path
|
178
138
|
local_var_path = '/v3/users'
|
179
139
|
|
180
140
|
# query parameters
|
181
|
-
query_params =
|
141
|
+
query_params = {}
|
182
142
|
|
183
143
|
# header parameters
|
184
|
-
header_params =
|
185
|
-
# HTTP header 'Accept' (if needed)
|
186
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
187
|
-
# HTTP header 'Content-Type'
|
188
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml', 'application/json'])
|
144
|
+
header_params = {}
|
189
145
|
|
190
146
|
# form parameters
|
191
|
-
form_params =
|
147
|
+
form_params = {}
|
192
148
|
|
193
149
|
# http body (model)
|
194
|
-
post_body =
|
195
|
-
|
196
|
-
|
197
|
-
return_type = opts[:return_type] || 'User'
|
198
|
-
|
199
|
-
# auth_names
|
200
|
-
auth_names = opts[:auth_names] || ['OAuth2']
|
201
|
-
|
202
|
-
new_options = opts.merge(
|
150
|
+
post_body = nil
|
151
|
+
auth_names = []
|
152
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
203
153
|
:header_params => header_params,
|
204
154
|
:query_params => query_params,
|
205
155
|
:form_params => form_params,
|
206
156
|
:body => post_body,
|
207
|
-
:auth_names => auth_names
|
208
|
-
:return_type => return_type
|
209
|
-
)
|
210
|
-
|
211
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
157
|
+
:auth_names => auth_names)
|
212
158
|
if @api_client.config.debugging
|
213
159
|
@api_client.config.logger.debug "API called: UsersApi#register_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
214
160
|
end
|
@@ -3,14 +3,14 @@
|
|
3
3
|
|
4
4
|
#Polar Accesslink API documentation
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 3.59.0
|
7
7
|
Contact: b2bhelpdesk@polar.com
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.16
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'uri'
|
14
14
|
|
15
15
|
module PolarAccesslink
|
16
16
|
class WebhooksApi
|
@@ -20,72 +20,51 @@ module PolarAccesslink
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Create webhook
|
23
|
-
# 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.
|
24
|
-
# @param webhook_request [WebhookRequest] Webhook to create.
|
23
|
+
# 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. **Please also note** that currently there is an issue with SLEEP event delivery. You can still subscribe to them but you will not receive SLEEP events through the webhook at the moment. We are working on fixing the issue and you will start to receive SLEEP events eventually.
|
25
24
|
# @param [Hash] opts the optional parameters
|
26
|
-
# @return [
|
27
|
-
def create_webhook(
|
28
|
-
|
29
|
-
|
25
|
+
# @return [nil]
|
26
|
+
def create_webhook(opts = {})
|
27
|
+
create_webhook_with_http_info(opts)
|
28
|
+
nil
|
30
29
|
end
|
31
30
|
|
32
31
|
# Create webhook
|
33
|
-
# 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.
|
34
|
-
# @param webhook_request [WebhookRequest] Webhook to create.
|
32
|
+
# 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. **Please also note** that currently there is an issue with SLEEP event delivery. You can still subscribe to them but you will not receive SLEEP events through the webhook at the moment. We are working on fixing the issue and you will start to receive SLEEP events eventually.
|
35
33
|
# @param [Hash] opts the optional parameters
|
36
|
-
# @return [Array<(
|
37
|
-
def create_webhook_with_http_info(
|
34
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
35
|
+
def create_webhook_with_http_info(opts = {})
|
38
36
|
if @api_client.config.debugging
|
39
37
|
@api_client.config.logger.debug 'Calling API: WebhooksApi.create_webhook ...'
|
40
38
|
end
|
41
|
-
# verify the required parameter 'webhook_request' is set
|
42
|
-
if @api_client.config.client_side_validation && webhook_request.nil?
|
43
|
-
fail ArgumentError, "Missing the required parameter 'webhook_request' when calling WebhooksApi.create_webhook"
|
44
|
-
end
|
45
39
|
# resource path
|
46
40
|
local_var_path = '/v3/webhooks'
|
47
41
|
|
48
42
|
# query parameters
|
49
|
-
query_params =
|
43
|
+
query_params = {}
|
50
44
|
|
51
45
|
# header parameters
|
52
|
-
header_params =
|
53
|
-
# HTTP header 'Accept' (if needed)
|
54
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
-
# HTTP header 'Content-Type'
|
56
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
46
|
+
header_params = {}
|
57
47
|
|
58
48
|
# form parameters
|
59
|
-
form_params =
|
49
|
+
form_params = {}
|
60
50
|
|
61
51
|
# http body (model)
|
62
|
-
post_body =
|
63
|
-
|
64
|
-
|
65
|
-
return_type = opts[:return_type] || 'CreatedWebhook'
|
66
|
-
|
67
|
-
# auth_names
|
68
|
-
auth_names = opts[:auth_names] || ['Basic']
|
69
|
-
|
70
|
-
new_options = opts.merge(
|
52
|
+
post_body = nil
|
53
|
+
auth_names = []
|
54
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
71
55
|
:header_params => header_params,
|
72
56
|
:query_params => query_params,
|
73
57
|
:form_params => form_params,
|
74
58
|
:body => post_body,
|
75
|
-
:auth_names => auth_names
|
76
|
-
:return_type => return_type
|
77
|
-
)
|
78
|
-
|
79
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
59
|
+
:auth_names => auth_names)
|
80
60
|
if @api_client.config.debugging
|
81
61
|
@api_client.config.logger.debug "API called: WebhooksApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
62
|
end
|
83
63
|
return data, status_code, headers
|
84
64
|
end
|
85
|
-
|
86
65
|
# Delete webhook
|
87
66
|
# Delete webhook by id.
|
88
|
-
# @param webhook_id
|
67
|
+
# @param webhook_id Webhook id to delete
|
89
68
|
# @param [Hash] opts the optional parameters
|
90
69
|
# @return [nil]
|
91
70
|
def delete_webhook(webhook_id, opts = {})
|
@@ -95,9 +74,9 @@ module PolarAccesslink
|
|
95
74
|
|
96
75
|
# Delete webhook
|
97
76
|
# Delete webhook by id.
|
98
|
-
# @param webhook_id
|
77
|
+
# @param webhook_id Webhook id to delete
|
99
78
|
# @param [Hash] opts the optional parameters
|
100
|
-
# @return [Array<(nil,
|
79
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
101
80
|
def delete_webhook_with_http_info(webhook_id, opts = {})
|
102
81
|
if @api_client.config.debugging
|
103
82
|
@api_client.config.logger.debug 'Calling API: WebhooksApi.delete_webhook ...'
|
@@ -107,57 +86,44 @@ module PolarAccesslink
|
|
107
86
|
fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.delete_webhook"
|
108
87
|
end
|
109
88
|
# resource path
|
110
|
-
local_var_path = '/v3/webhooks/{webhook-id}'.sub('{' + 'webhook-id' + '}',
|
89
|
+
local_var_path = '/v3/webhooks/{webhook-id}'.sub('{' + 'webhook-id' + '}', webhook_id.to_s)
|
111
90
|
|
112
91
|
# query parameters
|
113
|
-
query_params =
|
92
|
+
query_params = {}
|
114
93
|
|
115
94
|
# header parameters
|
116
|
-
header_params =
|
117
|
-
# HTTP header 'Accept' (if needed)
|
118
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
95
|
+
header_params = {}
|
119
96
|
|
120
97
|
# form parameters
|
121
|
-
form_params =
|
98
|
+
form_params = {}
|
122
99
|
|
123
100
|
# http body (model)
|
124
|
-
post_body =
|
125
|
-
|
126
|
-
|
127
|
-
return_type = opts[:return_type]
|
128
|
-
|
129
|
-
# auth_names
|
130
|
-
auth_names = opts[:auth_names] || ['Basic']
|
131
|
-
|
132
|
-
new_options = opts.merge(
|
101
|
+
post_body = nil
|
102
|
+
auth_names = []
|
103
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
133
104
|
:header_params => header_params,
|
134
105
|
:query_params => query_params,
|
135
106
|
:form_params => form_params,
|
136
107
|
:body => post_body,
|
137
|
-
:auth_names => auth_names
|
138
|
-
:return_type => return_type
|
139
|
-
)
|
140
|
-
|
141
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
108
|
+
:auth_names => auth_names)
|
142
109
|
if @api_client.config.debugging
|
143
110
|
@api_client.config.logger.debug "API called: WebhooksApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
144
111
|
end
|
145
112
|
return data, status_code, headers
|
146
113
|
end
|
147
|
-
|
148
114
|
# Get webhook
|
149
115
|
# Returns created webhook if exists.
|
150
116
|
# @param [Hash] opts the optional parameters
|
151
|
-
# @return [
|
117
|
+
# @return [nil]
|
152
118
|
def get_webhook(opts = {})
|
153
|
-
|
154
|
-
|
119
|
+
get_webhook_with_http_info(opts)
|
120
|
+
nil
|
155
121
|
end
|
156
122
|
|
157
123
|
# Get webhook
|
158
124
|
# Returns created webhook if exists.
|
159
125
|
# @param [Hash] opts the optional parameters
|
160
|
-
# @return [Array<(
|
126
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
161
127
|
def get_webhook_with_http_info(opts = {})
|
162
128
|
if @api_client.config.debugging
|
163
129
|
@api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook ...'
|
@@ -166,59 +132,44 @@ module PolarAccesslink
|
|
166
132
|
local_var_path = '/v3/webhooks'
|
167
133
|
|
168
134
|
# query parameters
|
169
|
-
query_params =
|
135
|
+
query_params = {}
|
170
136
|
|
171
137
|
# header parameters
|
172
|
-
header_params =
|
173
|
-
# HTTP header 'Accept' (if needed)
|
174
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
138
|
+
header_params = {}
|
175
139
|
|
176
140
|
# form parameters
|
177
|
-
form_params =
|
141
|
+
form_params = {}
|
178
142
|
|
179
143
|
# http body (model)
|
180
|
-
post_body =
|
181
|
-
|
182
|
-
|
183
|
-
return_type = opts[:return_type] || 'WebhookInfo'
|
184
|
-
|
185
|
-
# auth_names
|
186
|
-
auth_names = opts[:auth_names] || ['Basic']
|
187
|
-
|
188
|
-
new_options = opts.merge(
|
144
|
+
post_body = nil
|
145
|
+
auth_names = []
|
146
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
189
147
|
:header_params => header_params,
|
190
148
|
:query_params => query_params,
|
191
149
|
:form_params => form_params,
|
192
150
|
:body => post_body,
|
193
|
-
:auth_names => auth_names
|
194
|
-
:return_type => return_type
|
195
|
-
)
|
196
|
-
|
197
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
151
|
+
:auth_names => auth_names)
|
198
152
|
if @api_client.config.debugging
|
199
153
|
@api_client.config.logger.debug "API called: WebhooksApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
200
154
|
end
|
201
155
|
return data, status_code, headers
|
202
156
|
end
|
203
|
-
|
204
157
|
# Update webhook
|
205
|
-
# 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.
|
206
|
-
# @param webhook_id
|
207
|
-
# @param webhook_patch [WebhookPatch] New value(s) for events and/or url.
|
158
|
+
# 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. **Please note** that currently there is an issue with SLEEP event delivery. You can still subscribe to them but you will not receive SLEEP events through the webhook at the moment. We are working on fixing the issue and you will start to receive SLEEP events eventually.
|
159
|
+
# @param webhook_id Webhook id to update
|
208
160
|
# @param [Hash] opts the optional parameters
|
209
|
-
# @return [
|
210
|
-
def update_webhook(webhook_id,
|
211
|
-
|
212
|
-
|
161
|
+
# @return [nil]
|
162
|
+
def update_webhook(webhook_id, opts = {})
|
163
|
+
update_webhook_with_http_info(webhook_id, opts)
|
164
|
+
nil
|
213
165
|
end
|
214
166
|
|
215
167
|
# Update webhook
|
216
|
-
# 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.
|
217
|
-
# @param webhook_id
|
218
|
-
# @param webhook_patch [WebhookPatch] New value(s) for events and/or url.
|
168
|
+
# 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. **Please note** that currently there is an issue with SLEEP event delivery. You can still subscribe to them but you will not receive SLEEP events through the webhook at the moment. We are working on fixing the issue and you will start to receive SLEEP events eventually.
|
169
|
+
# @param webhook_id Webhook id to update
|
219
170
|
# @param [Hash] opts the optional parameters
|
220
|
-
# @return [Array<(
|
221
|
-
def update_webhook_with_http_info(webhook_id,
|
171
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
172
|
+
def update_webhook_with_http_info(webhook_id, opts = {})
|
222
173
|
if @api_client.config.debugging
|
223
174
|
@api_client.config.logger.debug 'Calling API: WebhooksApi.update_webhook ...'
|
224
175
|
end
|
@@ -226,45 +177,27 @@ module PolarAccesslink
|
|
226
177
|
if @api_client.config.client_side_validation && webhook_id.nil?
|
227
178
|
fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.update_webhook"
|
228
179
|
end
|
229
|
-
# verify the required parameter 'webhook_patch' is set
|
230
|
-
if @api_client.config.client_side_validation && webhook_patch.nil?
|
231
|
-
fail ArgumentError, "Missing the required parameter 'webhook_patch' when calling WebhooksApi.update_webhook"
|
232
|
-
end
|
233
180
|
# resource path
|
234
|
-
local_var_path = '/v3/webhooks/{webhook-id}'.sub('{' + 'webhook-id' + '}',
|
181
|
+
local_var_path = '/v3/webhooks/{webhook-id}'.sub('{' + 'webhook-id' + '}', webhook_id.to_s)
|
235
182
|
|
236
183
|
# query parameters
|
237
|
-
query_params =
|
184
|
+
query_params = {}
|
238
185
|
|
239
186
|
# header parameters
|
240
|
-
header_params =
|
241
|
-
# HTTP header 'Accept' (if needed)
|
242
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
243
|
-
# HTTP header 'Content-Type'
|
244
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
187
|
+
header_params = {}
|
245
188
|
|
246
189
|
# form parameters
|
247
|
-
form_params =
|
190
|
+
form_params = {}
|
248
191
|
|
249
192
|
# http body (model)
|
250
|
-
post_body =
|
251
|
-
|
252
|
-
|
253
|
-
return_type = opts[:return_type] || 'WebhookInfo'
|
254
|
-
|
255
|
-
# auth_names
|
256
|
-
auth_names = opts[:auth_names] || ['Basic']
|
257
|
-
|
258
|
-
new_options = opts.merge(
|
193
|
+
post_body = nil
|
194
|
+
auth_names = []
|
195
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
259
196
|
:header_params => header_params,
|
260
197
|
:query_params => query_params,
|
261
198
|
:form_params => form_params,
|
262
199
|
:body => post_body,
|
263
|
-
:auth_names => auth_names
|
264
|
-
:return_type => return_type
|
265
|
-
)
|
266
|
-
|
267
|
-
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
200
|
+
:auth_names => auth_names)
|
268
201
|
if @api_client.config.debugging
|
269
202
|
@api_client.config.logger.debug "API called: WebhooksApi#update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
270
203
|
end
|