Class: PolarAccesslinkApiGem::DailyActivityApi
- Inherits:
-
Object
- Object
- PolarAccesslinkApiGem::DailyActivityApi
- Defined in:
- lib/polar-accesslink-api-gem/api/daily_activity_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#commit_activity_transaction(transaction_id, user_id, opts = {}) ⇒ nil
Commit transaction After successfully retrieving activity summary data within a transaction, partners are expected to commit the transaction.
-
#commit_activity_transaction_with_http_info(transaction_id, user_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Commit transaction After successfully retrieving activity summary data within a transaction, partners are expected to commit the transaction.
-
#create_activity_transaction(user_id, opts = {}) ⇒ TransactionLocation
Create transaction Initiate activity transaction.
-
#create_activity_transaction_with_http_info(user_id, opts = {}) ⇒ Array<(TransactionLocation, Integer, Hash)>
Create transaction Initiate activity transaction.
-
#get_activity_summary(user_id, transaction_id, activity_id, opts = {}) ⇒ Activity
Get activity summary.
-
#get_activity_summary_with_http_info(user_id, transaction_id, activity_id, opts = {}) ⇒ Array<(Activity, Integer, Hash)>
Get activity summary.
-
#get_step_samples(user_id, transaction_id, activity_id, opts = {}) ⇒ ActivityStepSamples
Get step samples Get activity step samples.
-
#get_step_samples_with_http_info(user_id, transaction_id, activity_id, opts = {}) ⇒ Array<(ActivityStepSamples, Integer, Hash)>
Get step samples Get activity step samples.
-
#get_zone_samples(user_id, transaction_id, activity_id, opts = {}) ⇒ ActivityZoneSamples
Get zone samples Get activity zone samples.
-
#get_zone_samples_with_http_info(user_id, transaction_id, activity_id, opts = {}) ⇒ Array<(ActivityZoneSamples, Integer, Hash)>
Get zone samples Get activity zone samples.
-
#initialize(api_client = ApiClient.default) ⇒ DailyActivityApi
constructor
A new instance of DailyActivityApi.
-
#list_activities(transaction_id, user_id, opts = {}) ⇒ ActivityLog
List activities List new activity data.
-
#list_activities_with_http_info(transaction_id, user_id, opts = {}) ⇒ Array<(ActivityLog, Integer, Hash)>
List activities List new activity data.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ DailyActivityApi
Returns a new instance of DailyActivityApi.
19 20 21 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#commit_activity_transaction(transaction_id, user_id, opts = {}) ⇒ nil
Commit transaction After successfully retrieving activity summary data within a transaction, partners are expected to commit the transaction.
28 29 30 31 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 28 def commit_activity_transaction(transaction_id, user_id, opts = {}) commit_activity_transaction_with_http_info(transaction_id, user_id, opts) nil end |
#commit_activity_transaction_with_http_info(transaction_id, user_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Commit transaction After successfully retrieving activity summary data within a transaction, partners are expected to commit the transaction.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 39 def commit_activity_transaction_with_http_info(transaction_id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DailyActivityApi.commit_activity_transaction ...' end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.commit_activity_transaction" end pattern = Regexp.new(/[0-9]+/) if @api_client.config.client_side_validation && transaction_id !~ pattern fail ArgumentError, "invalid value for 'transaction_id' when calling DailyActivityApi.commit_activity_transaction, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.commit_activity_transaction" end pattern = Regexp.new(/[0-9]+/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling DailyActivityApi.commit_activity_transaction, must conform to the pattern #{pattern}." end # resource path local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"DailyActivityApi.commit_activity_transaction", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DailyActivityApi#commit_activity_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_activity_transaction(user_id, opts = {}) ⇒ TransactionLocation
Create transaction Initiate activity transaction. Check for new activity summaries and create a new transaction if found.
104 105 106 107 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 104 def create_activity_transaction(user_id, opts = {}) data, _status_code, _headers = create_activity_transaction_with_http_info(user_id, opts) data end |
#create_activity_transaction_with_http_info(user_id, opts = {}) ⇒ Array<(TransactionLocation, Integer, Hash)>
Create transaction Initiate activity transaction. Check for new activity summaries and create a new transaction if found.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 114 def create_activity_transaction_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DailyActivityApi.create_activity_transaction ...' end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.create_activity_transaction" end pattern = Regexp.new(/[0-9]+/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling DailyActivityApi.create_activity_transaction, must conform to the pattern #{pattern}." end # resource path local_var_path = '/v3/users/{user-id}/activity-transactions'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TransactionLocation' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"DailyActivityApi.create_activity_transaction", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DailyActivityApi#create_activity_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_activity_summary(user_id, transaction_id, activity_id, opts = {}) ⇒ Activity
Get activity summary
173 174 175 176 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 173 def get_activity_summary(user_id, transaction_id, activity_id, opts = {}) data, _status_code, _headers = get_activity_summary_with_http_info(user_id, transaction_id, activity_id, opts) data end |
#get_activity_summary_with_http_info(user_id, transaction_id, activity_id, opts = {}) ⇒ Array<(Activity, Integer, Hash)>
Get activity summary
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 184 def get_activity_summary_with_http_info(user_id, transaction_id, activity_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DailyActivityApi.get_activity_summary ...' end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.get_activity_summary" end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.get_activity_summary" end # verify the required parameter 'activity_id' is set if @api_client.config.client_side_validation && activity_id.nil? fail ArgumentError, "Missing the required parameter 'activity_id' when calling DailyActivityApi.get_activity_summary" end # resource path local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'activity-id' + '}', CGI.escape(activity_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Activity' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"DailyActivityApi.get_activity_summary", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DailyActivityApi#get_activity_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_step_samples(user_id, transaction_id, activity_id, opts = {}) ⇒ ActivityStepSamples
Get step samples Get activity step samples. Example data can be seen from [appendix](#activity-step-time-series).
247 248 249 250 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 247 def get_step_samples(user_id, transaction_id, activity_id, opts = {}) data, _status_code, _headers = get_step_samples_with_http_info(user_id, transaction_id, activity_id, opts) data end |
#get_step_samples_with_http_info(user_id, transaction_id, activity_id, opts = {}) ⇒ Array<(ActivityStepSamples, Integer, Hash)>
Get step samples Get activity step samples. Example data can be seen from [appendix](#activity-step-time-series).
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 259 def get_step_samples_with_http_info(user_id, transaction_id, activity_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DailyActivityApi.get_step_samples ...' end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.get_step_samples" end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.get_step_samples" end # verify the required parameter 'activity_id' is set if @api_client.config.client_side_validation && activity_id.nil? fail ArgumentError, "Missing the required parameter 'activity_id' when calling DailyActivityApi.get_step_samples" end # resource path local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'activity-id' + '}', CGI.escape(activity_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ActivityStepSamples' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"DailyActivityApi.get_step_samples", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DailyActivityApi#get_step_samples\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_zone_samples(user_id, transaction_id, activity_id, opts = {}) ⇒ ActivityZoneSamples
Get zone samples Get activity zone samples. Example data can be seen from [appendix](#activity-zone-time-series).
322 323 324 325 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 322 def get_zone_samples(user_id, transaction_id, activity_id, opts = {}) data, _status_code, _headers = get_zone_samples_with_http_info(user_id, transaction_id, activity_id, opts) data end |
#get_zone_samples_with_http_info(user_id, transaction_id, activity_id, opts = {}) ⇒ Array<(ActivityZoneSamples, Integer, Hash)>
Get zone samples Get activity zone samples. Example data can be seen from [appendix](#activity-zone-time-series).
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 334 def get_zone_samples_with_http_info(user_id, transaction_id, activity_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DailyActivityApi.get_zone_samples ...' end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.get_zone_samples" end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.get_zone_samples" end # verify the required parameter 'activity_id' is set if @api_client.config.client_side_validation && activity_id.nil? fail ArgumentError, "Missing the required parameter 'activity_id' when calling DailyActivityApi.get_zone_samples" end # resource path local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'activity-id' + '}', CGI.escape(activity_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ActivityZoneSamples' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"DailyActivityApi.get_zone_samples", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DailyActivityApi#get_zone_samples\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_activities(transaction_id, user_id, opts = {}) ⇒ ActivityLog
List activities List new activity data. After successfully initiating a transaction, activity summaries included within it can be retrieved with the provided transactionId.
396 397 398 399 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 396 def list_activities(transaction_id, user_id, opts = {}) data, _status_code, _headers = list_activities_with_http_info(transaction_id, user_id, opts) data end |
#list_activities_with_http_info(transaction_id, user_id, opts = {}) ⇒ Array<(ActivityLog, Integer, Hash)>
List activities List new activity data. After successfully initiating a transaction, activity summaries included within it can be retrieved with the provided transactionId.
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/polar-accesslink-api-gem/api/daily_activity_api.rb', line 407 def list_activities_with_http_info(transaction_id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DailyActivityApi.list_activities ...' end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DailyActivityApi.list_activities" end pattern = Regexp.new(/[0-9]+/) if @api_client.config.client_side_validation && transaction_id !~ pattern fail ArgumentError, "invalid value for 'transaction_id' when calling DailyActivityApi.list_activities, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DailyActivityApi.list_activities" end pattern = Regexp.new(/[0-9]+/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling DailyActivityApi.list_activities, must conform to the pattern #{pattern}." end # resource path local_var_path = '/v3/users/{user-id}/activity-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ActivityLog' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"DailyActivityApi.list_activities", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DailyActivityApi#list_activities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |