polar_accesslink 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -5
  3. data/README.md +20 -65
  4. data/Rakefile +0 -2
  5. data/docs/DailyActivityApi.md +96 -123
  6. data/docs/ExercisesApi.md +35 -55
  7. data/docs/NightlyRechargeApi.md +96 -0
  8. data/docs/PhysicalInfoApi.md +60 -79
  9. data/docs/PullNotificationsApi.md +11 -20
  10. data/docs/SleepApi.md +137 -0
  11. data/docs/TrainingDataApi.md +175 -213
  12. data/docs/UsersApi.md +33 -56
  13. data/docs/WebhooksApi.md +43 -80
  14. data/git_push.sh +55 -0
  15. data/lib/polar_accesslink.rb +5 -36
  16. data/lib/polar_accesslink/api/daily_activity_api.rb +101 -201
  17. data/lib/polar_accesslink/api/exercises_api.rb +43 -81
  18. data/lib/polar_accesslink/api/nightly_recharge_api.rb +115 -0
  19. data/lib/polar_accesslink/api/physical_info_api.rb +65 -114
  20. data/lib/polar_accesslink/api/pull_notifications_api.rb +15 -27
  21. data/lib/polar_accesslink/api/sleep_api.rb +158 -0
  22. data/lib/polar_accesslink/api/training_data_api.rb +178 -332
  23. data/lib/polar_accesslink/api/users_api.rb +42 -96
  24. data/lib/polar_accesslink/api/webhooks_api.rb +59 -126
  25. data/lib/polar_accesslink/api_client.rb +45 -41
  26. data/lib/polar_accesslink/api_error.rb +3 -22
  27. data/lib/polar_accesslink/configuration.rb +9 -62
  28. data/lib/polar_accesslink/version.rb +3 -3
  29. data/polar_accesslink.gemspec +2 -1
  30. data/spec/api/daily_activity_api_spec.rb +11 -11
  31. data/spec/api/exercises_api_spec.rb +9 -9
  32. data/spec/api/nightly_recharge_api_spec.rb +58 -0
  33. data/spec/api/physical_info_api_spec.rb +9 -9
  34. data/spec/api/pull_notifications_api_spec.rb +7 -7
  35. data/spec/api/sleep_api_spec.rb +69 -0
  36. data/spec/api/training_data_api_spec.rb +16 -15
  37. data/spec/api/users_api_spec.rb +8 -9
  38. data/spec/api/webhooks_api_spec.rb +11 -13
  39. data/spec/api_client_spec.rb +21 -4
  40. data/spec/configuration_spec.rb +6 -6
  41. data/spec/spec_helper.rb +3 -3
  42. metadata +36 -145
  43. data/docs/Activity.md +0 -33
  44. data/docs/ActivityLog.md +0 -17
  45. data/docs/ActivityStepSample.md +0 -19
  46. data/docs/ActivityStepSamples.md +0 -19
  47. data/docs/ActivityZoneSample.md +0 -19
  48. data/docs/ActivityZoneSamples.md +0 -19
  49. data/docs/AvailableUserData.md +0 -21
  50. data/docs/AvailableUserDatas.md +0 -17
  51. data/docs/CreatedWebhook.md +0 -17
  52. data/docs/CreatedWebhookData.md +0 -23
  53. data/docs/DurationZone.md +0 -19
  54. data/docs/Error.md +0 -25
  55. data/docs/Exercise.md +0 -47
  56. data/docs/ExerciseHashId.md +0 -45
  57. data/docs/Exercises.md +0 -17
  58. data/docs/HeartRate.md +0 -19
  59. data/docs/PhysicalInformation.md +0 -39
  60. data/docs/PhysicalInformations.md +0 -17
  61. data/docs/Register.md +0 -17
  62. data/docs/Sample.md +0 -21
  63. data/docs/Samples.md +0 -17
  64. data/docs/TransactionLocation.md +0 -19
  65. data/docs/User.md +0 -35
  66. data/docs/UserExtraInfo.md +0 -21
  67. data/docs/WebhookInfo.md +0 -17
  68. data/docs/WebhookInfoData.md +0 -21
  69. data/docs/WebhookPatch.md +0 -19
  70. data/docs/WebhookPayload.md +0 -25
  71. data/docs/WebhookPing.md +0 -19
  72. data/docs/WebhookRequest.md +0 -19
  73. data/docs/WebhookType.md +0 -16
  74. data/docs/Zone.md +0 -23
  75. data/docs/Zones.md +0 -17
  76. data/lib/polar_accesslink/models/activity.rb +0 -288
  77. data/lib/polar_accesslink/models/activity_log.rb +0 -210
  78. data/lib/polar_accesslink/models/activity_step_sample.rb +0 -218
  79. data/lib/polar_accesslink/models/activity_step_samples.rb +0 -220
  80. data/lib/polar_accesslink/models/activity_zone_sample.rb +0 -220
  81. data/lib/polar_accesslink/models/activity_zone_samples.rb +0 -220
  82. data/lib/polar_accesslink/models/available_user_data.rb +0 -262
  83. data/lib/polar_accesslink/models/available_user_datas.rb +0 -210
  84. data/lib/polar_accesslink/models/created_webhook.rb +0 -206
  85. data/lib/polar_accesslink/models/created_webhook_data.rb +0 -236
  86. data/lib/polar_accesslink/models/duration_zone.rb +0 -218
  87. data/lib/polar_accesslink/models/error.rb +0 -248
  88. data/lib/polar_accesslink/models/exercise.rb +0 -357
  89. data/lib/polar_accesslink/models/exercise_hash_id.rb +0 -347
  90. data/lib/polar_accesslink/models/exercises.rb +0 -210
  91. data/lib/polar_accesslink/models/heart_rate.rb +0 -218
  92. data/lib/polar_accesslink/models/physical_information.rb +0 -352
  93. data/lib/polar_accesslink/models/physical_informations.rb +0 -210
  94. data/lib/polar_accesslink/models/register.rb +0 -213
  95. data/lib/polar_accesslink/models/sample.rb +0 -228
  96. data/lib/polar_accesslink/models/samples.rb +0 -210
  97. data/lib/polar_accesslink/models/transaction_location.rb +0 -218
  98. data/lib/polar_accesslink/models/user.rb +0 -334
  99. data/lib/polar_accesslink/models/user_extra_info.rb +0 -228
  100. data/lib/polar_accesslink/models/webhook_info.rb +0 -206
  101. data/lib/polar_accesslink/models/webhook_info_data.rb +0 -226
  102. data/lib/polar_accesslink/models/webhook_patch.rb +0 -219
  103. data/lib/polar_accesslink/models/webhook_payload.rb +0 -246
  104. data/lib/polar_accesslink/models/webhook_ping.rb +0 -252
  105. data/lib/polar_accesslink/models/webhook_request.rb +0 -229
  106. data/lib/polar_accesslink/models/webhook_type.rb +0 -37
  107. data/lib/polar_accesslink/models/zone.rb +0 -238
  108. data/lib/polar_accesslink/models/zones.rb +0 -210
  109. data/spec/models/activity_log_spec.rb +0 -41
  110. data/spec/models/activity_spec.rb +0 -89
  111. data/spec/models/activity_step_sample_spec.rb +0 -47
  112. data/spec/models/activity_step_samples_spec.rb +0 -47
  113. data/spec/models/activity_zone_sample_spec.rb +0 -47
  114. data/spec/models/activity_zone_samples_spec.rb +0 -47
  115. data/spec/models/available_user_data_spec.rb +0 -57
  116. data/spec/models/available_user_datas_spec.rb +0 -41
  117. data/spec/models/created_webhook_data_spec.rb +0 -59
  118. data/spec/models/created_webhook_spec.rb +0 -41
  119. data/spec/models/duration_zone_spec.rb +0 -47
  120. data/spec/models/error_spec.rb +0 -65
  121. data/spec/models/exercise_hash_id_spec.rb +0 -125
  122. data/spec/models/exercise_spec.rb +0 -131
  123. data/spec/models/exercises_spec.rb +0 -41
  124. data/spec/models/heart_rate_spec.rb +0 -47
  125. data/spec/models/physical_information_spec.rb +0 -111
  126. data/spec/models/physical_informations_spec.rb +0 -41
  127. data/spec/models/register_spec.rb +0 -41
  128. data/spec/models/sample_spec.rb +0 -53
  129. data/spec/models/samples_spec.rb +0 -41
  130. data/spec/models/transaction_location_spec.rb +0 -47
  131. data/spec/models/user_extra_info_spec.rb +0 -53
  132. data/spec/models/user_spec.rb +0 -99
  133. data/spec/models/webhook_info_data_spec.rb +0 -53
  134. data/spec/models/webhook_info_spec.rb +0 -41
  135. data/spec/models/webhook_patch_spec.rb +0 -47
  136. data/spec/models/webhook_payload_spec.rb +0 -65
  137. data/spec/models/webhook_ping_spec.rb +0 -51
  138. data/spec/models/webhook_request_spec.rb +0 -47
  139. data/spec/models/webhook_type_spec.rb +0 -35
  140. data/spec/models/zone_spec.rb +0 -59
  141. data/spec/models/zones_spec.rb +0 -41
