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 PullNotificationsApi
@@ -22,16 +22,16 @@ module PolarAccesslink
22
22
  # List
23
23
  # Get list of available exercises and activities for users
24
24
  # @param [Hash] opts the optional parameters
25
- # @return [AvailableUserDatas]
25
+ # @return [nil]
26
26
  def list(opts = {})
27
- data, _status_code, _headers = list_with_http_info(opts)
28
- data
27
+ list_with_http_info(opts)
28
+ nil
29
29
  end
30
30
 
31
31
  # List
32
32
  # Get list of available exercises and activities for users
33
33
  # @param [Hash] opts the optional parameters
34
- # @return [Array<(AvailableUserDatas, Integer, Hash)>] AvailableUserDatas data, response status code and response headers
34
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
35
35
  def list_with_http_info(opts = {})
36
36
  if @api_client.config.debugging
37
37
  @api_client.config.logger.debug 'Calling API: PullNotificationsApi.list ...'
@@ -40,35 +40,23 @@ module PolarAccesslink
40
40
  local_var_path = '/v3/notifications'
41
41
 
42
42
  # query parameters
43
- query_params = opts[:query_params] || {}
43
+ query_params = {}
44
44
 
45
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', 'application/xml'])
46
+ header_params = {}
49
47
 
50
48
  # form parameters
51
- form_params = opts[:form_params] || {}
49
+ form_params = {}
52
50
 
53
51
  # http body (model)
54
- post_body = opts[:body]
55
-
56
- # return_type
57
- return_type = opts[:return_type] || 'AvailableUserDatas'
58
-
59
- # auth_names
60
- auth_names = opts[:auth_names] || ['Basic']
61
-
62
- new_options = opts.merge(
52
+ post_body = nil
53
+ auth_names = []
54
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
63
55
  :header_params => header_params,
64
56
  :query_params => query_params,
65
57
  :form_params => form_params,
66
58
  :body => post_body,
67
- :auth_names => auth_names,
68
- :return_type => return_type
69
- )
70
-
71
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
59
+ :auth_names => auth_names)
72
60
  if @api_client.config.debugging
73
61
  @api_client.config.logger.debug "API called: PullNotificationsApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
62
  end
@@ -0,0 +1,158 @@
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 SleepApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List nights
23
+ # List sleep data of user for the last 28 days.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [nil]
26
+ def list_nights(opts = {})
27
+ list_nights_with_http_info(opts)
28
+ nil
29
+ end
30
+
31
+ # List nights
32
+ # List sleep 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_nights_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: SleepApi.list_nights ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/v3/users/sleep'
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: SleepApi#list_nights\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
62
+ end
63
+ return data, status_code, headers
64
+ end
65
+ # Get available sleep times
66
+ # Get the dates with sleep start and end times, where user has sleep data available in the last 28 days.
67
+ # @param [Hash] opts the optional parameters
68
+ # @return [nil]
69
+ def v3_users_sleep_available_get(opts = {})
70
+ v3_users_sleep_available_get_with_http_info(opts)
71
+ nil
72
+ end
73
+
74
+ # Get available sleep times
75
+ # Get the dates with sleep start and end times, where user has sleep data available in the last 28 days.
76
+ # @param [Hash] opts the optional parameters
77
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
78
+ def v3_users_sleep_available_get_with_http_info(opts = {})
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug 'Calling API: SleepApi.v3_users_sleep_available_get ...'
81
+ end
82
+ # resource path
83
+ local_var_path = '/v3/users/sleep/available'
84
+
85
+ # query parameters
86
+ query_params = {}
87
+
88
+ # header parameters
89
+ header_params = {}
90
+
91
+ # form parameters
92
+ form_params = {}
93
+
94
+ # http body (model)
95
+ post_body = nil
96
+ auth_names = []
97
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
98
+ :header_params => header_params,
99
+ :query_params => query_params,
100
+ :form_params => form_params,
101
+ :body => post_body,
102
+ :auth_names => auth_names)
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug "API called: SleepApi#v3_users_sleep_available_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
105
+ end
106
+ return data, status_code, headers
107
+ end
108
+ # Get Sleep
109
+ # Get Users sleep data for given date.
110
+ # @param date Date of sleep as ISO-8601 date string, example: \&quot;2020-01-01\&quot;
111
+ # @param [Hash] opts the optional parameters
112
+ # @return [nil]
113
+ def v3_users_sleep_date_get(date, opts = {})
114
+ v3_users_sleep_date_get_with_http_info(date, opts)
115
+ nil
116
+ end
117
+
118
+ # Get Sleep
119
+ # Get Users sleep data for given date.
120
+ # @param date Date of sleep as ISO-8601 date string, example: \&quot;2020-01-01\&quot;
121
+ # @param [Hash] opts the optional parameters
122
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
123
+ def v3_users_sleep_date_get_with_http_info(date, opts = {})
124
+ if @api_client.config.debugging
125
+ @api_client.config.logger.debug 'Calling API: SleepApi.v3_users_sleep_date_get ...'
126
+ end
127
+ # verify the required parameter 'date' is set
128
+ if @api_client.config.client_side_validation && date.nil?
129
+ fail ArgumentError, "Missing the required parameter 'date' when calling SleepApi.v3_users_sleep_date_get"
130
+ end
131
+ # resource path
132
+ local_var_path = '/v3/users/sleep/{date}'.sub('{' + 'date' + '}', date.to_s)
133
+
134
+ # query parameters
135
+ query_params = {}
136
+
137
+ # header parameters
138
+ header_params = {}
139
+
140
+ # form parameters
141
+ form_params = {}
142
+
143
+ # http body (model)
144
+ post_body = nil
145
+ auth_names = []
146
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
147
+ :header_params => header_params,
148
+ :query_params => query_params,
149
+ :form_params => form_params,
150
+ :body => post_body,
151
+ :auth_names => auth_names)
152
+ if @api_client.config.debugging
153
+ @api_client.config.logger.debug "API called: SleepApi#v3_users_sleep_date_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
154
+ end
155
+ return data, status_code, headers
156
+ end
157
+ end
158
+ 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 TrainingDataApi
@@ -21,8 +21,8 @@ module PolarAccesslink
21
21
  end
22
22
  # Commit transaction
23
23
  # After successfully retrieving training session data 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_exercise_transaction(transaction_id, user_id, opts = {})
@@ -32,10 +32,10 @@ module PolarAccesslink
32
32
 
33
33
  # Commit transaction
34
34
  # After successfully retrieving training session data 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_exercise_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: TrainingDataApi.commit_exercise_transaction ...'
@@ -44,72 +44,51 @@ module PolarAccesslink
44
44
  if @api_client.config.client_side_validation && transaction_id.nil?
45
45
  fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TrainingDataApi.commit_exercise_transaction"
46
46
  end
47
- pattern = Regexp.new(/[0-9]+/)
48
- if @api_client.config.client_side_validation && transaction_id !~ pattern
49
- fail ArgumentError, "invalid value for 'transaction_id' when calling TrainingDataApi.commit_exercise_transaction, must conform to the pattern #{pattern}."
50
- end
51
-
52
47
  # verify the required parameter 'user_id' is set
53
48
  if @api_client.config.client_side_validation && user_id.nil?
54
49
  fail ArgumentError, "Missing the required parameter 'user_id' when calling TrainingDataApi.commit_exercise_transaction"
55
50
  end
56
- pattern = Regexp.new(/[0-9]+/)
57
- if @api_client.config.client_side_validation && user_id !~ pattern
58
- fail ArgumentError, "invalid value for 'user_id' when calling TrainingDataApi.commit_exercise_transaction, must conform to the pattern #{pattern}."
59
- end
60
-
61
51
  # resource path
62
- local_var_path = '/v3/users/{user-id}/exercise-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}/exercise-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'user-id' + '}', user_id.to_s)
63
53
 
64
54
  # query parameters
65
- query_params = opts[:query_params] || {}
55
+ query_params = {}
66
56
 
67
57
  # header parameters
68
- header_params = opts[:header_params] || {}
58
+ header_params = {}
69
59
 
70
60
  # form parameters
71
- form_params = opts[:form_params] || {}
61
+ form_params = {}
72
62
 
73
63
  # http body (model)
74
- post_body = opts[:body]
75
-
76
- # return_type
77
- return_type = opts[:return_type]
78
-
79
- # auth_names
80
- auth_names = opts[:auth_names] || ['OAuth2']
81
-
82
- new_options = opts.merge(
64
+ post_body = nil
65
+ auth_names = []
66
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
83
67
  :header_params => header_params,
84
68
  :query_params => query_params,
85
69
  :form_params => form_params,
86
70
  :body => post_body,
87
- :auth_names => auth_names,
88
- :return_type => return_type
89
- )
90
-
91
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
71
+ :auth_names => auth_names)
92
72
  if @api_client.config.debugging
93
73
  @api_client.config.logger.debug "API called: TrainingDataApi#commit_exercise_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
94
74
  end
95
75
  return data, status_code, headers
96
76
  end
97
-
98
77
  # Create transaction
99
78
  # Check for new training data and create a new transaction if found.
100
- # @param user_id [Integer] User identifier
79
+ # @param user_id User identifier
101
80
  # @param [Hash] opts the optional parameters
102
- # @return [TransactionLocation]
81
+ # @return [nil]
103
82
  def create_exercise_transaction(user_id, opts = {})
104
- data, _status_code, _headers = create_exercise_transaction_with_http_info(user_id, opts)
105
- data
83
+ create_exercise_transaction_with_http_info(user_id, opts)
84
+ nil
106
85
  end
107
86
 
108
87
  # Create transaction
109
88
  # Check for new training data and create a new transaction if found.
110
- # @param user_id [Integer] User identifier
89
+ # @param user_id User identifier
111
90
  # @param [Hash] opts the optional parameters
112
- # @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
113
92
  def create_exercise_transaction_with_http_info(user_id, opts = {})
114
93
  if @api_client.config.debugging
115
94
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.create_exercise_transaction ...'
@@ -118,69 +97,51 @@ module PolarAccesslink
118
97
  if @api_client.config.client_side_validation && user_id.nil?
