polar-accesslink-api-gem 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +182 -0
- data/Rakefile +10 -0
- data/docs/Activity.md +34 -0
- data/docs/ActivityLog.md +18 -0
- data/docs/ActivityStepSample.md +20 -0
- data/docs/ActivityStepSamples.md +20 -0
- data/docs/ActivityZoneSample.md +20 -0
- data/docs/ActivityZoneSamples.md +20 -0
- data/docs/AvailableSleep.md +22 -0
- data/docs/AvailableSleeps.md +18 -0
- data/docs/AvailableUserData.md +22 -0
- data/docs/AvailableUserDatas.md +18 -0
- data/docs/CreatedWebhook.md +18 -0
- data/docs/CreatedWebhookData.md +24 -0
- data/docs/DailyActivityApi.md +440 -0
- data/docs/DurationZone.md +20 -0
- data/docs/Error.md +26 -0
- data/docs/Exercise.md +54 -0
- data/docs/ExerciseHashId.md +52 -0
- data/docs/Exercises.md +18 -0
- data/docs/ExercisesApi.md +214 -0
- data/docs/HeartRate.md +20 -0
- data/docs/NightlyRecharge.md +38 -0
- data/docs/NightlyRechargeApi.md +144 -0
- data/docs/Nights.md +18 -0
- data/docs/PhysicalInfoApi.md +294 -0
- data/docs/PhysicalInformation.md +40 -0
- data/docs/PhysicalInformations.md +18 -0
- data/docs/PullNotificationsApi.md +75 -0
- data/docs/Recharges.md +18 -0
- data/docs/Register.md +18 -0
- data/docs/Sample.md +22 -0
- data/docs/Samples.md +18 -0
- data/docs/Sleep.md +64 -0
- data/docs/SleepApi.md +211 -0
- data/docs/TrainingDataApi.md +744 -0
- data/docs/TransactionLocation.md +20 -0
- data/docs/User.md +36 -0
- data/docs/UserExtraInfo.md +22 -0
- data/docs/UsersApi.md +216 -0
- data/docs/WebhookInfo.md +18 -0
- data/docs/WebhookInfoData.md +22 -0
- data/docs/WebhookPatch.md +20 -0
- data/docs/WebhookPayloadExercise.md +26 -0
- data/docs/WebhookPayloadSleep.md +26 -0
- data/docs/WebhookPing.md +20 -0
- data/docs/WebhookRequest.md +20 -0
- data/docs/WebhookType.md +15 -0
- data/docs/WebhooksApi.md +289 -0
- data/docs/Zone.md +24 -0
- data/docs/Zones.md +18 -0
- data/git_push.sh +58 -0
- data/lib/polar-accesslink-api-gem/api/daily_activity_api.rb +469 -0
- data/lib/polar-accesslink-api-gem/api/exercises_api.rb +205 -0
- data/lib/polar-accesslink-api-gem/api/nightly_recharge_api.rb +142 -0
- data/lib/polar-accesslink-api-gem/api/physical_info_api.rb +296 -0
- data/lib/polar-accesslink-api-gem/api/pull_notifications_api.rb +79 -0
- data/lib/polar-accesslink-api-gem/api/sleep_api.rb +199 -0
- data/lib/polar-accesslink-api-gem/api/training_data_api.rb +785 -0
- data/lib/polar-accesslink-api-gem/api/users_api.rb +221 -0
- data/lib/polar-accesslink-api-gem/api/webhooks_api.rb +278 -0
- data/lib/polar-accesslink-api-gem/api_client.rb +390 -0
- data/lib/polar-accesslink-api-gem/api_error.rb +57 -0
- data/lib/polar-accesslink-api-gem/configuration.rb +284 -0
- data/lib/polar-accesslink-api-gem/models/activity.rb +300 -0
- data/lib/polar-accesslink-api-gem/models/activity_log.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/activity_step_sample.rb +230 -0
- data/lib/polar-accesslink-api-gem/models/activity_step_samples.rb +232 -0
- data/lib/polar-accesslink-api-gem/models/activity_zone_sample.rb +232 -0
- data/lib/polar-accesslink-api-gem/models/activity_zone_samples.rb +232 -0
- data/lib/polar-accesslink-api-gem/models/available_sleep.rb +239 -0
- data/lib/polar-accesslink-api-gem/models/available_sleeps.rb +221 -0
- data/lib/polar-accesslink-api-gem/models/available_user_data.rb +274 -0
- data/lib/polar-accesslink-api-gem/models/available_user_datas.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/created_webhook.rb +218 -0
- data/lib/polar-accesslink-api-gem/models/created_webhook_data.rb +248 -0
- data/lib/polar-accesslink-api-gem/models/duration_zone.rb +230 -0
- data/lib/polar-accesslink-api-gem/models/error.rb +260 -0
- data/lib/polar-accesslink-api-gem/models/exercise.rb +399 -0
- data/lib/polar-accesslink-api-gem/models/exercise_hash_id.rb +389 -0
- data/lib/polar-accesslink-api-gem/models/exercises.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/heart_rate.rb +230 -0
- data/lib/polar-accesslink-api-gem/models/nightly_recharge.rb +319 -0
- data/lib/polar-accesslink-api-gem/models/nights.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/physical_information.rb +364 -0
- data/lib/polar-accesslink-api-gem/models/physical_informations.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/recharges.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/register.rb +225 -0
- data/lib/polar-accesslink-api-gem/models/sample.rb +240 -0
- data/lib/polar-accesslink-api-gem/models/samples.rb +222 -0
- data/lib/polar-accesslink-api-gem/models/sleep.rb +449 -0
- data/lib/polar-accesslink-api-gem/models/transaction_location.rb +230 -0
- data/lib/polar-accesslink-api-gem/models/user.rb +346 -0
- data/lib/polar-accesslink-api-gem/models/user_extra_info.rb +240 -0
- data/lib/polar-accesslink-api-gem/models/webhook_info.rb +218 -0
- data/lib/polar-accesslink-api-gem/models/webhook_info_data.rb +238 -0
- data/lib/polar-accesslink-api-gem/models/webhook_patch.rb +231 -0
- data/lib/polar-accesslink-api-gem/models/webhook_payload_exercise.rb +260 -0
- data/lib/polar-accesslink-api-gem/models/webhook_payload_sleep.rb +260 -0
- data/lib/polar-accesslink-api-gem/models/webhook_ping.rb +264 -0
- data/lib/polar-accesslink-api-gem/models/webhook_request.rb +241 -0
- data/lib/polar-accesslink-api-gem/models/webhook_type.rb +36 -0
- data/lib/polar-accesslink-api-gem/models/zone.rb +250 -0
- data/lib/polar-accesslink-api-gem/models/zones.rb +222 -0
- data/lib/polar-accesslink-api-gem/version.rb +15 -0
- data/lib/polar-accesslink-api-gem.rb +88 -0
- data/polar-accesslink-api-gem.gemspec +38 -0
- data/spec/api/daily_activity_api_spec.rb +114 -0
- data/spec/api/exercises_api_spec.rb +70 -0
- data/spec/api/nightly_recharge_api_spec.rb +58 -0
- data/spec/api/physical_info_api_spec.rb +87 -0
- data/spec/api/pull_notifications_api_spec.rb +46 -0
- data/spec/api/sleep_api_spec.rb +69 -0
- data/spec/api/training_data_api_spec.rb +173 -0
- data/spec/api/users_api_spec.rb +71 -0
- data/spec/api/webhooks_api_spec.rb +83 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/activity_log_spec.rb +34 -0
- data/spec/models/activity_spec.rb +82 -0
- data/spec/models/activity_step_sample_spec.rb +40 -0
- data/spec/models/activity_step_samples_spec.rb +40 -0
- data/spec/models/activity_zone_sample_spec.rb +40 -0
- data/spec/models/activity_zone_samples_spec.rb +40 -0
- data/spec/models/available_sleep_spec.rb +46 -0
- data/spec/models/available_sleeps_spec.rb +34 -0
- data/spec/models/available_user_data_spec.rb +50 -0
- data/spec/models/available_user_datas_spec.rb +34 -0
- data/spec/models/created_webhook_data_spec.rb +52 -0
- data/spec/models/created_webhook_spec.rb +34 -0
- data/spec/models/duration_zone_spec.rb +40 -0
- data/spec/models/error_spec.rb +58 -0
- data/spec/models/exercise_hash_id_spec.rb +136 -0
- data/spec/models/exercise_spec.rb +142 -0
- data/spec/models/exercises_spec.rb +34 -0
- data/spec/models/heart_rate_spec.rb +40 -0
- data/spec/models/nightly_recharge_spec.rb +94 -0
- data/spec/models/nights_spec.rb +34 -0
- data/spec/models/physical_information_spec.rb +104 -0
- data/spec/models/physical_informations_spec.rb +34 -0
- data/spec/models/recharges_spec.rb +34 -0
- data/spec/models/register_spec.rb +34 -0
- data/spec/models/sample_spec.rb +46 -0
- data/spec/models/samples_spec.rb +34 -0
- data/spec/models/sleep_spec.rb +172 -0
- data/spec/models/transaction_location_spec.rb +40 -0
- data/spec/models/user_extra_info_spec.rb +46 -0
- data/spec/models/user_spec.rb +92 -0
- data/spec/models/webhook_info_data_spec.rb +46 -0
- data/spec/models/webhook_info_spec.rb +34 -0
- data/spec/models/webhook_patch_spec.rb +40 -0
- data/spec/models/webhook_payload_exercise_spec.rb +58 -0
- data/spec/models/webhook_payload_sleep_spec.rb +58 -0
- data/spec/models/webhook_ping_spec.rb +44 -0
- data/spec/models/webhook_request_spec.rb +40 -0
- data/spec/models/webhook_type_spec.rb +28 -0
- data/spec/models/zone_spec.rb +52 -0
- data/spec/models/zones_spec.rb +34 -0
- data/spec/spec_helper.rb +111 -0
- metadata +295 -0
@@ -0,0 +1,205 @@
|
|
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 ExercisesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get exercise FIT
|
23
|
+
# FIT file for users exercise.
|
24
|
+
# @param exercise_id [String] Hashed exercise id.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [String]
|
27
|
+
def get_exercise_fit_without_transaction(exercise_id, opts = {})
|
28
|
+
data, _status_code, _headers = get_exercise_fit_without_transaction_with_http_info(exercise_id, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get exercise FIT
|
33
|
+
# FIT file for users exercise.
|
34
|
+
# @param exercise_id [String] Hashed exercise id.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
37
|
+
def get_exercise_fit_without_transaction_with_http_info(exercise_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ExercisesApi.get_exercise_fit_without_transaction ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'exercise_id' is set
|
42
|
+
if @api_client.config.client_side_validation && exercise_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'exercise_id' when calling ExercisesApi.get_exercise_fit_without_transaction"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v3/exercises/{exerciseId}/fit'.sub('{' + 'exerciseId' + '}', CGI.escape(exercise_id.to_s))
|
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(['*/*'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:debug_body]
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:debug_return_type] || 'String'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:operation => :"ExercisesApi.get_exercise_fit_without_transaction",
|
70
|
+
:header_params => header_params,
|
71
|
+
:query_params => query_params,
|
72
|
+
:form_params => form_params,
|
73
|
+
:body => post_body,
|
74
|
+
:auth_names => auth_names,
|
75
|
+
:return_type => return_type
|
76
|
+
)
|
77
|
+
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
79
|
+
if @api_client.config.debugging
|
80
|
+
@api_client.config.logger.debug "API called: ExercisesApi#get_exercise_fit_without_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
81
|
+
end
|
82
|
+
return data, status_code, headers
|
83
|
+
end
|
84
|
+
|
85
|
+
# Get exercise
|
86
|
+
# Get users exercise using hashed id.
|
87
|
+
# @param exercise_id [String] Hashed exercise id.
|
88
|
+
# @param [Hash] opts the optional parameters
|
89
|
+
# @return [ExerciseHashId]
|
90
|
+
def get_exercise_without_transaction(exercise_id, opts = {})
|
91
|
+
data, _status_code, _headers = get_exercise_without_transaction_with_http_info(exercise_id, opts)
|
92
|
+
data
|
93
|
+
end
|
94
|
+
|
95
|
+
# Get exercise
|
96
|
+
# Get users exercise using hashed id.
|
97
|
+
# @param exercise_id [String] Hashed exercise id.
|
98
|
+
# @param [Hash] opts the optional parameters
|
99
|
+
# @return [Array<(ExerciseHashId, Integer, Hash)>] ExerciseHashId data, response status code and response headers
|
100
|
+
def get_exercise_without_transaction_with_http_info(exercise_id, opts = {})
|
101
|
+
if @api_client.config.debugging
|
102
|
+
@api_client.config.logger.debug 'Calling API: ExercisesApi.get_exercise_without_transaction ...'
|
103
|
+
end
|
104
|
+
# verify the required parameter 'exercise_id' is set
|
105
|
+
if @api_client.config.client_side_validation && exercise_id.nil?
|
106
|
+
fail ArgumentError, "Missing the required parameter 'exercise_id' when calling ExercisesApi.get_exercise_without_transaction"
|
107
|
+
end
|
108
|
+
# resource path
|
109
|
+
local_var_path = '/v3/exercises/{exerciseId}'.sub('{' + 'exerciseId' + '}', CGI.escape(exercise_id.to_s))
|
110
|
+
|
111
|
+
# query parameters
|
112
|
+
query_params = opts[:query_params] || {}
|
113
|
+
|
114
|
+
# header parameters
|
115
|
+
header_params = opts[:header_params] || {}
|
116
|
+
# HTTP header 'Accept' (if needed)
|
117
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
118
|
+
|
119
|
+
# form parameters
|
120
|
+
form_params = opts[:form_params] || {}
|
121
|
+
|
122
|
+
# http body (model)
|
123
|
+
post_body = opts[:debug_body]
|
124
|
+
|
125
|
+
# return_type
|
126
|
+
return_type = opts[:debug_return_type] || 'ExerciseHashId'
|
127
|
+
|
128
|
+
# auth_names
|
129
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
130
|
+
|
131
|
+
new_options = opts.merge(
|
132
|
+
:operation => :"ExercisesApi.get_exercise_without_transaction",
|
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(:GET, local_var_path, new_options)
|
142
|
+
if @api_client.config.debugging
|
143
|
+
@api_client.config.logger.debug "API called: ExercisesApi#get_exercise_without_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
144
|
+
end
|
145
|
+
return data, status_code, headers
|
146
|
+
end
|
147
|
+
|
148
|
+
# List exercises
|
149
|
+
# List users exercises available in Accesslink.
|
150
|
+
# @param [Hash] opts the optional parameters
|
151
|
+
# @return [Array<ExerciseHashId>]
|
152
|
+
def list_exercises_without_transaction(opts = {})
|
153
|
+
data, _status_code, _headers = list_exercises_without_transaction_with_http_info(opts)
|
154
|
+
data
|
155
|
+
end
|
156
|
+
|
157
|
+
# List exercises
|
158
|
+
# List users exercises available in Accesslink.
|
159
|
+
# @param [Hash] opts the optional parameters
|
160
|
+
# @return [Array<(Array<ExerciseHashId>, Integer, Hash)>] Array<ExerciseHashId> data, response status code and response headers
|
161
|
+
def list_exercises_without_transaction_with_http_info(opts = {})
|
162
|
+
if @api_client.config.debugging
|
163
|
+
@api_client.config.logger.debug 'Calling API: ExercisesApi.list_exercises_without_transaction ...'
|
164
|
+
end
|
165
|
+
# resource path
|
166
|
+
local_var_path = '/v3/exercises'
|
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[:debug_body]
|
181
|
+
|
182
|
+
# return_type
|
183
|
+
return_type = opts[:debug_return_type] || 'Array<ExerciseHashId>'
|
184
|
+
|
185
|
+
# auth_names
|
186
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
187
|
+
|
188
|
+
new_options = opts.merge(
|
189
|
+
:operation => :"ExercisesApi.list_exercises_without_transaction",
|
190
|
+
:header_params => header_params,
|
191
|
+
:query_params => query_params,
|
192
|
+
:form_params => form_params,
|
193
|
+
:body => post_body,
|
194
|
+
:auth_names => auth_names,
|
195
|
+
:return_type => return_type
|
196
|
+
)
|
197
|
+
|
198
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
199
|
+
if @api_client.config.debugging
|
200
|
+
@api_client.config.logger.debug "API called: ExercisesApi#list_exercises_without_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
201
|
+
end
|
202
|
+
return data, status_code, headers
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
@@ -0,0 +1,142 @@
|
|
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 NightlyRechargeApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List Nightly Recharges
|
23
|
+
# List Nightly Recharge data of user for the last 28 days.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [Recharges]
|
26
|
+
def list_nightly_recharge(opts = {})
|
27
|
+
data, _status_code, _headers = list_nightly_recharge_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# List Nightly Recharges
|
32
|
+
# List Nightly Recharge data of user for the last 28 days.
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(Recharges, Integer, Hash)>] Recharges data, response status code and response headers
|
35
|
+
def list_nightly_recharge_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: NightlyRechargeApi.list_nightly_recharge ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/v3/users/nightly-recharge'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
+
|
50
|
+
# form parameters
|
51
|
+
form_params = opts[:form_params] || {}
|
52
|
+
|
53
|
+
# http body (model)
|
54
|
+
post_body = opts[:debug_body]
|
55
|
+
|
56
|
+
# return_type
|
57
|
+
return_type = opts[:debug_return_type] || 'Recharges'
|
58
|
+
|
59
|
+
# auth_names
|
60
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
61
|
+
|
62
|
+
new_options = opts.merge(
|
63
|
+
:operation => :"NightlyRechargeApi.list_nightly_recharge",
|
64
|
+
:header_params => header_params,
|
65
|
+
:query_params => query_params,
|
66
|
+
:form_params => form_params,
|
67
|
+
:body => post_body,
|
68
|
+
:auth_names => auth_names,
|
69
|
+
:return_type => return_type
|
70
|
+
)
|
71
|
+
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
|
+
if @api_client.config.debugging
|
74
|
+
@api_client.config.logger.debug "API called: NightlyRechargeApi#list_nightly_recharge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
+
end
|
76
|
+
return data, status_code, headers
|
77
|
+
end
|
78
|
+
|
79
|
+
# Get Nightly Recharge
|
80
|
+
# Get Users Nightly Recharge data for given date.
|
81
|
+
# @param date [String] Date of Nightly Recharge as ISO-8601 date string, example: \"2020-01-01\"
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [NightlyRecharge]
|
84
|
+
def v3_users_nightly_recharge_date_get(date, opts = {})
|
85
|
+
data, _status_code, _headers = v3_users_nightly_recharge_date_get_with_http_info(date, opts)
|
86
|
+
data
|
87
|
+
end
|
88
|
+
|
89
|
+
# Get Nightly Recharge
|
90
|
+
# Get Users Nightly Recharge data for given date.
|
91
|
+
# @param date [String] Date of Nightly Recharge as ISO-8601 date string, example: \"2020-01-01\"
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [Array<(NightlyRecharge, Integer, Hash)>] NightlyRecharge data, response status code and response headers
|
94
|
+
def v3_users_nightly_recharge_date_get_with_http_info(date, opts = {})
|
95
|
+
if @api_client.config.debugging
|
96
|
+
@api_client.config.logger.debug 'Calling API: NightlyRechargeApi.v3_users_nightly_recharge_date_get ...'
|
97
|
+
end
|
98
|
+
# verify the required parameter 'date' is set
|
99
|
+
if @api_client.config.client_side_validation && date.nil?
|
100
|
+
fail ArgumentError, "Missing the required parameter 'date' when calling NightlyRechargeApi.v3_users_nightly_recharge_date_get"
|
101
|
+
end
|
102
|
+
# resource path
|
103
|
+
local_var_path = '/v3/users/nightly-recharge/{date}'.sub('{' + 'date' + '}', CGI.escape(date.to_s))
|
104
|
+
|
105
|
+
# query parameters
|
106
|
+
query_params = opts[:query_params] || {}
|
107
|
+
|
108
|
+
# header parameters
|
109
|
+
header_params = opts[:header_params] || {}
|
110
|
+
# HTTP header 'Accept' (if needed)
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
112
|
+
|
113
|
+
# form parameters
|
114
|
+
form_params = opts[:form_params] || {}
|
115
|
+
|
116
|
+
# http body (model)
|
117
|
+
post_body = opts[:debug_body]
|
118
|
+
|
119
|
+
# return_type
|
120
|
+
return_type = opts[:debug_return_type] || 'NightlyRecharge'
|
121
|
+
|
122
|
+
# auth_names
|
123
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
124
|
+
|
125
|
+
new_options = opts.merge(
|
126
|
+
:operation => :"NightlyRechargeApi.v3_users_nightly_recharge_date_get",
|
127
|
+
:header_params => header_params,
|
128
|
+
:query_params => query_params,
|
129
|
+
:form_params => form_params,
|
130
|
+
:body => post_body,
|
131
|
+
:auth_names => auth_names,
|
132
|
+
:return_type => return_type
|
133
|
+
)
|
134
|
+
|
135
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
136
|
+
if @api_client.config.debugging
|
137
|
+
@api_client.config.logger.debug "API called: NightlyRechargeApi#v3_users_nightly_recharge_date_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
138
|
+
end
|
139
|
+
return data, status_code, headers
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
@@ -0,0 +1,296 @@
|
|
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 PhysicalInfoApi
|
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 physical information 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_physical_info_transaction(transaction_id, user_id, opts = {})
|
29
|
+
commit_physical_info_transaction_with_http_info(transaction_id, user_id, opts)
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
|
33
|
+
# Commit transaction
|
34
|
+
# After successfully retrieving physical information 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_physical_info_transaction_with_http_info(transaction_id, user_id, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: PhysicalInfoApi.commit_physical_info_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 PhysicalInfoApi.commit_physical_info_transaction"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'user_id' is set
|
48
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling PhysicalInfoApi.commit_physical_info_transaction"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/v3/users/{user-id}/physical-information-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
|
60
|
+
# form parameters
|
61
|
+
form_params = opts[:form_params] || {}
|
62
|
+
|
63
|
+
# http body (model)
|
64
|
+
post_body = opts[:debug_body]
|
65
|
+
|
66
|
+
# return_type
|
67
|
+
return_type = opts[:debug_return_type]
|
68
|
+
|
69
|
+
# auth_names
|
70
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
71
|
+
|
72
|
+
new_options = opts.merge(
|
73
|
+
:operation => :"PhysicalInfoApi.commit_physical_info_transaction",
|
74
|
+
:header_params => header_params,
|
75
|
+
:query_params => query_params,
|
76
|
+
:form_params => form_params,
|
77
|
+
:body => post_body,
|
78
|
+
:auth_names => auth_names,
|
79
|
+
:return_type => return_type
|
80
|
+
)
|
81
|
+
|
82
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
83
|
+
if @api_client.config.debugging
|
84
|
+
@api_client.config.logger.debug "API called: PhysicalInfoApi#commit_physical_info_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
85
|
+
end
|
86
|
+
return data, status_code, headers
|
87
|
+
end
|
88
|
+
|
89
|
+
# Create transaction
|
90
|
+
# Initiate physical info transaction. Check for new physical info and create a new transaction if found.
|
91
|
+
# @param user_id [Integer] User identifier
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [TransactionLocation]
|
94
|
+
def create_physical_info_transaction(user_id, opts = {})
|
95
|
+
data, _status_code, _headers = create_physical_info_transaction_with_http_info(user_id, opts)
|
96
|
+
data
|
97
|
+
end
|
98
|
+
|
99
|
+
# Create transaction
|
100
|
+
# Initiate physical info transaction. Check for new physical info and create a new transaction if found.
|
101
|
+
# @param user_id [Integer] User identifier
|
102
|
+
# @param [Hash] opts the optional parameters
|
103
|
+
# @return [Array<(TransactionLocation, Integer, Hash)>] TransactionLocation data, response status code and response headers
|
104
|
+
def create_physical_info_transaction_with_http_info(user_id, opts = {})
|
105
|
+
if @api_client.config.debugging
|
106
|
+
@api_client.config.logger.debug 'Calling API: PhysicalInfoApi.create_physical_info_transaction ...'
|
107
|
+
end
|
108
|
+
# verify the required parameter 'user_id' is set
|
109
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
110
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling PhysicalInfoApi.create_physical_info_transaction"
|
111
|
+
end
|
112
|
+
# resource path
|
113
|
+
local_var_path = '/v3/users/{user-id}/physical-information-transactions'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
|
114
|
+
|
115
|
+
# query parameters
|
116
|
+
query_params = opts[:query_params] || {}
|
117
|
+
|
118
|
+
# header parameters
|
119
|
+
header_params = opts[:header_params] || {}
|
120
|
+
# HTTP header 'Accept' (if needed)
|
121
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
122
|
+
|
123
|
+
# form parameters
|
124
|
+
form_params = opts[:form_params] || {}
|
125
|
+
|
126
|
+
# http body (model)
|
127
|
+
post_body = opts[:debug_body]
|
128
|
+
|
129
|
+
# return_type
|
130
|
+
return_type = opts[:debug_return_type] || 'TransactionLocation'
|
131
|
+
|
132
|
+
# auth_names
|
133
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
134
|
+
|
135
|
+
new_options = opts.merge(
|
136
|
+
:operation => :"PhysicalInfoApi.create_physical_info_transaction",
|
137
|
+
:header_params => header_params,
|
138
|
+
:query_params => query_params,
|
139
|
+
:form_params => form_params,
|
140
|
+
:body => post_body,
|
141
|
+
:auth_names => auth_names,
|
142
|
+
:return_type => return_type
|
143
|
+
)
|
144
|
+
|
145
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
146
|
+
if @api_client.config.debugging
|
147
|
+
@api_client.config.logger.debug "API called: PhysicalInfoApi#create_physical_info_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
148
|
+
end
|
149
|
+
return data, status_code, headers
|
150
|
+
end
|
151
|
+
|
152
|
+
# Get physical info
|
153
|
+
# Get physical info entity data
|
154
|
+
# @param user_id [Integer] User identifier
|
155
|
+
# @param transaction_id [Integer] Transaction identifier
|
156
|
+
# @param physical_info_id [Integer] Physical information identifier
|
157
|
+
# @param [Hash] opts the optional parameters
|
158
|
+
# @return [PhysicalInformation]
|
159
|
+
def get_physical_info(user_id, transaction_id, physical_info_id, opts = {})
|
160
|
+
data, _status_code, _headers = get_physical_info_with_http_info(user_id, transaction_id, physical_info_id, opts)
|
161
|
+
data
|
162
|
+
end
|
163
|
+
|
164
|
+
# Get physical info
|
165
|
+
# Get physical info entity data
|
166
|
+
# @param user_id [Integer] User identifier
|
167
|
+
# @param transaction_id [Integer] Transaction identifier
|
168
|
+
# @param physical_info_id [Integer] Physical information identifier
|
169
|
+
# @param [Hash] opts the optional parameters
|
170
|
+
# @return [Array<(PhysicalInformation, Integer, Hash)>] PhysicalInformation data, response status code and response headers
|
171
|
+
def get_physical_info_with_http_info(user_id, transaction_id, physical_info_id, opts = {})
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug 'Calling API: PhysicalInfoApi.get_physical_info ...'
|
174
|
+
end
|
175
|
+
# verify the required parameter 'user_id' is set
|
176
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
177
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling PhysicalInfoApi.get_physical_info"
|
178
|
+
end
|
179
|
+
# verify the required parameter 'transaction_id' is set
|
180
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
181
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PhysicalInfoApi.get_physical_info"
|
182
|
+
end
|
183
|
+
# verify the required parameter 'physical_info_id' is set
|
184
|
+
if @api_client.config.client_side_validation && physical_info_id.nil?
|
185
|
+
fail ArgumentError, "Missing the required parameter 'physical_info_id' when calling PhysicalInfoApi.get_physical_info"
|
186
|
+
end
|
187
|
+
# resource path
|
188
|
+
local_var_path = '/v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id}'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'physical-info-id' + '}', CGI.escape(physical_info_id.to_s))
|
189
|
+
|
190
|
+
# query parameters
|
191
|
+
query_params = opts[:query_params] || {}
|
192
|
+
|
193
|
+
# header parameters
|
194
|
+
header_params = opts[:header_params] || {}
|
195
|
+
# HTTP header 'Accept' (if needed)
|
196
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
197
|
+
|
198
|
+
# form parameters
|
199
|
+
form_params = opts[:form_params] || {}
|
200
|
+
|
201
|
+
# http body (model)
|
202
|
+
post_body = opts[:debug_body]
|
203
|
+
|
204
|
+
# return_type
|
205
|
+
return_type = opts[:debug_return_type] || 'PhysicalInformation'
|
206
|
+
|
207
|
+
# auth_names
|
208
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
209
|
+
|
210
|
+
new_options = opts.merge(
|
211
|
+
:operation => :"PhysicalInfoApi.get_physical_info",
|
212
|
+
:header_params => header_params,
|
213
|
+
:query_params => query_params,
|
214
|
+
:form_params => form_params,
|
215
|
+
:body => post_body,
|
216
|
+
:auth_names => auth_names,
|
217
|
+
:return_type => return_type
|
218
|
+
)
|
219
|
+
|
220
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
221
|
+
if @api_client.config.debugging
|
222
|
+
@api_client.config.logger.debug "API called: PhysicalInfoApi#get_physical_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
223
|
+
end
|
224
|
+
return data, status_code, headers
|
225
|
+
end
|
226
|
+
|
227
|
+
# List physical infos
|
228
|
+
# List new physical info data. After successfully initiating a transaction, physical infos included within it can be retrieved with the provided transactionId.
|
229
|
+
# @param transaction_id [Integer] Transaction identifier
|
230
|
+
# @param user_id [Integer] User identifier
|
231
|
+
# @param [Hash] opts the optional parameters
|
232
|
+
# @return [PhysicalInformations]
|
233
|
+
def list_physical_infos(transaction_id, user_id, opts = {})
|
234
|
+
data, _status_code, _headers = list_physical_infos_with_http_info(transaction_id, user_id, opts)
|
235
|
+
data
|
236
|
+
end
|
237
|
+
|
238
|
+
# List physical infos
|
239
|
+
# List new physical info data. After successfully initiating a transaction, physical infos included within it can be retrieved with the provided transactionId.
|
240
|
+
# @param transaction_id [Integer] Transaction identifier
|
241
|
+
# @param user_id [Integer] User identifier
|
242
|
+
# @param [Hash] opts the optional parameters
|
243
|
+
# @return [Array<(PhysicalInformations, Integer, Hash)>] PhysicalInformations data, response status code and response headers
|
244
|
+
def list_physical_infos_with_http_info(transaction_id, user_id, opts = {})
|
245
|
+
if @api_client.config.debugging
|
246
|
+
@api_client.config.logger.debug 'Calling API: PhysicalInfoApi.list_physical_infos ...'
|
247
|
+
end
|
248
|
+
# verify the required parameter 'transaction_id' is set
|
249
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
250
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PhysicalInfoApi.list_physical_infos"
|
251
|
+
end
|
252
|
+
# verify the required parameter 'user_id' is set
|
253
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
254
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling PhysicalInfoApi.list_physical_infos"
|
255
|
+
end
|
256
|
+
# resource path
|
257
|
+
local_var_path = '/v3/users/{user-id}/physical-information-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
|
258
|
+
|
259
|
+
# query parameters
|
260
|
+
query_params = opts[:query_params] || {}
|
261
|
+
|
262
|
+
# header parameters
|
263
|
+
header_params = opts[:header_params] || {}
|
264
|
+
# HTTP header 'Accept' (if needed)
|
265
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
266
|
+
|
267
|
+
# form parameters
|
268
|
+
form_params = opts[:form_params] || {}
|
269
|
+
|
270
|
+
# http body (model)
|
271
|
+
post_body = opts[:debug_body]
|
272
|
+
|
273
|
+
# return_type
|
274
|
+
return_type = opts[:debug_return_type] || 'PhysicalInformations'
|
275
|
+
|
276
|
+
# auth_names
|
277
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
278
|
+
|
279
|
+
new_options = opts.merge(
|
280
|
+
:operation => :"PhysicalInfoApi.list_physical_infos",
|
281
|
+
:header_params => header_params,
|
282
|
+
:query_params => query_params,
|
283
|
+
:form_params => form_params,
|
284
|
+
:body => post_body,
|
285
|
+
:auth_names => auth_names,
|
286
|
+
:return_type => return_type
|
287
|
+
)
|
288
|
+
|
289
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
290
|
+
if @api_client.config.debugging
|
291
|
+
@api_client.config.logger.debug "API called: PhysicalInfoApi#list_physical_infos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
292
|
+
end
|
293
|
+
return data, status_code, headers
|
294
|
+
end
|
295
|
+
end
|
296
|
+
end
|