@@ -3,14 +3,14 @@
3
3
 
4
4
  #Polar Accesslink API documentation
5
5
 
6
- The version of the OpenAPI document: 3.40.0
6
+ OpenAPI spec version: 3.59.0
7
7
  Contact: b2bhelpdesk@polar.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.0
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.16
10
10
 
11
11
  =end
12
12
 
13
- require 'cgi'
13
+ require 'uri'
14
14
 
15
15
  module PolarAccesslink
16
16
  class ExercisesApi
@@ -21,19 +21,19 @@ module PolarAccesslink
21
21
  end
22
22
  # Get exercise FIT
23
23
  # FIT file for users exercise.
24
- # @param exercise_id [String] Hashed exercise id.
24
+ # @param exercise_id Hashed exercise id.
25
25
  # @param [Hash] opts the optional parameters
26
- # @return [String]
26
+ # @return [nil]
27
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
28
+ get_exercise_fit_without_transaction_with_http_info(exercise_id, opts)
29
+ nil
30
30
  end
31
31
 
32
32
  # Get exercise FIT
33
33
  # FIT file for users exercise.
34
- # @param exercise_id [String] Hashed exercise id.
34
+ # @param exercise_id Hashed exercise id.
35
35
  # @param [Hash] opts the optional parameters
36
- # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
36
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
37
37
  def get_exercise_fit_without_transaction_with_http_info(exercise_id, opts = {})