119
98
  fail ArgumentError, "Missing the required parameter 'user_id' when calling TrainingDataApi.create_exercise_transaction"
120
99
  end
121
- pattern = Regexp.new(/[0-9]+/)
122
- if @api_client.config.client_side_validation && user_id !~ pattern
123
- fail ArgumentError, "invalid value for 'user_id' when calling TrainingDataApi.create_exercise_transaction, must conform to the pattern #{pattern}."
124
- end
125
-
126
100
  # resource path
127
- local_var_path = '/v3/users/{user-id}/exercise-transactions'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
101
+ local_var_path = '/v3/users/{user-id}/exercise-transactions'.sub('{' + 'user-id' + '}', user_id.to_s)
128
102
 
129
103
  # query parameters
130
- query_params = opts[:query_params] || {}
104
+ query_params = {}
131
105
 
132
106
  # header parameters
133
- header_params = opts[:header_params] || {}
134
- # HTTP header 'Accept' (if needed)
135
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
107
+ header_params = {}
136
108
 
137
109
  # form parameters
138
- form_params = opts[:form_params] || {}
110
+ form_params = {}
139
111
 
140
112
  # http body (model)
141
- post_body = opts[:body]
142
-
143
- # return_type
144
- return_type = opts[:return_type] || 'TransactionLocation'
145
-
146
- # auth_names
147
- auth_names = opts[:auth_names] || ['OAuth2']
148
-
149
- new_options = opts.merge(
113
+ post_body = nil
114
+ auth_names = []
115
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
150
116
  :header_params => header_params,
151
117
  :query_params => query_params,
152
118
  :form_params => form_params,
153
119
  :body => post_body,
154
- :auth_names => auth_names,
155
- :return_type => return_type
156
- )
157
-
158
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
120
+ :auth_names => auth_names)
159
121
  if @api_client.config.debugging
160
122
  @api_client.config.logger.debug "API called: TrainingDataApi#create_exercise_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
161
123
  end
162
124
  return data, status_code, headers
163
125
  end
164
-
165
126
  # Get available samples
166
127
  # Retrieve list of links to available samples in training session
167
- # @param user_id [Integer] User identifier
168
- # @param transaction_id [Integer] Transaction identifier
169
- # @param exercise_id [Integer] Exercise identifier
128
+ # @param user_id User identifier
129
+ # @param transaction_id Transaction identifier
130
+ # @param exercise_id Exercise identifier
170
131
  # @param [Hash] opts the optional parameters
171
- # @return [Samples]
132
+ # @return [nil]
172
133
  def get_available_samples(user_id, transaction_id, exercise_id, opts = {})
173
- data, _status_code, _headers = get_available_samples_with_http_info(user_id, transaction_id, exercise_id, opts)
174
- data
134
+ get_available_samples_with_http_info(user_id, transaction_id, exercise_id, opts)
135
+ nil
175
136
  end
176
137
 
177
138
  # Get available samples
178
139
  # Retrieve list of links to available samples in training session
179
- # @param user_id [Integer] User identifier
180
- # @param transaction_id [Integer] Transaction identifier
181
- # @param exercise_id [Integer] Exercise identifier
140
+ # @param user_id User identifier
141
+ # @param transaction_id Transaction identifier
142
+ # @param exercise_id Exercise identifier
182
143
  # @param [Hash] opts the optional parameters
183
- # @return [Array<(Samples, Integer, Hash)>] Samples data, response status code and response headers
144
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
184
145
  def get_available_samples_with_http_info(user_id, transaction_id, exercise_id, opts = {})
185
146
  if @api_client.config.debugging
186
147
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.get_available_samples ...'
@@ -198,63 +159,50 @@ module PolarAccesslink
198
159
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling TrainingDataApi.get_available_samples"
199
160
  end
200
161
  # resource path
201
- local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'exercise-id' + '}', CGI.escape(exercise_id.to_s))
162
+ local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples'.sub('{' + 'user-id' + '}', user_id.to_s).sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'exercise-id' + '}', exercise_id.to_s)
202
163
 
203
164
  # query parameters
204
- query_params = opts[:query_params] || {}
165
+ query_params = {}
205
166
 
206
167
  # header parameters
207
- header_params = opts[:header_params] || {}
208
- # HTTP header 'Accept' (if needed)
209
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
168
+ header_params = {}
210
169
 
211
170
  # form parameters
212
- form_params = opts[:form_params] || {}
171
+ form_params = {}
213
172
 
214
173
  # http body (model)
215
- post_body = opts[:body]
216
-
217
- # return_type
218
- return_type = opts[:return_type] || 'Samples'
219
-
220
- # auth_names
221
- auth_names = opts[:auth_names] || ['OAuth2']
222
-
223
- new_options = opts.merge(
174
+ post_body = nil
175
+ auth_names = []
176
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
224
177
  :header_params => header_params,
225
178
  :query_params => query_params,
226
179
  :form_params => form_params,
227
180
  :body => post_body,
228
- :auth_names => auth_names,
229
- :return_type => return_type
230
- )
231
-
232
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
181
+ :auth_names => auth_names)
233
182
  if @api_client.config.debugging
234
183
  @api_client.config.logger.debug "API called: TrainingDataApi#get_available_samples\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
