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
@@ -1,218 +0,0 @@
1
- =begin
2
- #Polar Accesslink API
3
-
4
- #Polar Accesslink API documentation
5
-
6
- The version of the OpenAPI document: 3.40.0
7
- Contact: b2bhelpdesk@polar.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.0
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PolarAccesslink
16
- # Model contains the time spent in certain activity zone.
17
- class DurationZone
18
- # Activity zone index
19
- attr_accessor :index
20
-
21
- # Time duration spent in the zone ISO 8601
22
- attr_accessor :inzone
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'index' => :'index',
28
- :'inzone' => :'inzone'
29
- }
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.openapi_types
34
- {
35
- :'index' => :'Integer',
36
- :'inzone' => :'String'
37
- }
38
- end
39
-
40
- # List of attributes with nullable: true
41
- def self.openapi_nullable
42
- Set.new([
43
- ])
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `PolarAccesslink::DurationZone` initialize method"
51
- end
52
-
53
- # check to see if the attribute exists and convert string to symbol for hash key
54
- attributes = attributes.each_with_object({}) { |(k, v), h|
55
- if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `PolarAccesslink::DurationZone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
- end
58
- h[k.to_sym] = v
59
- }
60
-
61
- if attributes.key?(:'index')
62
- self.index = attributes[:'index']
63
- end
64
-
65
- if attributes.key?(:'inzone')
66
- self.inzone = attributes[:'inzone']
67
- end
68
- end
69
-
70
- # Show invalid properties with the reasons. Usually used together with valid?
71
- # @return Array for valid properties with the reasons
72
- def list_invalid_properties
73
- invalid_properties = Array.new
74
- invalid_properties
75
- end
76
-
77
- # Check to see if the all the properties in the model are valid
78
- # @return true if the model is valid
79
- def valid?
80
- true
81
- end
82
-
83
- # Checks equality by comparing each attribute.
84
- # @param [Object] Object to be compared
85
- def ==(o)
86
- return true if self.equal?(o)
87
- self.class == o.class &&
88
- index == o.index &&
89
- inzone == o.inzone
90
- end
91
-
92
- # @see the `==` method
93
- # @param [Object] Object to be compared
94
- def eql?(o)
95
- self == o
96
- end
97
-
98
- # Calculates hash code according to all attributes.
99
- # @return [Integer] Hash code
100
- def hash
101
- [index, inzone].hash
102
- end
103
-
104
- # Builds the object from hash
105
- # @param [Hash] attributes Model attributes in the form of hash
106
- # @return [Object] Returns the model itself
107
- def self.build_from_hash(attributes)
108
- new.build_from_hash(attributes)
109
- end
110
-
111
- # Builds the object from hash
112
- # @param [Hash] attributes Model attributes in the form of hash
113
- # @return [Object] Returns the model itself
114
- def build_from_hash(attributes)
115
- return nil unless attributes.is_a?(Hash)
116
- self.class.openapi_types.each_pair do |key, type|
117
- if type =~ /\AArray<(.*)>/i
118
- # check to ensure the input is an array given that the attribute
119
- # is documented as an array but the input is not
120
- if attributes[self.class.attribute_map[key]].is_a?(Array)
121
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
- end
123
- elsif !attributes[self.class.attribute_map[key]].nil?
124
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
- end # or else data not found in attributes(hash), not an issue as the data can be optional
126
- end
127
-
128
- self
129
- end
130
-
131
- # Deserializes the data based on type
132
- # @param string type Data type
133
- # @param string value Value to be deserialized
134
- # @return [Object] Deserialized data
135
- def _deserialize(type, value)
136
- case type.to_sym
137
- when :DateTime
138
- DateTime.parse(value)
139
- when :Date
140
- Date.parse(value)
141
- when :String
142
- value.to_s
143
- when :Integer
144
- value.to_i
145
- when :Float
146
- value.to_f
147
- when :Boolean
148
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
- true
150
- else
151
- false
152
- end
153
- when :Object
154
- # generic object (usually a Hash), return directly
155
- value
156
- when /\AArray<(?<inner_type>.+)>\z/
157
- inner_type = Regexp.last_match[:inner_type]
158
- value.map { |v| _deserialize(inner_type, v) }
159
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
- k_type = Regexp.last_match[:k_type]
161
- v_type = Regexp.last_match[:v_type]
162
- {}.tap do |hash|
163
- value.each do |k, v|
164
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
- end
166
- end
167
- else # model
168
- PolarAccesslink.const_get(type).build_from_hash(value)
169
- end
170
- end
171
-
172
- # Returns the string representation of the object
173
- # @return [String] String presentation of the object
174
- def to_s
175
- to_hash.to_s
176
- end
177
-
178
- # to_body is an alias to to_hash (backward compatibility)
179
- # @return [Hash] Returns the object in the form of hash
180
- def to_body
181
- to_hash
182
- end
183
-
184
- # Returns the object in the form of hash
185
- # @return [Hash] Returns the object in the form of hash
186
- def to_hash
187
- hash = {}
188
- self.class.attribute_map.each_pair do |attr, param|
189
- value = self.send(attr)
190
- if value.nil?
191
- is_nullable = self.class.openapi_nullable.include?(attr)
192
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
- end
194
-
195
- hash[param] = _to_hash(value)
196
- end
197
- hash
198
- end
199
-
200
- # Outputs non-array value in the form of hash
201
- # For object, use to_hash. Otherwise, just return the value
202
- # @param [Object] value Any valid value
203
- # @return [Hash] Returns the value in the form of hash
204
- def _to_hash(value)
205
- if value.is_a?(Array)
206
- value.compact.map { |v| _to_hash(v) }
207
- elsif value.is_a?(Hash)
208
- {}.tap do |hash|
209
- value.each { |k, v| hash[k] = _to_hash(v) }
210
- end
211
- elsif value.respond_to? :to_hash
212
- value.to_hash
213
- else
214
- value
215
- end
216
- end
217
- end
218
- end
@@ -1,248 +0,0 @@
1
- =begin
2
- #Polar Accesslink API
3
-
4
- #Polar Accesslink API documentation
5
-
6
- The version of the OpenAPI document: 3.40.0
7
- Contact: b2bhelpdesk@polar.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.0
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PolarAccesslink
16
- # Error model which contains useful info about the error occured.
17
- class Error
18
- # Timestamp of the error.
19
- attr_accessor :timestamp
20
-
21
- # Http status code
22
- attr_accessor :status
23
-
24
- # Error type.
25
- attr_accessor :error_type
26
-
27
- # Human readable error message.
28
- attr_accessor :message
29
-
30
- # Correlation id of the response for problem solving and debugging use.
31
- attr_accessor :corr_id
32
-
33
- # Attribute mapping from ruby-style variable name to JSON key.
34
- def self.attribute_map
35
- {
36
- :'timestamp' => :'timestamp',
37
- :'status' => :'status',
38
- :'error_type' => :'errorType',
39
- :'message' => :'message',
40
- :'corr_id' => :'corrId'
41
- }
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.openapi_types
46
- {
47
- :'timestamp' => :'Timestamp',
48
- :'status' => :'Integer',
49
- :'error_type' => :'String',
50
- :'message' => :'String',
51
- :'corr_id' => :'String'
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new([
58
- ])
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `PolarAccesslink::Error` initialize method"
66
- end
67
-
68
- # check to see if the attribute exists and convert string to symbol for hash key
69
- attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `PolarAccesslink::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
- end
73
- h[k.to_sym] = v
74
- }
75
-
76
- if attributes.key?(:'timestamp')
77
- self.timestamp = attributes[:'timestamp']
78
- end
79
-
80
- if attributes.key?(:'status')
81
- self.status = attributes[:'status']
82
- end
83
-
84
- if attributes.key?(:'error_type')
85
- self.error_type = attributes[:'error_type']
86
- end
87
-
88
- if attributes.key?(:'message')
89
- self.message = attributes[:'message']
90
- end
91
-
92
- if attributes.key?(:'corr_id')
93
- self.corr_id = attributes[:'corr_id']
94
- end
95
- end
96
-
97
- # Show invalid properties with the reasons. Usually used together with valid?
98
- # @return Array for valid properties with the reasons
99
- def list_invalid_properties
100
- invalid_properties = Array.new
101
- invalid_properties
102
- end
103
-
104
- # Check to see if the all the properties in the model are valid
105
- # @return true if the model is valid
106
- def valid?
107
- true
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- timestamp == o.timestamp &&
116
- status == o.status &&
117
- error_type == o.error_type &&
118
- message == o.message &&
119
- corr_id == o.corr_id
120
- end
121
-
122
- # @see the `==` method
123
- # @param [Object] Object to be compared
124
- def eql?(o)
125
- self == o
126
- end
127
-
128
- # Calculates hash code according to all attributes.
129
- # @return [Integer] Hash code
130
- def hash
131
- [timestamp, status, error_type, message, corr_id].hash
132
- end
133
-
134
- # Builds the object from hash
135
- # @param [Hash] attributes Model attributes in the form of hash
136
- # @return [Object] Returns the model itself
137
- def self.build_from_hash(attributes)
138
- new.build_from_hash(attributes)
139
- end
140
-
141
- # Builds the object from hash
142
- # @param [Hash] attributes Model attributes in the form of hash
143
- # @return [Object] Returns the model itself
144
- def build_from_hash(attributes)
145
- return nil unless attributes.is_a?(Hash)
146
- self.class.openapi_types.each_pair do |key, type|
147
- if type =~ /\AArray<(.*)>/i
148
- # check to ensure the input is an array given that the attribute
149
- # is documented as an array but the input is not
150
- if attributes[self.class.attribute_map[key]].is_a?(Array)
151
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
- end
153
- elsif !attributes[self.class.attribute_map[key]].nil?
154
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
- end # or else data not found in attributes(hash), not an issue as the data can be optional
156
- end
157
-
158
- self
159
- end
160
-
161
- # Deserializes the data based on type
162
- # @param string type Data type
163
- # @param string value Value to be deserialized
164
- # @return [Object] Deserialized data
165
- def _deserialize(type, value)
166
- case type.to_sym
167
- when :DateTime
168
- DateTime.parse(value)
169
- when :Date
170
- Date.parse(value)
171
- when :String
172
- value.to_s
173
- when :Integer
174
- value.to_i
175
- when :Float
176
- value.to_f
177
- when :Boolean
178
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
- true
180
- else
181
- false
182
- end
183
- when :Object
184
- # generic object (usually a Hash), return directly
185
- value
186
- when /\AArray<(?<inner_type>.+)>\z/
187
- inner_type = Regexp.last_match[:inner_type]
188
- value.map { |v| _deserialize(inner_type, v) }
189
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
- k_type = Regexp.last_match[:k_type]
191
- v_type = Regexp.last_match[:v_type]
192
- {}.tap do |hash|
193
- value.each do |k, v|
194
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
- end
196
- end
197
- else # model
198
- PolarAccesslink.const_get(type).build_from_hash(value)
199
- end
200
- end
201
-
202
- # Returns the string representation of the object
203
- # @return [String] String presentation of the object
204
- def to_s
205
- to_hash.to_s
206
- end
207
-
208
- # to_body is an alias to to_hash (backward compatibility)
209
- # @return [Hash] Returns the object in the form of hash
210
- def to_body
211
- to_hash
212
- end
213
-
214
- # Returns the object in the form of hash
215
- # @return [Hash] Returns the object in the form of hash
216
- def to_hash
217
- hash = {}
218
- self.class.attribute_map.each_pair do |attr, param|
219
- value = self.send(attr)
220
- if value.nil?
221
- is_nullable = self.class.openapi_nullable.include?(attr)
222
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
- end
224
-
225
- hash[param] = _to_hash(value)
226
- end
227
- hash
228
- end
229
-
230
- # Outputs non-array value in the form of hash
231
- # For object, use to_hash. Otherwise, just return the value
232
- # @param [Object] value Any valid value
233
- # @return [Hash] Returns the value in the form of hash
234
- def _to_hash(value)
235
- if value.is_a?(Array)
236
- value.compact.map { |v| _to_hash(v) }
237
- elsif value.is_a?(Hash)
238
- {}.tap do |hash|
239
- value.each { |k, v| hash[k] = _to_hash(v) }
240
- end
241
- elsif value.respond_to? :to_hash
242
- value.to_hash
243
- else
244
- value
245
- end
246
- end
247
- end
248
- end