38
38
  if @api_client.config.debugging
39
39
  @api_client.config.logger.debug 'Calling API: ExercisesApi.get_exercise_fit_without_transaction ...'
@@ -43,59 +43,46 @@ module PolarAccesslink
43
43
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling ExercisesApi.get_exercise_fit_without_transaction"
44
44
  end
45
45
  # resource path
46
- local_var_path = '/v3/exercises/{exerciseId}/fit'.sub('{' + 'exerciseId' + '}', CGI.escape(exercise_id.to_s))
46
+ local_var_path = '/v3/exercises/{exerciseId}/fit'.sub('{' + 'exerciseId' + '}', exercise_id.to_s)
47
47
 
48
48
  # query parameters
49
- query_params = opts[:query_params] || {}
49
+ query_params = {}
50
50
 
51
51
  # header parameters
52
- header_params = opts[:header_params] || {}
53
- # HTTP header 'Accept' (if needed)
54
- header_params['Accept'] = @api_client.select_header_accept(['*/*'])
52
+ header_params = {}
55
53
 
56
54
  # form parameters
57
- form_params = opts[:form_params] || {}
55
+ form_params = {}
58
56
 
59
57
  # http body (model)
60
- post_body = opts[:body]
61
-
62
- # return_type
63
- return_type = opts[:return_type] || 'String'
64
-
65
- # auth_names
66
- auth_names = opts[:auth_names] || ['OAuth2']
67
-
68
- new_options = opts.merge(
58
+ post_body = nil
59
+ auth_names = []
60
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
69
61
  :header_params => header_params,
70
62
  :query_params => query_params,
71
63
  :form_params => form_params,
72
64
  :body => post_body,
73
- :auth_names => auth_names,
74
- :return_type => return_type
75
- )
76
-
77
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
65
+ :auth_names => auth_names)
78
66
  if @api_client.config.debugging
79
67
  @api_client.config.logger.debug "API called: ExercisesApi#get_exercise_fit_without_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
68
  end
81
69
  return data, status_code, headers
82
70
  end
83
-
84
71
  # Get exercise
85
72
  # Get users exercise using hashed id.