235
184
  end
236
185
  return data, status_code, headers
237
186
  end
238
-
239
187
  # Get exercise summary
240
188
  # Retrieve training session summary data
241
- # @param user_id [Integer] User identifier
242
- # @param transaction_id [Integer] Transaction identifier
243
- # @param exercise_id [Integer] Exercise identifier
189
+ # @param user_id User identifier
190
+ # @param transaction_id Transaction identifier
191
+ # @param exercise_id Exercise identifier
244
192
  # @param [Hash] opts the optional parameters
245
- # @return [Exercise]
193
+ # @return [nil]
246
194
  def get_exercise_summary(user_id, transaction_id, exercise_id, opts = {})
247
- data, _status_code, _headers = get_exercise_summary_with_http_info(user_id, transaction_id, exercise_id, opts)
248
- data
195
+ get_exercise_summary_with_http_info(user_id, transaction_id, exercise_id, opts)
196
+ nil
249
197
  end
250
198
 
251
199
  # Get exercise summary
252
200
  # Retrieve training session summary data
253
- # @param user_id [Integer] User identifier
254
- # @param transaction_id [Integer] Transaction identifier
255
- # @param exercise_id [Integer] Exercise identifier
201
+ # @param user_id User identifier
202
+ # @param transaction_id Transaction identifier
203
+ # @param exercise_id Exercise identifier
256
204
  # @param [Hash] opts the optional parameters
257
- # @return [Array<(Exercise, Integer, Hash)>] Exercise data, response status code and response headers
205
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
258
206
  def get_exercise_summary_with_http_info(user_id, transaction_id, exercise_id, opts = {})
259
207
  if @api_client.config.debugging
260
208
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.get_exercise_summary ...'
@@ -272,63 +220,50 @@ module PolarAccesslink
272
220
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling TrainingDataApi.get_exercise_summary"
273
221
  end
274
222
  # resource path
275
- local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'exercise-id' + '}', CGI.escape(exercise_id.to_s))
223
+ local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}'.sub('{' + 'user-id' + '}', user_id.to_s).sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'exercise-id' + '}', exercise_id.to_s)
276
224
 
277
225
  # query parameters
278
- query_params = opts[:query_params] || {}
226
+ query_params = {}
279
227
 
280
228
  # header parameters
281
- header_params = opts[:header_params] || {}
282
- # HTTP header 'Accept' (if needed)
283
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
229
+ header_params = {}
284
230
 
285
231
  # form parameters
286
- form_params = opts[:form_params] || {}
232
+ form_params = {}
287
233
 
288
234
  # http body (model)
289
- post_body = opts[:body]
290
-
291
- # return_type
292
- return_type = opts[:return_type] || 'Exercise'
293
-
294
- # auth_names
295
- auth_names = opts[:auth_names] || ['OAuth2']
296
-
297
- new_options = opts.merge(
235
+ post_body = nil
236
+ auth_names = []
237
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
298
238
  :header_params => header_params,
299
239
  :query_params => query_params,
300
240
  :form_params => form_params,
301
241
  :body => post_body,
302
- :auth_names => auth_names,
303
- :return_type => return_type
304
- )
305
-
306
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
242
+ :auth_names => auth_names)
307
243
  if @api_client.config.debugging
308
244
  @api_client.config.logger.debug "API called: TrainingDataApi#get_exercise_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
309
245
  end
310
246
  return data, status_code, headers
311
247
  end
312
-
313
248
  # Get FIT (beta)
314
249
  # Retrieve exercise in FIT format. **Note!** This interface is in beta phase. If there is anything we can help you with or you want to give us feedback, please contact [Support](#support).
315
- # @param user_id [Integer] User identifier
316
- # @param transaction_id [Integer] Transaction identifier
317
- # @param exercise_id [Integer] Exercise identifier
250
+ # @param user_id User identifier
251
+ # @param transaction_id Transaction identifier
252
+ # @param exercise_id Exercise identifier
318
253
  # @param [Hash] opts the optional parameters
319
- # @return [String]
254
+ # @return [nil]
320
255
  def get_fit(user_id, transaction_id, exercise_id, opts = {})
321
- data, _status_code, _headers = get_fit_with_http_info(user_id, transaction_id, exercise_id, opts)
322
- data
256
+ get_fit_with_http_info(user_id, transaction_id, exercise_id, opts)
257
+ nil
323
258
  end
324
259
 
325
260
  # Get FIT (beta)
326
261
  # Retrieve exercise in FIT format. **Note!** This interface is in beta phase. If there is anything we can help you with or you want to give us feedback, please contact [Support](#support).
327
- # @param user_id [Integer] User identifier
328
- # @param transaction_id [Integer] Transaction identifier
329
- # @param exercise_id [Integer] Exercise identifier
262
+ # @param user_id User identifier
263
+ # @param transaction_id Transaction identifier
264
+ # @param exercise_id Exercise identifier
330
265
  # @param [Hash] opts the optional parameters
331
- # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
266
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
332
267
  def get_fit_with_http_info(user_id, transaction_id, exercise_id, opts = {})
333
268
  if @api_client.config.debugging
