polar-accesslink-api-gem 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +182 -0
  4. data/Rakefile +10 -0
  5. data/docs/Activity.md +34 -0
  6. data/docs/ActivityLog.md +18 -0
  7. data/docs/ActivityStepSample.md +20 -0
  8. data/docs/ActivityStepSamples.md +20 -0
  9. data/docs/ActivityZoneSample.md +20 -0
  10. data/docs/ActivityZoneSamples.md +20 -0
  11. data/docs/AvailableSleep.md +22 -0
  12. data/docs/AvailableSleeps.md +18 -0
  13. data/docs/AvailableUserData.md +22 -0
  14. data/docs/AvailableUserDatas.md +18 -0
  15. data/docs/CreatedWebhook.md +18 -0
  16. data/docs/CreatedWebhookData.md +24 -0
  17. data/docs/DailyActivityApi.md +440 -0
  18. data/docs/DurationZone.md +20 -0
  19. data/docs/Error.md +26 -0
  20. data/docs/Exercise.md +54 -0
  21. data/docs/ExerciseHashId.md +52 -0
  22. data/docs/Exercises.md +18 -0
  23. data/docs/ExercisesApi.md +214 -0
  24. data/docs/HeartRate.md +20 -0
  25. data/docs/NightlyRecharge.md +38 -0
  26. data/docs/NightlyRechargeApi.md +144 -0
  27. data/docs/Nights.md +18 -0
  28. data/docs/PhysicalInfoApi.md +294 -0
  29. data/docs/PhysicalInformation.md +40 -0
  30. data/docs/PhysicalInformations.md +18 -0
  31. data/docs/PullNotificationsApi.md +75 -0
  32. data/docs/Recharges.md +18 -0
  33. data/docs/Register.md +18 -0
  34. data/docs/Sample.md +22 -0
  35. data/docs/Samples.md +18 -0
  36. data/docs/Sleep.md +64 -0
  37. data/docs/SleepApi.md +211 -0
  38. data/docs/TrainingDataApi.md +744 -0
  39. data/docs/TransactionLocation.md +20 -0
  40. data/docs/User.md +36 -0
  41. data/docs/UserExtraInfo.md +22 -0
  42. data/docs/UsersApi.md +216 -0
  43. data/docs/WebhookInfo.md +18 -0
  44. data/docs/WebhookInfoData.md +22 -0
  45. data/docs/WebhookPatch.md +20 -0
  46. data/docs/WebhookPayloadExercise.md +26 -0
  47. data/docs/WebhookPayloadSleep.md +26 -0
  48. data/docs/WebhookPing.md +20 -0
  49. data/docs/WebhookRequest.md +20 -0
  50. data/docs/WebhookType.md +15 -0
  51. data/docs/WebhooksApi.md +289 -0
  52. data/docs/Zone.md +24 -0
  53. data/docs/Zones.md +18 -0
  54. data/git_push.sh +58 -0
  55. data/lib/polar-accesslink-api-gem/api/daily_activity_api.rb +469 -0
  56. data/lib/polar-accesslink-api-gem/api/exercises_api.rb +205 -0
  57. data/lib/polar-accesslink-api-gem/api/nightly_recharge_api.rb +142 -0
  58. data/lib/polar-accesslink-api-gem/api/physical_info_api.rb +296 -0
  59. data/lib/polar-accesslink-api-gem/api/pull_notifications_api.rb +79 -0
  60. data/lib/polar-accesslink-api-gem/api/sleep_api.rb +199 -0
  61. data/lib/polar-accesslink-api-gem/api/training_data_api.rb +785 -0
  62. data/lib/polar-accesslink-api-gem/api/users_api.rb +221 -0
  63. data/lib/polar-accesslink-api-gem/api/webhooks_api.rb +278 -0
  64. data/lib/polar-accesslink-api-gem/api_client.rb +390 -0
  65. data/lib/polar-accesslink-api-gem/api_error.rb +57 -0
  66. data/lib/polar-accesslink-api-gem/configuration.rb +284 -0
  67. data/lib/polar-accesslink-api-gem/models/activity.rb +300 -0
  68. data/lib/polar-accesslink-api-gem/models/activity_log.rb +222 -0
  69. data/lib/polar-accesslink-api-gem/models/activity_step_sample.rb +230 -0
  70. data/lib/polar-accesslink-api-gem/models/activity_step_samples.rb +232 -0
  71. data/lib/polar-accesslink-api-gem/models/activity_zone_sample.rb +232 -0
  72. data/lib/polar-accesslink-api-gem/models/activity_zone_samples.rb +232 -0
  73. data/lib/polar-accesslink-api-gem/models/available_sleep.rb +239 -0
  74. data/lib/polar-accesslink-api-gem/models/available_sleeps.rb +221 -0
  75. data/lib/polar-accesslink-api-gem/models/available_user_data.rb +274 -0
  76. data/lib/polar-accesslink-api-gem/models/available_user_datas.rb +222 -0
  77. data/lib/polar-accesslink-api-gem/models/created_webhook.rb +218 -0
  78. data/lib/polar-accesslink-api-gem/models/created_webhook_data.rb +248 -0
  79. data/lib/polar-accesslink-api-gem/models/duration_zone.rb +230 -0
  80. data/lib/polar-accesslink-api-gem/models/error.rb +260 -0
  81. data/lib/polar-accesslink-api-gem/models/exercise.rb +399 -0
  82. data/lib/polar-accesslink-api-gem/models/exercise_hash_id.rb +389 -0
  83. data/lib/polar-accesslink-api-gem/models/exercises.rb +222 -0
  84. data/lib/polar-accesslink-api-gem/models/heart_rate.rb +230 -0
  85. data/lib/polar-accesslink-api-gem/models/nightly_recharge.rb +319 -0
  86. data/lib/polar-accesslink-api-gem/models/nights.rb +222 -0
  87. data/lib/polar-accesslink-api-gem/models/physical_information.rb +364 -0
  88. data/lib/polar-accesslink-api-gem/models/physical_informations.rb +222 -0
  89. data/lib/polar-accesslink-api-gem/models/recharges.rb +222 -0
  90. data/lib/polar-accesslink-api-gem/models/register.rb +225 -0
  91. data/lib/polar-accesslink-api-gem/models/sample.rb +240 -0
  92. data/lib/polar-accesslink-api-gem/models/samples.rb +222 -0
  93. data/lib/polar-accesslink-api-gem/models/sleep.rb +449 -0
  94. data/lib/polar-accesslink-api-gem/models/transaction_location.rb +230 -0
  95. data/lib/polar-accesslink-api-gem/models/user.rb +346 -0
  96. data/lib/polar-accesslink-api-gem/models/user_extra_info.rb +240 -0
  97. data/lib/polar-accesslink-api-gem/models/webhook_info.rb +218 -0
  98. data/lib/polar-accesslink-api-gem/models/webhook_info_data.rb +238 -0
  99. data/lib/polar-accesslink-api-gem/models/webhook_patch.rb +231 -0
  100. data/lib/polar-accesslink-api-gem/models/webhook_payload_exercise.rb +260 -0
  101. data/lib/polar-accesslink-api-gem/models/webhook_payload_sleep.rb +260 -0
  102. data/lib/polar-accesslink-api-gem/models/webhook_ping.rb +264 -0
  103. data/lib/polar-accesslink-api-gem/models/webhook_request.rb +241 -0
  104. data/lib/polar-accesslink-api-gem/models/webhook_type.rb +36 -0
  105. data/lib/polar-accesslink-api-gem/models/zone.rb +250 -0
  106. data/lib/polar-accesslink-api-gem/models/zones.rb +222 -0
  107. data/lib/polar-accesslink-api-gem/version.rb +15 -0
  108. data/lib/polar-accesslink-api-gem.rb +88 -0
  109. data/polar-accesslink-api-gem.gemspec +38 -0
  110. data/spec/api/daily_activity_api_spec.rb +114 -0
  111. data/spec/api/exercises_api_spec.rb +70 -0
  112. data/spec/api/nightly_recharge_api_spec.rb +58 -0
  113. data/spec/api/physical_info_api_spec.rb +87 -0
  114. data/spec/api/pull_notifications_api_spec.rb +46 -0
  115. data/spec/api/sleep_api_spec.rb +69 -0
  116. data/spec/api/training_data_api_spec.rb +173 -0
  117. data/spec/api/users_api_spec.rb +71 -0
  118. data/spec/api/webhooks_api_spec.rb +83 -0
  119. data/spec/api_client_spec.rb +226 -0
  120. data/spec/configuration_spec.rb +42 -0
  121. data/spec/models/activity_log_spec.rb +34 -0
  122. data/spec/models/activity_spec.rb +82 -0
  123. data/spec/models/activity_step_sample_spec.rb +40 -0
  124. data/spec/models/activity_step_samples_spec.rb +40 -0
  125. data/spec/models/activity_zone_sample_spec.rb +40 -0
  126. data/spec/models/activity_zone_samples_spec.rb +40 -0
  127. data/spec/models/available_sleep_spec.rb +46 -0
  128. data/spec/models/available_sleeps_spec.rb +34 -0
  129. data/spec/models/available_user_data_spec.rb +50 -0
  130. data/spec/models/available_user_datas_spec.rb +34 -0
  131. data/spec/models/created_webhook_data_spec.rb +52 -0
  132. data/spec/models/created_webhook_spec.rb +34 -0
  133. data/spec/models/duration_zone_spec.rb +40 -0
  134. data/spec/models/error_spec.rb +58 -0
  135. data/spec/models/exercise_hash_id_spec.rb +136 -0
  136. data/spec/models/exercise_spec.rb +142 -0
  137. data/spec/models/exercises_spec.rb +34 -0
  138. data/spec/models/heart_rate_spec.rb +40 -0
  139. data/spec/models/nightly_recharge_spec.rb +94 -0
  140. data/spec/models/nights_spec.rb +34 -0
  141. data/spec/models/physical_information_spec.rb +104 -0
  142. data/spec/models/physical_informations_spec.rb +34 -0
  143. data/spec/models/recharges_spec.rb +34 -0
  144. data/spec/models/register_spec.rb +34 -0
  145. data/spec/models/sample_spec.rb +46 -0
  146. data/spec/models/samples_spec.rb +34 -0
  147. data/spec/models/sleep_spec.rb +172 -0
  148. data/spec/models/transaction_location_spec.rb +40 -0
  149. data/spec/models/user_extra_info_spec.rb +46 -0
  150. data/spec/models/user_spec.rb +92 -0
  151. data/spec/models/webhook_info_data_spec.rb +46 -0
  152. data/spec/models/webhook_info_spec.rb +34 -0
  153. data/spec/models/webhook_patch_spec.rb +40 -0
  154. data/spec/models/webhook_payload_exercise_spec.rb +58 -0
  155. data/spec/models/webhook_payload_sleep_spec.rb +58 -0
  156. data/spec/models/webhook_ping_spec.rb +44 -0
  157. data/spec/models/webhook_request_spec.rb +40 -0
  158. data/spec/models/webhook_type_spec.rb +28 -0
  159. data/spec/models/zone_spec.rb +52 -0
  160. data/spec/models/zones_spec.rb +34 -0
  161. data/spec/spec_helper.rb +111 -0
  162. 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: \&quot;2020-01-01\&quot;
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: \&quot;2020-01-01\&quot;
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