86
- # @param exercise_id [String] Hashed exercise id.
73
+ # @param exercise_id Hashed exercise id.
87
74
  # @param [Hash] opts the optional parameters
88
- # @return [ExerciseHashId]
75
+ # @return [nil]
89
76
  def get_exercise_without_transaction(exercise_id, opts = {})
90
- data, _status_code, _headers = get_exercise_without_transaction_with_http_info(exercise_id, opts)
91
- data
77
+ get_exercise_without_transaction_with_http_info(exercise_id, opts)
78
+ nil
92
79
  end
93
80
 
94
81
  # Get exercise
95
82
  # Get users exercise using hashed id.
96
- # @param exercise_id [String] Hashed exercise id.
83
+ # @param exercise_id Hashed exercise id.
97
84
  # @param [Hash] opts the optional parameters
98
- # @return [Array<(ExerciseHashId, Integer, Hash)>] ExerciseHashId data, response status code and response headers
85
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
99
86
  def get_exercise_without_transaction_with_http_info(exercise_id, opts = {})
100
87
  if @api_client.config.debugging
101
88
  @api_client.config.logger.debug 'Calling API: ExercisesApi.get_exercise_without_transaction ...'
@@ -105,57 +92,44 @@ module PolarAccesslink
105
92
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling ExercisesApi.get_exercise_without_transaction"
106
93
  end
107
94
  # resource path
108
- local_var_path = '/v3/exercises/{exerciseId}'.sub('{' + 'exerciseId' + '}', CGI.escape(exercise_id.to_s))
95
+ local_var_path = '/v3/exercises/{exerciseId}'.sub('{' + 'exerciseId' + '}', exercise_id.to_s)
109
96
 
110
97
  # query parameters
111
- query_params = opts[:query_params] || {}
98
+ query_params = {}
112
99
 
113
100
  # header parameters
114
- header_params = opts[:header_params] || {}
115
- # HTTP header 'Accept' (if needed)
116
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
101
+ header_params = {}
117
102
 
118
103
  # form parameters
119
- form_params = opts[:form_params] || {}
104
+ form_params = {}
120
105
 
121
106
  # http body (model)
122
- post_body = opts[:body]
123
-
124
- # return_type
125
- return_type = opts[:return_type] || 'ExerciseHashId'
126
-
127
- # auth_names
128
- auth_names = opts[:auth_names] || ['OAuth2']
129
-
130
- new_options = opts.merge(
107
+ post_body = nil
108
+ auth_names = []
109
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
131
110
  :header_params => header_params,
132
111
  :query_params => query_params,
133
112
  :form_params => form_params,
134
113
  :body => post_body,
135
- :auth_names => auth_names,
136
- :return_type => return_type
137
- )
138
-
139
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
114
+ :auth_names => auth_names)
140
115
  if @api_client.config.debugging
141
116
  @api_client.config.logger.debug "API called: ExercisesApi#get_exercise_without_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
117
  end
143
118
  return data, status_code, headers
144
119
  end
145
-
146
120
  # List exercises
147
121
  # List users exercises available in Accesslink.
148
122
  # @param [Hash] opts the optional parameters
149
- # @return [Array<ExerciseHashId>]
123
+ # @return [nil]
150
124
  def list_exercises_without_transaction(opts = {})
151
- data, _status_code, _headers = list_exercises_without_transaction_with_http_info(opts)
152
- data
125
+ list_exercises_without_transaction_with_http_info(opts)
126
+ nil
153
127
  end
154
128
 
155
129
  # List exercises
156
130
  # List users exercises available in Accesslink.
157
131
  # @param [Hash] opts the optional parameters
158
- # @return [Array<(Array<ExerciseHashId>, Integer, Hash)>] Array<ExerciseHashId> data, response status code and response headers
132
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
159
133
  def list_exercises_without_transaction_with_http_info(opts = {})
160
134
  if @api_client.config.debugging
161
135
  @api_client.config.logger.debug 'Calling API: ExercisesApi.list_exercises_without_transaction ...'
@@ -164,35 +138,23 @@ module PolarAccesslink
164
138
  local_var_path = '/v3/exercises'
165
139
 
166
140
  # query parameters
167
- query_params = opts[:query_params] || {}
141
+ query_params = {}
168
142
 
169
143
  # header parameters