334
269
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.get_fit ...'
@@ -346,63 +281,52 @@ module PolarAccesslink
346
281
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling TrainingDataApi.get_fit"
347
282
  end
348
283
  # resource path
349
- local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'exercise-id' + '}', CGI.escape(exercise_id.to_s))
284
+ local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit'.sub('{' + 'user-id' + '}', user_id.to_s).sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'exercise-id' + '}', exercise_id.to_s)
350
285
 
351
286
  # query parameters
352
- query_params = opts[:query_params] || {}
287
+ query_params = {}
353
288
 
354
289
  # header parameters
355
- header_params = opts[:header_params] || {}
356
- # HTTP header 'Accept' (if needed)
357
- header_params['Accept'] = @api_client.select_header_accept(['*/*'])
290
+ header_params = {}
358
291
 
359
292
  # form parameters
360
- form_params = opts[:form_params] || {}
293
+ form_params = {}
361
294
 
362
295
  # http body (model)
363
- post_body = opts[:body]
364
-
365
- # return_type
366
- return_type = opts[:return_type] || 'String'
367
-
368
- # auth_names
369
- auth_names = opts[:auth_names] || ['OAuth2']
370
-
371
- new_options = opts.merge(
296
+ post_body = nil
297
+ auth_names = []
298
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
372
299
  :header_params => header_params,
373
300
  :query_params => query_params,
374
301
  :form_params => form_params,
375
302
  :body => post_body,
376
- :auth_names => auth_names,
377
- :return_type => return_type
378
- )
379
-
380
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
303
+ :auth_names => auth_names)
381
304
  if @api_client.config.debugging
382
305
  @api_client.config.logger.debug "API called: TrainingDataApi#get_fit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
383
306
  end
384
307
  return data, status_code, headers
385
308
  end
386
-
387
309
  # Get GPX
388
310
  # Retrieve training session summary data in GPX format
389
- # @param user_id [Integer] User identifier
390
- # @param transaction_id [Integer] Transaction identifier
391
- # @param exercise_id [Integer] Exercise identifier
311
+ # @param user_id User identifier
312
+ # @param transaction_id Transaction identifier
313
+ # @param exercise_id Exercise identifier
392
314
  # @param [Hash] opts the optional parameters
393
- # @return [String]
315
+ # @option opts [Object] :include_pause_times Whether to add pauses as part of the route. Default is false.
316
+ # @return [nil]
394
317
  def get_gpx(user_id, transaction_id, exercise_id, opts = {})
395
- data, _status_code, _headers = get_gpx_with_http_info(user_id, transaction_id, exercise_id, opts)
396
- data
318
+ get_gpx_with_http_info(user_id, transaction_id, exercise_id, opts)
319
+ nil
397
320
  end
398
321
 
399
322
  # Get GPX
400
323
  # Retrieve training session summary data in GPX format
401
- # @param user_id [Integer] User identifier
402
- # @param transaction_id [Integer] Transaction identifier
403
- # @param exercise_id [Integer] Exercise identifier
324
+ # @param user_id User identifier
325
+ # @param transaction_id Transaction identifier
326
+ # @param exercise_id Exercise identifier
404
327
  # @param [Hash] opts the optional parameters
405
- # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
328
+ # @option opts [Object] :include_pause_times Whether to add pauses as part of the route. Default is false.
329
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
406
330
  def get_gpx_with_http_info(user_id, transaction_id, exercise_id, opts = {})
407
331
  if @api_client.config.debugging
408
332
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.get_gpx ...'
@@ -420,63 +344,51 @@ module PolarAccesslink
420
344
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling TrainingDataApi.get_gpx"
421
345
  end
422
346
  # resource path
423
- local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'exercise-id' + '}', CGI.escape(exercise_id.to_s))
347
+ local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx'.sub('{' + 'user-id' + '}', user_id.to_s).sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'exercise-id' + '}', exercise_id.to_s)
424
348
 
425
349
  # query parameters
426
- query_params = opts[:query_params] || {}
350
+ query_params = {}
351
+ query_params[:'includePauseTimes'] = opts[:'include_pause_times'] if !opts[:'include_pause_times'].nil?
427
352
 
428
353
  # header parameters
429
- header_params = opts[:header_params] || {}
430
- # HTTP header 'Accept' (if needed)
431
- header_params['Accept'] = @api_client.select_header_accept(['application/gpx+xml'])
354
+ header_params = {}
432
355
 
433
356
  # form parameters
434
- form_params = opts[:form_params] || {}
357
+ form_params = {}
435
358
 
436
359
  # http body (model)
437
- post_body = opts[:body]
438
-
439
- # return_type
440
- return_type = opts[:return_type] || 'String'
441
-
442
- # auth_names
443
- auth_names = opts[:auth_names] || ['OAuth2']
444
-
445
- new_options = opts.merge(
360
+ post_body = nil
361
+ auth_names = []
362
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
446
363
  :header_params => header_params,
447
364
  :query_params => query_params,
448
365
  :form_params => form_params,
449
366
  :body => post_body,
450
- :auth_names => auth_names,
451
- :return_type => return_type
452
- )
453
-
454
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
367
+ :auth_names => auth_names)
455
368
  if @api_client.config.debugging
