polar_accesslink 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +70 -0
  4. data/README.md +170 -0
  5. data/Rakefile +10 -0
  6. data/docs/Activity.md +33 -0
  7. data/docs/ActivityLog.md +17 -0
  8. data/docs/ActivityStepSample.md +19 -0
  9. data/docs/ActivityStepSamples.md +19 -0
  10. data/docs/ActivityZoneSample.md +19 -0
  11. data/docs/ActivityZoneSamples.md +19 -0
  12. data/docs/AvailableUserData.md +21 -0
  13. data/docs/AvailableUserDatas.md +17 -0
  14. data/docs/CreatedWebhook.md +17 -0
  15. data/docs/CreatedWebhookData.md +23 -0
  16. data/docs/DailyActivityApi.md +339 -0
  17. data/docs/DurationZone.md +19 -0
  18. data/docs/Error.md +25 -0
  19. data/docs/Exercise.md +47 -0
  20. data/docs/ExerciseHashId.md +45 -0
  21. data/docs/Exercises.md +17 -0
  22. data/docs/ExercisesApi.md +163 -0
  23. data/docs/HeartRate.md +19 -0
  24. data/docs/PhysicalInfoApi.md +227 -0
  25. data/docs/PhysicalInformation.md +39 -0
  26. data/docs/PhysicalInformations.md +17 -0
  27. data/docs/PullNotificationsApi.md +58 -0
  28. data/docs/Register.md +17 -0
  29. data/docs/Sample.md +21 -0
  30. data/docs/Samples.md +17 -0
  31. data/docs/TrainingDataApi.md +571 -0
  32. data/docs/TransactionLocation.md +19 -0
  33. data/docs/User.md +35 -0
  34. data/docs/UserExtraInfo.md +21 -0
  35. data/docs/UsersApi.md +166 -0
  36. data/docs/WebhookInfo.md +17 -0
  37. data/docs/WebhookInfoData.md +21 -0
  38. data/docs/WebhookPatch.md +19 -0
  39. data/docs/WebhookPayload.md +25 -0
  40. data/docs/WebhookPing.md +19 -0
  41. data/docs/WebhookRequest.md +19 -0
  42. data/docs/WebhookType.md +16 -0
  43. data/docs/WebhooksApi.md +221 -0
  44. data/docs/Zone.md +23 -0
  45. data/docs/Zones.md +17 -0
  46. data/lib/.DS_Store +0 -0
  47. data/lib/polar_accesslink/.DS_Store +0 -0
  48. data/lib/polar_accesslink/api/daily_activity_api.rb +463 -0
  49. data/lib/polar_accesslink/api/exercises_api.rb +202 -0
  50. data/lib/polar_accesslink/api/physical_info_api.rb +292 -0
  51. data/lib/polar_accesslink/api/pull_notifications_api.rb +78 -0
  52. data/lib/polar_accesslink/api/training_data_api.rb +772 -0
  53. data/lib/polar_accesslink/api/users_api.rb +218 -0
  54. data/lib/polar_accesslink/api/webhooks_api.rb +274 -0
  55. data/lib/polar_accesslink/api_client.rb +386 -0
  56. data/lib/polar_accesslink/api_error.rb +57 -0
  57. data/lib/polar_accesslink/configuration.rb +255 -0
  58. data/lib/polar_accesslink/models/activity.rb +288 -0
  59. data/lib/polar_accesslink/models/activity_log.rb +210 -0
  60. data/lib/polar_accesslink/models/activity_step_sample.rb +218 -0
  61. data/lib/polar_accesslink/models/activity_step_samples.rb +220 -0
  62. data/lib/polar_accesslink/models/activity_zone_sample.rb +220 -0
  63. data/lib/polar_accesslink/models/activity_zone_samples.rb +220 -0
  64. data/lib/polar_accesslink/models/available_user_data.rb +262 -0
  65. data/lib/polar_accesslink/models/available_user_datas.rb +210 -0
  66. data/lib/polar_accesslink/models/created_webhook.rb +206 -0
  67. data/lib/polar_accesslink/models/created_webhook_data.rb +236 -0
  68. data/lib/polar_accesslink/models/duration_zone.rb +218 -0
  69. data/lib/polar_accesslink/models/error.rb +248 -0
  70. data/lib/polar_accesslink/models/exercise.rb +357 -0
  71. data/lib/polar_accesslink/models/exercise_hash_id.rb +347 -0
  72. data/lib/polar_accesslink/models/exercises.rb +210 -0
  73. data/lib/polar_accesslink/models/heart_rate.rb +218 -0
  74. data/lib/polar_accesslink/models/physical_information.rb +352 -0
  75. data/lib/polar_accesslink/models/physical_informations.rb +210 -0
  76. data/lib/polar_accesslink/models/register.rb +213 -0
  77. data/lib/polar_accesslink/models/sample.rb +228 -0
  78. data/lib/polar_accesslink/models/samples.rb +210 -0
  79. data/lib/polar_accesslink/models/transaction_location.rb +218 -0
  80. data/lib/polar_accesslink/models/user.rb +334 -0
  81. data/lib/polar_accesslink/models/user_extra_info.rb +228 -0
  82. data/lib/polar_accesslink/models/webhook_info.rb +206 -0
  83. data/lib/polar_accesslink/models/webhook_info_data.rb +226 -0
  84. data/lib/polar_accesslink/models/webhook_patch.rb +219 -0
  85. data/lib/polar_accesslink/models/webhook_payload.rb +246 -0
  86. data/lib/polar_accesslink/models/webhook_ping.rb +252 -0
  87. data/lib/polar_accesslink/models/webhook_request.rb +229 -0
  88. data/lib/polar_accesslink/models/webhook_type.rb +37 -0
  89. data/lib/polar_accesslink/models/zone.rb +238 -0
  90. data/lib/polar_accesslink/models/zones.rb +210 -0
  91. data/lib/polar_accesslink/version.rb +15 -0
  92. data/lib/polar_accesslink.rb +79 -0
  93. data/polar_accesslink-1.0.0.gem +0 -0
  94. data/polar_accesslink.gemspec +38 -0
  95. data/spec/api/daily_activity_api_spec.rb +114 -0
  96. data/spec/api/exercises_api_spec.rb +70 -0
  97. data/spec/api/physical_info_api_spec.rb +87 -0
  98. data/spec/api/pull_notifications_api_spec.rb +46 -0
  99. data/spec/api/training_data_api_spec.rb +172 -0
  100. data/spec/api/users_api_spec.rb +71 -0
  101. data/spec/api/webhooks_api_spec.rb +83 -0
  102. data/spec/api_client_spec.rb +226 -0
  103. data/spec/configuration_spec.rb +42 -0
  104. data/spec/models/activity_log_spec.rb +41 -0
  105. data/spec/models/activity_spec.rb +89 -0
  106. data/spec/models/activity_step_sample_spec.rb +47 -0
  107. data/spec/models/activity_step_samples_spec.rb +47 -0
  108. data/spec/models/activity_zone_sample_spec.rb +47 -0
  109. data/spec/models/activity_zone_samples_spec.rb +47 -0
  110. data/spec/models/available_user_data_spec.rb +57 -0
  111. data/spec/models/available_user_datas_spec.rb +41 -0
  112. data/spec/models/created_webhook_data_spec.rb +59 -0
  113. data/spec/models/created_webhook_spec.rb +41 -0
  114. data/spec/models/duration_zone_spec.rb +47 -0
  115. data/spec/models/error_spec.rb +65 -0
  116. data/spec/models/exercise_hash_id_spec.rb +125 -0
  117. data/spec/models/exercise_spec.rb +131 -0
  118. data/spec/models/exercises_spec.rb +41 -0
  119. data/spec/models/heart_rate_spec.rb +47 -0
  120. data/spec/models/physical_information_spec.rb +111 -0
  121. data/spec/models/physical_informations_spec.rb +41 -0
  122. data/spec/models/register_spec.rb +41 -0
  123. data/spec/models/sample_spec.rb +53 -0
  124. data/spec/models/samples_spec.rb +41 -0
  125. data/spec/models/transaction_location_spec.rb +47 -0
  126. data/spec/models/user_extra_info_spec.rb +53 -0
  127. data/spec/models/user_spec.rb +99 -0
  128. data/spec/models/webhook_info_data_spec.rb +53 -0
  129. data/spec/models/webhook_info_spec.rb +41 -0
  130. data/spec/models/webhook_patch_spec.rb +47 -0
  131. data/spec/models/webhook_payload_spec.rb +65 -0
  132. data/spec/models/webhook_ping_spec.rb +51 -0
  133. data/spec/models/webhook_request_spec.rb +47 -0
  134. data/spec/models/webhook_type_spec.rb +35 -0
  135. data/spec/models/zone_spec.rb +59 -0
  136. data/spec/models/zones_spec.rb +41 -0
  137. data/spec/spec_helper.rb +111 -0
  138. metadata +282 -0
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #Polar Accesslink API
3
+
4
+ #Polar Accesslink API documentation
5
+
6
+ The version of the OpenAPI document: 3.40.0
7
+ Contact: b2bhelpdesk@polar.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module PolarAccesslink
16
+ class UsersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete user
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 [Integer] User identifier
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [nil]
27
+ def delete_user(user_id, opts = {})
28
+ delete_user_with_http_info(user_id, opts)
29
+ nil
30
+ end
31
+
32
+ # Delete user
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 [Integer] User identifier
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
37
+ def delete_user_with_http_info(user_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: UsersApi.delete_user ...'
40
+ end
41
+ # verify the required parameter 'user_id' is set
42
+ if @api_client.config.client_side_validation && user_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user"
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
+ # resource path
51
+ local_var_path = '/v3/users/{user-id}'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
52
+
53
+ # query parameters
54
+ query_params = opts[:query_params] || {}
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:body]
64
+
65
+ # return_type
66
+ return_type = opts[:return_type]
67
+
68
+ # auth_names
69
+ auth_names = opts[:auth_names] || ['OAuth2']
70
+
71
+ new_options = opts.merge(
72
+ :header_params => header_params,
73
+ :query_params => query_params,
74
+ :form_params => form_params,
75
+ :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)
81
+ if @api_client.config.debugging
82
+ @api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
+ end
84
+ return data, status_code, headers
85
+ end
86
+
87
+ # Get user information
88
+ # 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 [Integer] User identifier
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [User]
92
+ def get_user_information(user_id, opts = {})
93
+ data, _status_code, _headers = get_user_information_with_http_info(user_id, opts)
94
+ data
95
+ end
96
+
97
+ # Get user information
98
+ # 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 [Integer] User identifier
100
+ # @param [Hash] opts the optional parameters
101
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
102
+ def get_user_information_with_http_info(user_id, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: UsersApi.get_user_information ...'
105
+ end
106
+ # verify the required parameter 'user_id' is set
107
+ if @api_client.config.client_side_validation && user_id.nil?
108
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_information"
109
+ 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
+ # resource path
116
+ local_var_path = '/v3/users/{user-id}'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+ # HTTP header 'Accept' (if needed)
124
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
125
+
126
+ # form parameters
127
+ form_params = opts[:form_params] || {}
128
+
129
+ # http body (model)
130
+ post_body = opts[:body]
131
+
132
+ # return_type
133
+ return_type = opts[:return_type] || 'User'
134
+
135
+ # auth_names
136
+ auth_names = opts[:auth_names] || ['OAuth2']
137
+
138
+ new_options = opts.merge(
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :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)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: UsersApi#get_user_information\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+
154
+ # Register user
155
+ # Once partner has been authorized by user, partner must register user before being able to access her data.
156
+ # @param register [Register]
157
+ # @param [Hash] opts the optional parameters
158
+ # @return [User]
159
+ def register_user(register, opts = {})
160
+ data, _status_code, _headers = register_user_with_http_info(register, opts)
161
+ data
162
+ end
163
+
164
+ # Register user
165
+ # Once partner has been authorized by user, partner must register user before being able to access her data.
166
+ # @param register [Register]
167
+ # @param [Hash] opts the optional parameters
168
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
169
+ def register_user_with_http_info(register, opts = {})
170
+ if @api_client.config.debugging
171
+ @api_client.config.logger.debug 'Calling API: UsersApi.register_user ...'
172
+ 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
+ # resource path
178
+ local_var_path = '/v3/users'
179
+
180
+ # query parameters
181
+ query_params = opts[:query_params] || {}
182
+
183
+ # header parameters
184
+ header_params = opts[: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'])
189
+
190
+ # form parameters
191
+ form_params = opts[:form_params] || {}
192
+
193
+ # http body (model)
194
+ post_body = opts[:body] || @api_client.object_to_http_body(register)
195
+
196
+ # return_type
197
+ return_type = opts[:return_type] || 'User'
198
+
199
+ # auth_names
200
+ auth_names = opts[:auth_names] || ['OAuth2']
201
+
202
+ new_options = opts.merge(
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :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)
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug "API called: UsersApi#register_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
214
+ end
215
+ return data, status_code, headers
216
+ end
217
+ end
218
+ end
@@ -0,0 +1,274 @@
1
+ =begin
2
+ #Polar Accesslink API
3
+
4
+ #Polar Accesslink API documentation
5
+
6
+ The version of the OpenAPI document: 3.40.0
7
+ Contact: b2bhelpdesk@polar.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module PolarAccesslink
16
+ class WebhooksApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
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.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [CreatedWebhook]
27
+ def create_webhook(webhook_request, opts = {})
28
+ data, _status_code, _headers = create_webhook_with_http_info(webhook_request, opts)
29
+ data
30
+ end
31
+
32
+ # 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.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(CreatedWebhook, Integer, Hash)>] CreatedWebhook data, response status code and response headers
37
+ def create_webhook_with_http_info(webhook_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.create_webhook ...'
40
+ 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
+ # resource path
46
+ local_var_path = '/v3/webhooks'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[: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'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body] || @api_client.object_to_http_body(webhook_request)
63
+
64
+ # return_type
65
+ return_type = opts[:return_type] || 'CreatedWebhook'
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['Basic']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :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)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: WebhooksApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Delete webhook
87
+ # Delete webhook by id.
88
+ # @param webhook_id [Integer] Webhook id to delete
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [nil]
91
+ def delete_webhook(webhook_id, opts = {})
92
+ delete_webhook_with_http_info(webhook_id, opts)
93
+ nil
94
+ end
95
+
96
+ # Delete webhook
97
+ # Delete webhook by id.
98
+ # @param webhook_id [Integer] Webhook id to delete
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
101
+ def delete_webhook_with_http_info(webhook_id, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.delete_webhook ...'
104
+ end
105
+ # verify the required parameter 'webhook_id' is set
106
+ if @api_client.config.client_side_validation && webhook_id.nil?
107
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.delete_webhook"
108
+ end
109
+ # resource path
110
+ local_var_path = '/v3/webhooks/{webhook-id}'.sub('{' + 'webhook-id' + '}', CGI.escape(webhook_id.to_s))
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
119
+
120
+ # form parameters
121
+ form_params = opts[:form_params] || {}
122
+
123
+ # http body (model)
124
+ post_body = opts[:body]
125
+
126
+ # return_type
127
+ return_type = opts[:return_type]
128
+
129
+ # auth_names
130
+ auth_names = opts[:auth_names] || ['Basic']
131
+
132
+ new_options = opts.merge(
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :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)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: WebhooksApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # Get webhook
149
+ # Returns created webhook if exists.
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [WebhookInfo]
152
+ def get_webhook(opts = {})
153
+ data, _status_code, _headers = get_webhook_with_http_info(opts)
154
+ data
155
+ end
156
+
157
+ # Get webhook
158
+ # Returns created webhook if exists.
159
+ # @param [Hash] opts the optional parameters
160
+ # @return [Array<(WebhookInfo, Integer, Hash)>] WebhookInfo data, response status code and response headers
161
+ def get_webhook_with_http_info(opts = {})
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook ...'
164
+ end
165
+ # resource path
166
+ local_var_path = '/v3/webhooks'
167
+
168
+ # query parameters
169
+ query_params = opts[:query_params] || {}
170
+
171
+ # header parameters
172
+ header_params = opts[:header_params] || {}
173
+ # HTTP header 'Accept' (if needed)
174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
175
+
176
+ # form parameters
177
+ form_params = opts[:form_params] || {}
178
+
179
+ # http body (model)
180
+ post_body = opts[:body]
181
+
182
+ # return_type
183
+ return_type = opts[:return_type] || 'WebhookInfo'
184
+
185
+ # auth_names
186
+ auth_names = opts[:auth_names] || ['Basic']
187
+
188
+ new_options = opts.merge(
189
+ :header_params => header_params,
190
+ :query_params => query_params,
191
+ :form_params => form_params,
192
+ :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)
198
+ if @api_client.config.debugging
199
+ @api_client.config.logger.debug "API called: WebhooksApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
200
+ end
201
+ return data, status_code, headers
202
+ end
203
+
204
+ # 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 [Integer] Webhook id to update
207
+ # @param webhook_patch [WebhookPatch] New value(s) for events and/or url.
208
+ # @param [Hash] opts the optional parameters
209
+ # @return [WebhookInfo]
210
+ def update_webhook(webhook_id, webhook_patch, opts = {})
211
+ data, _status_code, _headers = update_webhook_with_http_info(webhook_id, webhook_patch, opts)
212
+ data
213
+ end
214
+
215
+ # 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 [Integer] Webhook id to update
218
+ # @param webhook_patch [WebhookPatch] New value(s) for events and/or url.
219
+ # @param [Hash] opts the optional parameters
220
+ # @return [Array<(WebhookInfo, Integer, Hash)>] WebhookInfo data, response status code and response headers
221
+ def update_webhook_with_http_info(webhook_id, webhook_patch, opts = {})
222
+ if @api_client.config.debugging
223
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.update_webhook ...'
224
+ end
225
+ # verify the required parameter 'webhook_id' is set
226
+ if @api_client.config.client_side_validation && webhook_id.nil?
227
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.update_webhook"
228
+ 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
+ # resource path
234
+ local_var_path = '/v3/webhooks/{webhook-id}'.sub('{' + 'webhook-id' + '}', CGI.escape(webhook_id.to_s))
235
+
236
+ # query parameters
237
+ query_params = opts[:query_params] || {}
238
+
239
+ # header parameters
240
+ header_params = opts[: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'])
245
+
246
+ # form parameters
247
+ form_params = opts[:form_params] || {}
248
+
249
+ # http body (model)
250
+ post_body = opts[:body] || @api_client.object_to_http_body(webhook_patch)
251
+
252
+ # return_type
253
+ return_type = opts[:return_type] || 'WebhookInfo'
254
+
255
+ # auth_names
256
+ auth_names = opts[:auth_names] || ['Basic']
257
+
258
+ new_options = opts.merge(
259
+ :header_params => header_params,
260
+ :query_params => query_params,
261
+ :form_params => form_params,
262
+ :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)
268
+ if @api_client.config.debugging
269
+ @api_client.config.logger.debug "API called: WebhooksApi#update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
270
+ end
271
+ return data, status_code, headers
272
+ end
273
+ end
274
+ end