170
- header_params = opts[:header_params] || {}
171
- # HTTP header 'Accept' (if needed)
172
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
144
+ header_params = {}
173
145
 
174
146
  # form parameters
175
- form_params = opts[:form_params] || {}
147
+ form_params = {}
176
148
 
177
149
  # http body (model)
178
- post_body = opts[:body]
179
-
180
- # return_type
181
- return_type = opts[:return_type] || 'Array<ExerciseHashId>'
182
-
183
- # auth_names
184
- auth_names = opts[:auth_names] || ['OAuth2']
185
-
186
- new_options = opts.merge(
150
+ post_body = nil
151
+ auth_names = []
152
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
187
153
  :header_params => header_params,
188
154
  :query_params => query_params,
189
155
  :form_params => form_params,
190
156
  :body => post_body,
191
- :auth_names => auth_names,
192
- :return_type => return_type
193
- )
194
-
195
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
157
+ :auth_names => auth_names)
196
158
  if @api_client.config.debugging
197
159
  @api_client.config.logger.debug "API called: ExercisesApi#list_exercises_without_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
198
160
  end
@@ -0,0 +1,115 @@
1
+ =begin
2
+ #Polar Accesslink API
3
+
4
+ #Polar Accesslink API documentation
5
+
6
+ OpenAPI spec version: 3.59.0
7
+ Contact: b2bhelpdesk@polar.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.16
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module PolarAccesslink
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 [nil]
26
+ def list_nightly_recharge(opts = {})
27
+ list_nightly_recharge_with_http_info(opts)
28
+ nil
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<(nil, Fixnum, Hash)>] nil, 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 = {}
44
+
45
+ # header parameters
46
+ header_params = {}
47
+
48
+ # form parameters
49
+ form_params = {}
50
+
51
+ # http body (model)
52
+ post_body = nil
53
+ auth_names = []
54
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
55
+ :header_params => header_params,
56
+ :query_params => query_params,
57
+ :form_params => form_params,
58
+ :body => post_body,
59
+ :auth_names => auth_names)
60
+ if @api_client.config.debugging
61
+ @api_client.config.logger.debug "API called: NightlyRechargeApi#list_nightly_recharge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
62
+ end
63
+ return data, status_code, headers
64
+ end
65
+ # Get Nightly Recharge
66
+ # Get Users Nightly Recharge data for given date.
67
+ # @param date Date of Nightly Recharge as ISO-8601 date string, example: \&quot;2020-01-01\&quot;
68
+ # @param [Hash] opts the optional parameters
69
+ # @return [nil]
70
+ def v3_users_nightly_recharge_date_get(date, opts = {})
71
+ v3_users_nightly_recharge_date_get_with_http_info(date, opts)
72
+ nil
73
+ end
74
+
75
+ # Get Nightly Recharge
76
+ # Get Users Nightly Recharge data for given date.
77
+ # @param date Date of Nightly Recharge as ISO-8601 date string, example: \&quot;2020-01-01\&quot;
78
+ # @param [Hash] opts the optional parameters
79
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
80
+ def v3_users_nightly_recharge_date_get_with_http_info(date, opts = {})
81
+ if @api_client.config.debugging
82
+ @api_client.config.logger.debug 'Calling API: NightlyRechargeApi.v3_users_nightly_recharge_date_get ...'
83
+ end
84
+ # verify the required parameter 'date' is set
85
+ if @api_client.config.client_side_validation && date.nil?
86
+ fail ArgumentError, "Missing the required parameter 'date' when calling NightlyRechargeApi.v3_users_nightly_recharge_date_get"
87
+ end
88
+ # resource path
89
+ local_var_path = '/v3/users/nightly-recharge/{date}'.sub('{' + 'date' + '}', date.to_s)
90
+
91
+ # query parameters
92
+ query_params = {}
93
+
94
+ # header parameters
95
+ header_params = {}
96
+
97
+ # form parameters
98
+ form_params = {}
99
+
100
+ # http body (model)
101
+ post_body = nil
102
+ auth_names = []
103
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
104
+ :header_params => header_params,
105
+ :query_params => query_params,
106
+ :form_params => form_params,
107
+ :body => post_body,
108
+ :auth_names => auth_names)
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug "API called: NightlyRechargeApi#v3_users_nightly_recharge_date_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
111
+ end
112
+ return data, status_code, headers
113
+ end
114
+ end
115
+ end
@@ -3,14 +3,14 @@
3
3
 