456
369
  @api_client.config.logger.debug "API called: TrainingDataApi#get_gpx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
457
370
  end
458
371
  return data, status_code, headers
459
372
  end
460
-
461
373
  # Get heart rate zones
462
374
  # Retrieve heart rate zones in training session
463
- # @param user_id [Integer] User identifier
464
- # @param transaction_id [Integer] Transaction identifier
465
- # @param exercise_id [Integer] Exercise identifier
375
+ # @param user_id User identifier
376
+ # @param transaction_id Transaction identifier
377
+ # @param exercise_id Exercise identifier
466
378
  # @param [Hash] opts the optional parameters
467
- # @return [Zones]
379
+ # @return [nil]
468
380
  def get_heart_rate_zones(user_id, transaction_id, exercise_id, opts = {})
469
- data, _status_code, _headers = get_heart_rate_zones_with_http_info(user_id, transaction_id, exercise_id, opts)
470
- data
381
+ get_heart_rate_zones_with_http_info(user_id, transaction_id, exercise_id, opts)
382
+ nil
471
383
  end
472
384
 
473
385
  # Get heart rate zones
474
386
  # Retrieve heart rate zones in training session
475
- # @param user_id [Integer] User identifier
476
- # @param transaction_id [Integer] Transaction identifier
477
- # @param exercise_id [Integer] Exercise identifier
387
+ # @param user_id User identifier
388
+ # @param transaction_id Transaction identifier
389
+ # @param exercise_id Exercise identifier
478
390
  # @param [Hash] opts the optional parameters
479
- # @return [Array<(Zones, Integer, Hash)>] Zones data, response status code and response headers
391
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
480
392
  def get_heart_rate_zones_with_http_info(user_id, transaction_id, exercise_id, opts = {})
481
393
  if @api_client.config.debugging
482
394
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.get_heart_rate_zones ...'
@@ -494,65 +406,52 @@ module PolarAccesslink
494
406
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling TrainingDataApi.get_heart_rate_zones"
495
407
  end
496
408
  # resource path
497
- local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'exercise-id' + '}', CGI.escape(exercise_id.to_s))
409
+ local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones'.sub('{' + 'user-id' + '}', user_id.to_s).sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'exercise-id' + '}', exercise_id.to_s)
498
410
 
499
411
  # query parameters
500
- query_params = opts[:query_params] || {}
412
+ query_params = {}
501
413
 
502
414
  # header parameters
503
- header_params = opts[:header_params] || {}
504
- # HTTP header 'Accept' (if needed)
505
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
415
+ header_params = {}
506
416
 
507
417
  # form parameters
508
- form_params = opts[:form_params] || {}
418
+ form_params = {}
509
419
 
510
420
  # http body (model)
511
- post_body = opts[:body]
512
-
513
- # return_type
514
- return_type = opts[:return_type] || 'Zones'
515
-
516
- # auth_names
517
- auth_names = opts[:auth_names] || ['OAuth2']
518
-
519
- new_options = opts.merge(
421
+ post_body = nil
422
+ auth_names = []
423
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
520
424
  :header_params => header_params,
521
425
  :query_params => query_params,
522
426
  :form_params => form_params,
523
427
  :body => post_body,
524
- :auth_names => auth_names,
525
- :return_type => return_type
526
- )
527
-
528
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
428
+ :auth_names => auth_names)
529
429
  if @api_client.config.debugging
530
430
  @api_client.config.logger.debug "API called: TrainingDataApi#get_heart_rate_zones\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
531
431
  end
532
432
  return data, status_code, headers
533
433
  end
534
-
535
434
  # Get samples
536
435
  # Retrieve sample data of given type
537
- # @param type_id [String] Sample type id
538
- # @param user_id [Integer] User identifier
539
- # @param transaction_id [Integer] Transaction identifier
540
- # @param exercise_id [Integer] Exercise identifier
436
+ # @param type_id Sample type id
437
+ # @param user_id User identifier
438
+ # @param transaction_id Transaction identifier
439
+ # @param exercise_id Exercise identifier
541
440
  # @param [Hash] opts the optional parameters
542
- # @return [Sample]
441
+ # @return [nil]
543
442
  def get_samples(type_id, user_id, transaction_id, exercise_id, opts = {})
544
- data, _status_code, _headers = get_samples_with_http_info(type_id, user_id, transaction_id, exercise_id, opts)
545
- data
443
+ get_samples_with_http_info(type_id, user_id, transaction_id, exercise_id, opts)
444
+ nil
546
445
  end
547
446
 
548
447
  # Get samples
549
448
  # Retrieve sample data of given type
550
- # @param type_id [String] Sample type id
551
- # @param user_id [Integer] User identifier
552
- # @param transaction_id [Integer] Transaction identifier
553
- # @param exercise_id [Integer] Exercise identifier
449
+ # @param type_id Sample type id
450
+ # @param user_id User identifier
451
+ # @param transaction_id Transaction identifier
452
+ # @param exercise_id Exercise identifier
554
453
  # @param [Hash] opts the optional parameters
555
- # @return [Array<(Sample, Integer, Hash)>] Sample data, response status code and response headers
454
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
556
455
  def get_samples_with_http_info(type_id, user_id, transaction_id, exercise_id, opts = {})
557
456
  if @api_client.config.debugging
558
457
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.get_samples ...'
@@ -561,11 +460,6 @@ module PolarAccesslink
561
460
  if @api_client.config.client_side_validation && type_id.nil?
562
461
  fail ArgumentError, "Missing the required parameter 'type_id' when calling TrainingDataApi.get_samples"
563
462
  end
564
- pattern = Regexp.new(/[0-9]+/)
565
- if @api_client.config.client_side_validation && type_id !~ pattern
566
- fail ArgumentError, "invalid value for 'type_id' when calling TrainingDataApi.get_samples, must conform to the pattern #{pattern}."
567
- end
568
-
569
463
  # verify the required parameter 'user_id' is set
570
464
  if @api_client.config.client_side_validation && user_id.nil?
571
465
  fail ArgumentError, "Missing the required parameter 'user_id' when calling TrainingDataApi.get_samples"
@@ -579,63 +473,50 @@ module PolarAccesslink
579
473
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling TrainingDataApi.get_samples"
580
474
  end
581
475
  # resource path
582
- local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id}'.sub('{' + 'type-id' + '}', CGI.escape(type_id.to_s)).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'exercise-id' + '}', CGI.escape(exercise_id.to_s))
476
+ local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id}'.sub('{' + 'type-id' + '}', type_id.to_s).sub('{' + 'user-id' + '}', user_id.to_s).sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'exercise-id' + '}', exercise_id.to_s)
583
477
 
584
478
  # query parameters
585
- query_params = opts[:query_params] || {}
479
+ query_params = {}
586
480
 
587
481
  # header parameters
588
- header_params = opts[:header_params] || {}
589
- # HTTP header 'Accept' (if needed)
590
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
482
+ header_params = {}
591
483
 
592
484
  # form parameters
593
- form_params = opts[:form_params] || {}
485
+ form_params = {}
594
486
 
595
487
  # http body (model)
596
- post_body = opts[:body]
597
-
598
- # return_type
599
- return_type = opts[:return_type] || 'Sample'
600
-
601
- # auth_names
602
- auth_names = opts[:auth_names] || ['OAuth2']
603
-
604
- new_options = opts.merge(
488
+ post_body = nil
489
+ auth_names = []
490
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
605
491
  :header_params => header_params,
606
492
  :query_params => query_params,
607
493
  :form_params => form_params,
608
494
  :body => post_body,
609
- :auth_names => auth_names,
610
- :return_type => return_type
611
- )
612
-
613
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
495
+ :auth_names => auth_names)
614
496
  if @api_client.config.debugging
615
497
  @api_client.config.logger.debug "API called: TrainingDataApi#get_samples\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
616
498
  end
617
499
  return data, status_code, headers
618
500
  end
619
-
620
501
  # Get TCX
621
502
  # Retrieve exercise in TCX format
622
- # @param user_id [Integer] User identifier
623
- # @param transaction_id [Integer] Transaction identifier
624
- # @param exercise_id [Integer] Exercise identifier
503
+ # @param user_id User identifier
504
+ # @param transaction_id Transaction identifier
505
+ # @param exercise_id Exercise identifier
625
506
  # @param [Hash] opts the optional parameters
626
- # @return [String]
507
+ # @return [nil]
627
508
  def get_tcx(user_id, transaction_id, exercise_id, opts = {})
628
- data, _status_code, _headers = get_tcx_with_http_info(user_id, transaction_id, exercise_id, opts)
629
- data
509
+ get_tcx_with_http_info(user_id, transaction_id, exercise_id, opts)
510
+ nil
630
511
  end
631
512
 
632
513
  # Get TCX
633
514
  # Retrieve exercise in TCX format
634
- # @param user_id [Integer] User identifier
635
- # @param transaction_id [Integer] Transaction identifier
636
- # @param exercise_id [Integer] Exercise identifier
515
+ # @param user_id User identifier
516
+ # @param transaction_id Transaction identifier
517
+ # @param exercise_id Exercise identifier
637
518
  # @param [Hash] opts the optional parameters
638
- # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
519
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
639
520
  def get_tcx_with_http_info(user_id, transaction_id, exercise_id, opts = {})
640
521
  if @api_client.config.debugging
641
522
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.get_tcx ...'
@@ -653,61 +534,48 @@ module PolarAccesslink
653
534
  fail ArgumentError, "Missing the required parameter 'exercise_id' when calling TrainingDataApi.get_tcx"
654
535
  end
655
536
  # resource path
656
- local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx'.sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'exercise-id' + '}', CGI.escape(exercise_id.to_s))
537
+ local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx'.sub('{' + 'user-id' + '}', user_id.to_s).sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'exercise-id' + '}', exercise_id.to_s)
657
538
 
658
539
  # query parameters
659
- query_params = opts[:query_params] || {}
540
+ query_params = {}
660
541
 
661
542
  # header parameters
662
- header_params = opts[:header_params] || {}
663
- # HTTP header 'Accept' (if needed)
664
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.garmin.tcx+xml'])
543
+ header_params = {}
665
544
 