4
4
  #Polar Accesslink API documentation
5
5
 
6
- The version of the OpenAPI document: 3.40.0
6
+ OpenAPI spec version: 3.59.0
7
7
  Contact: b2bhelpdesk@polar.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.0
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.16
10
10
 
11
11
  =end
12
12
 
13
- require 'cgi'
13
+ require 'uri'
14
14
 
15
15
  module PolarAccesslink
16
16
  class PhysicalInfoApi
@@ -21,8 +21,8 @@ module PolarAccesslink
21
21
  end
22
22
  # Commit transaction
23
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
24
+ # @param transaction_id Transaction identifier
25
+ # @param user_id User identifier
26
26
  # @param [Hash] opts the optional parameters
27
27
  # @return [nil]
28
28
  def commit_physical_info_transaction(transaction_id, user_id, opts = {})
@@ -32,10 +32,10 @@ module PolarAccesslink
32
32
 
33
33
  # Commit transaction
34
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
35
+ # @param transaction_id Transaction identifier
36
+ # @param user_id User identifier
37
37
  # @param [Hash] opts the optional parameters
38
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
38
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
39
39
  def commit_physical_info_transaction_with_http_info(transaction_id, user_id, opts = {})
40
40
  if @api_client.config.debugging
41
41
  @api_client.config.logger.debug 'Calling API: PhysicalInfoApi.commit_physical_info_transaction ...'
@@ -49,57 +49,46 @@ module PolarAccesslink
49
49
  fail ArgumentError, "Missing the required parameter 'user_id' when calling PhysicalInfoApi.commit_physical_info_transaction"
50
50
  end
51
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))
52
+ local_var_path = '/v3/users/{user-id}/physical-information-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'user-id' + '}', user_id.to_s)
53
53
 
54
54
  # query parameters
55
- query_params = opts[:query_params] || {}
55
+ query_params = {}
56
56
 
57
57
  # header parameters
58
- header_params = opts[:header_params] || {}
58
+ header_params = {}
59
59
 
60
60
  # form parameters
61
- form_params = opts[:form_params] || {}
61
+ form_params = {}
62
62
 
63
63
  # http body (model)
64
- post_body = opts[:body]
65
-
66
- # return_type
67
- return_type = opts[:return_type]
68
-
69
- # auth_names
70
- auth_names = opts[:auth_names] || ['OAuth2']
71
-
72
- new_options = opts.merge(
64
+ post_body = nil
65
+ auth_names = []
66
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
73
67
  :header_params => header_params,
74
68
  :query_params => query_params,
75
69
  :form_params => form_params,
76
70
  :body => post_body,
77
- :auth_names => auth_names,
78
- :return_type => return_type
79
- )
80
-
81
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
71
+ :auth_names => auth_names)
82
72
  if @api_client.config.debugging
83
73
  @api_client.config.logger.debug "API called: PhysicalInfoApi#commit_physical_info_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
74
  end
85
75
  return data, status_code, headers
86
76
  end
87
-
88
77
  # Create transaction
89
78
  # Initiate physical info transaction. Check for new physical info and create a new transaction if found.
90
- # @param user_id [Integer] User identifier
79
+ # @param user_id User identifier
91
80
  # @param [Hash] opts the optional parameters
92
- # @return [TransactionLocation]
81
+ # @return [nil]
93
82
  def create_physical_info_transaction(user_id, opts = {})
94
- data, _status_code, _headers = create_physical_info_transaction_with_http_info(user_id, opts)
95
- data
83
+ create_physical_info_transaction_with_http_info(user_id, opts)
84
+ nil
96
85
  end
97
86
 
98
87
  # Create transaction
99
88
  # Initiate physical info transaction. Check for new physical info and create a new transaction if found.
100
- # @param user_id [Integer] User identifier
89
+ # @param user_id User identifier
101
90
  # @param [Hash] opts the optional parameters
102
- # @return [Array<(TransactionLocation, Integer, Hash)>] TransactionLocation data, response status code and response headers
91
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
103
92
  def create_physical_info_transaction_with_http_info(user_id, opts = {})
104
93
  if @api_client.config.debugging
105
94
  @api_client.config.logger.debug 'Calling API: PhysicalInfoApi.create_physical_info_transaction ...'
@@ -109,63 +98,50 @@ module PolarAccesslink
109
98
  fail ArgumentError, "Missing the required parameter 'user_id' when calling PhysicalInfoApi.create_physical_info_transaction"
110
99
  end
111
100
  # resource path
112
- local_var_path = '/v3/users/{user-id}/physical-information-transactions'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
101
+ local_var_path = '/v3/users/{user-id}/physical-information-transactions'.sub('{' + 'user-id' + '}', user_id.to_s)
113
102
 
114
103
  # query parameters
115
- query_params = opts[:query_params] || {}
104
+ query_params = {}
116
105
 
117
106
  # header parameters
118
- header_params = opts[:header_params] || {}
119
- # HTTP header 'Accept' (if needed)
120
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
107
+ header_params = {}
121
108
 
122
109
  # form parameters
123
- form_params = opts[:form_params] || {}
110
+ form_params = {}
124
111
 
125
112
  # http body (model)
126
- post_body = opts[:body]
127
-
128
- # return_type
129
- return_type = opts[:return_type] || 'TransactionLocation'
130
-
131
- # auth_names
132
- auth_names = opts[:auth_names] || ['OAuth2']
133
-
134
- new_options = opts.merge(
113
+ post_body = nil
114
+ auth_names = []
115
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
135
116
  :header_params => header_params,
136
117
  :query_params => query_params,
137
118
  :form_params => form_params,
138
119
  :body => post_body,
139
- :auth_names => auth_names,
140
- :return_type => return_type
141
- )
142
-
143
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
120
+ :auth_names => auth_names)
144
121
  if @api_client.config.debugging
145
122
  @api_client.config.logger.debug "API called: PhysicalInfoApi#create_physical_info_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
123
  end
147
124
  return data, status_code, headers
148
125
  end
149
-
150
126
  # Get physical info
151
127
  # Get physical info entity data
152
- # @param user_id [Integer] User identifier
153
- # @param transaction_id [Integer] Transaction identifier
154
- # @param physical_info_id [Integer] Physical information identifier
128
+ # @param user_id User identifier
129
+ # @param transaction_id Transaction identifier
130
+ # @param physical_info_id Physical information identifier
155
131
  # @param [Hash] opts the optional parameters
156
- # @return [PhysicalInformation]
132
+ # @return [nil]
157
133
  def get_physical_info(user_id, transaction_id, physical_info_id, opts = {})
158
- data, _status_code, _headers = get_physical_info_with_http_info(user_id, transaction_id, physical_info_id, opts)
159
- data
134
+ get_physical_info_with_http_info(user_id, transaction_id, physical_info_id, opts)
135
+ nil
160
136
  end
161
137
 
162
138
  # Get physical info
163
139
  # Get physical info entity data
164
- # @param user_id [Integer] User identifier
165
- # @param transaction_id [Integer] Transaction identifier
166
- # @param physical_info_id [Integer] Physical information identifier
140
+ # @param user_id User identifier
141
+ # @param transaction_id Transaction identifier
142
+ # @param physical_info_id Physical information identifier
167
143
  # @param [Hash] opts the optional parameters
168
- # @return [Array<(PhysicalInformation, Integer, Hash)>] PhysicalInformation data, response status code and response headers
144
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
169
145
  def get_physical_info_with_http_info(user_id, transaction_id, physical_info_id, opts = {})
170
146
  if @api_client.config.debugging
171
147
  @api_client.config.logger.debug 'Calling API: PhysicalInfoApi.get_physical_info ...'
@@ -183,61 +159,48 @@ module PolarAccesslink
183
159
  fail ArgumentError, "Missing the required parameter 'physical_info_id' when calling PhysicalInfoApi.get_physical_info"
184
160
  end
185
161
  # resource path
186
- 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))
162
+ local_var_path = '/v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id}'.sub('{' + 'user-id' + '}', user_id.to_s).sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'physical-info-id' + '}', physical_info_id.to_s)
187
163
 
188
164
  # query parameters
189
- query_params = opts[:query_params] || {}
165
+ query_params = {}
190
166
 
191
167
  # header parameters
192
- header_params = opts[:header_params] || {}
193
- # HTTP header 'Accept' (if needed)
194
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
168
+ header_params = {}
195
169
 