666
545
  # form parameters
667
- form_params = opts[:form_params] || {}
546
+ form_params = {}
668
547
 
669
548
  # http body (model)
670
- post_body = opts[:body]
671
-
672
- # return_type
673
- return_type = opts[:return_type] || 'String'
674
-
675
- # auth_names
676
- auth_names = opts[:auth_names] || ['OAuth2']
677
-
678
- new_options = opts.merge(
549
+ post_body = nil
550
+ auth_names = []
551
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
679
552
  :header_params => header_params,
680
553
  :query_params => query_params,
681
554
  :form_params => form_params,
682
555
  :body => post_body,
683
- :auth_names => auth_names,
684
- :return_type => return_type
685
- )
686
-
687
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
556
+ :auth_names => auth_names)
688
557
  if @api_client.config.debugging
689
558
  @api_client.config.logger.debug "API called: TrainingDataApi#get_tcx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
690
559
  end
691
560
  return data, status_code, headers
692
561
  end
693
-
694
562
  # List exercises
695
563
  # After successfully initiating a transaction, training sessions included within it can be retrieved with the provided transactionId.
696
- # @param transaction_id [Integer] Transaction identifier
697
- # @param user_id [Integer] User identifier
564
+ # @param transaction_id Transaction identifier
565
+ # @param user_id User identifier
698
566
  # @param [Hash] opts the optional parameters
699
- # @return [Exercises]
567
+ # @return [nil]
700
568
  def list_exercises(transaction_id, user_id, opts = {})
701
- data, _status_code, _headers = list_exercises_with_http_info(transaction_id, user_id, opts)
702
- data
569
+ list_exercises_with_http_info(transaction_id, user_id, opts)
570
+ nil
703
571
  end
704
572
 
705
573
  # List exercises
706
574
  # After successfully initiating a transaction, training sessions included within it can be retrieved with the provided transactionId.
707
- # @param transaction_id [Integer] Transaction identifier
708
- # @param user_id [Integer] User identifier
575
+ # @param transaction_id Transaction identifier
576
+ # @param user_id User identifier
709
577
  # @param [Hash] opts the optional parameters
710
- # @return [Array<(Exercises, Integer, Hash)>] Exercises data, response status code and response headers
578
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
711
579
  def list_exercises_with_http_info(transaction_id, user_id, opts = {})
712
580
  if @api_client.config.debugging
713
581
  @api_client.config.logger.debug 'Calling API: TrainingDataApi.list_exercises ...'
@@ -716,53 +584,31 @@ module PolarAccesslink
716
584
  if @api_client.config.client_side_validation && transaction_id.nil?
717
585
  fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TrainingDataApi.list_exercises"
718
586
  end
719
- pattern = Regexp.new(/[0-9]+/)
720
- if @api_client.config.client_side_validation && transaction_id !~ pattern
721
- fail ArgumentError, "invalid value for 'transaction_id' when calling TrainingDataApi.list_exercises, must conform to the pattern #{pattern}."
722
- end
723
-
724
587
  # verify the required parameter 'user_id' is set
725
588
  if @api_client.config.client_side_validation && user_id.nil?
726
589
  fail ArgumentError, "Missing the required parameter 'user_id' when calling TrainingDataApi.list_exercises"
727
590
  end
728
- pattern = Regexp.new(/[0-9]+/)
729
- if @api_client.config.client_side_validation && user_id !~ pattern
730
- fail ArgumentError, "invalid value for 'user_id' when calling TrainingDataApi.list_exercises, must conform to the pattern #{pattern}."
731
- end
732
-
733
591
  # resource path
734
- local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', CGI.escape(transaction_id.to_s)).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s))
592
+ local_var_path = '/v3/users/{user-id}/exercise-transactions/{transaction-id}'.sub('{' + 'transaction-id' + '}', transaction_id.to_s).sub('{' + 'user-id' + '}', user_id.to_s)
735
593
 
736
594
  # query parameters
737
- query_params = opts[:query_params] || {}
595
+ query_params = {}
738
596
 
739
597
  # header parameters
740
- header_params = opts[:header_params] || {}
741
- # HTTP header 'Accept' (if needed)
742
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
598
+ header_params = {}
743
599
 
744
600
  # form parameters
745
- form_params = opts[:form_params] || {}
601
+ form_params = {}
746
602
 
747
603
  # http body (model)
748
- post_body = opts[:body]
749
-
750
- # return_type
751
- return_type = opts[:return_type] || 'Exercises'
752
-
753
- # auth_names
754
- auth_names = opts[:auth_names] || ['OAuth2']
755
-
756
- new_options = opts.merge(
604
+ post_body = nil
605
+ auth_names = []
606
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
757
607
  :header_params => header_params,
758
608
  :query_params => query_params,
759
609
  :form_params => form_params,
760
610
  :body => post_body,
761
- :auth_names => auth_names,
762
- :return_type => return_type
763
- )
764
-
765
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
611
+ :auth_names => auth_names)
766
612
  if @api_client.config.debugging
767
613
  @api_client.config.logger.debug "API called: TrainingDataApi#list_exercises\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
768
614
  end