196
170
  # form parameters
197
- form_params = opts[:form_params] || {}
171
+ form_params = {}
198
172
 
199
173
  # http body (model)
200
- post_body = opts[:body]
201
-
202
- # return_type
203
- return_type = opts[:return_type] || 'PhysicalInformation'
204
-
205
- # auth_names
206
- auth_names = opts[:auth_names] || ['OAuth2']
207
-
208
- new_options = opts.merge(
174
+ post_body = nil
175
+ auth_names = []
176
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
209
177
  :header_params => header_params,
210
178
  :query_params => query_params,
211
179
  :form_params => form_params,
212
180
  :body => post_body,
213
- :auth_names => auth_names,
214
- :return_type => return_type
215
- )
216
-
217
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
181
+ :auth_names => auth_names)
218
182
  if @api_client.config.debugging
219
183
  @api_client.config.logger.debug "API called: PhysicalInfoApi#get_physical_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
220
184
  end
221
185
  return data, status_code, headers
222
186
  end
223
-
224
187
  # List physical infos
225
188
  # List new physical info data. After successfully initiating a transaction, physical infos included within it can be retrieved with the provided transactionId.
226
- # @param transaction_id [Integer] Transaction identifier
227
- # @param user_id [Integer] User identifier
189
+ # @param transaction_id Transaction identifier
190
+ # @param user_id User identifier
228
191
  # @param [Hash] opts the optional parameters
229
- # @return [PhysicalInformations]
192
+ # @return [nil]
230
193
  def list_physical_infos(transaction_id, user_id, opts = {})
231
- data, _status_code, _headers = list_physical_infos_with_http_info(transaction_id, user_id, opts)
232
- data
194
+ list_physical_infos_with_http_info(transaction_id, user_id, opts)
195
+ nil
233
196
  end
234
197
 
235
198
  # List physical infos
236
199
  # List new physical info data. After successfully initiating a transaction, physical infos included within it can be retrieved with the provided transactionId.
237
- # @param transaction_id [Integer] Transaction identifier
238
- # @param user_id [Integer] User identifier
200
+ # @param transaction_id Transaction identifier
201
+ # @param user_id User identifier
239
202
  # @param [Hash] opts the optional parameters
240
- # @return [Array<(PhysicalInformations, Integer, Hash)>] PhysicalInformations data, response status code and response headers
203
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
241
204
  def list_physical_infos_with_http_info(transaction_id, user_id, opts = {})
242
205
  if @api_client.config.debugging
243
206
  @api_client.config.logger.debug 'Calling API: PhysicalInfoApi.list_physical_infos ...'
@@ -251,38 +214,26 @@ module PolarAccesslink
251
214
  fail ArgumentError, "Missing the required parameter 'user_id' when calling PhysicalInfoApi.list_physical_infos"
252
215
  end
253
216
  # resource path
254
- 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))
217
+ local_var_path = '/v3/users/{user-id}/physical-information-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'user-id' + '}', user_id.to_s)
255
218
 
256
219
  # query parameters
257
- query_params = opts[:query_params] || {}
220
+ query_params = {}
258
221
 
259
222
  # header parameters
260
- header_params = opts[:header_params] || {}
261
- # HTTP header 'Accept' (if needed)
262
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
223
+ header_params = {}
263
224
 
264
225
  # form parameters
265
- form_params = opts[:form_params] || {}
226
+ form_params = {}
266
227
 
267
228
  # http body (model)
268
- post_body = opts[:body]
269
-
270
- # return_type
271
- return_type = opts[:return_type] || 'PhysicalInformations'
272
-
273
- # auth_names
274
- auth_names = opts[:auth_names] || ['OAuth2']
275
-
276
- new_options = opts.merge(
229
+ post_body = nil
230
+ auth_names = []
231
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
277
232
  :header_params => header_params,
278
233
  :query_params => query_params,
279
234
  :form_params => form_params,
280
235
  :body => post_body,
281
- :auth_names => auth_names,
282
- :return_type => return_type
283
- )
284
-
285
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
236
+ :auth_names => auth_names)
286
237
  if @api_client.config.debugging
287
238
  @api_client.config.logger.debug "API called: PhysicalInfoApi#list_physical_infos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
288
239
  end