stormgate_world 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +73 -0
  3. data/README.md +20 -5
  4. data/docs/ActivityStatistics.md +24 -0
  5. data/docs/ActivityStatisticsActivity.md +20 -0
  6. data/docs/ActivityStatisticsEntry.md +24 -0
  7. data/docs/Aggregation.md +15 -0
  8. data/docs/CountriesStatistics.md +24 -0
  9. data/docs/CountriesStatisticsEntry.md +22 -0
  10. data/docs/DumpFormat.md +15 -0
  11. data/docs/LeaderboardEntriesApi.md +10 -4
  12. data/docs/LeaderboardEntryHistory.md +7 -1
  13. data/docs/LeaderboardEntryHistoryRow.md +22 -0
  14. data/docs/LeaderboardEntryResponse.md +3 -1
  15. data/docs/LeaderboardsApi.md +10 -5
  16. data/docs/League.md +15 -0
  17. data/docs/MatchParticipantPlayerLeaderboardEntryResponse.md +1 -1
  18. data/docs/PlayerMatchesResponse.md +2 -0
  19. data/docs/PlayerResponse.md +5 -1
  20. data/docs/PlayersApi.md +14 -146
  21. data/docs/Resolution.md +15 -0
  22. data/docs/ServersStatistics.md +24 -0
  23. data/docs/ServersStatisticsEntry.md +22 -0
  24. data/docs/StatisticsApi.md +205 -2
  25. data/docs/StatsByTime.md +1 -1
  26. data/lib/stormgate_world/api/leaderboard_entries_api.rb +6 -0
  27. data/lib/stormgate_world/api/leaderboards_api.rb +3 -0
  28. data/lib/stormgate_world/api/players_api.rb +20 -129
  29. data/lib/stormgate_world/api/statistics_api.rb +186 -2
  30. data/lib/stormgate_world/models/activity_statistics.rb +269 -0
  31. data/lib/stormgate_world/models/activity_statistics_activity.rb +239 -0
  32. data/lib/stormgate_world/models/activity_statistics_entry.rb +263 -0
  33. data/lib/stormgate_world/models/aggregation.rb +41 -0
  34. data/lib/stormgate_world/models/countries_statistics.rb +271 -0
  35. data/lib/stormgate_world/models/countries_statistics_entry.rb +241 -0
  36. data/lib/stormgate_world/models/dump_format.rb +40 -0
  37. data/lib/stormgate_world/models/leaderboard_entry_history.rb +72 -2
  38. data/lib/stormgate_world/models/leaderboard_entry_history_row.rb +241 -0
  39. data/lib/stormgate_world/models/leaderboard_entry_response.rb +12 -2
  40. data/lib/stormgate_world/models/league.rb +45 -0
  41. data/lib/stormgate_world/models/match_participant_player_leaderboard_entry_response.rb +23 -1
  42. data/lib/stormgate_world/models/player_matches_response.rb +36 -1
  43. data/lib/stormgate_world/models/player_response.rb +25 -5
  44. data/lib/stormgate_world/models/race.rb +1 -2
  45. data/lib/stormgate_world/models/resolution.rb +42 -0
  46. data/lib/stormgate_world/models/servers_statistics.rb +271 -0
  47. data/lib/stormgate_world/models/servers_statistics_entry.rb +253 -0
  48. data/lib/stormgate_world/models/stats_by_time.rb +23 -1
  49. data/lib/stormgate_world/version.rb +1 -1
  50. data/lib/stormgate_world.rb +12 -2
  51. data/pkg/stormgate_world-1.0.0.gem +0 -0
  52. data/spec/models/activity_statistics_activity_spec.rb +42 -0
  53. data/spec/models/activity_statistics_entry_spec.rb +54 -0
  54. data/spec/models/activity_statistics_spec.rb +54 -0
  55. data/spec/models/aggregation_spec.rb +30 -0
  56. data/spec/models/countries_statistics_entry_spec.rb +48 -0
  57. data/spec/models/countries_statistics_spec.rb +54 -0
  58. data/spec/models/dump_format_spec.rb +30 -0
  59. data/spec/models/leaderboard_entry_history_row_spec.rb +48 -0
  60. data/spec/models/league_spec.rb +30 -0
  61. data/spec/models/resolution_spec.rb +30 -0
  62. data/spec/models/servers_statistics_entry_spec.rb +48 -0
  63. data/spec/models/servers_statistics_spec.rb +54 -0
  64. data/stormgate_world.json +1 -1
  65. metadata +52 -2
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #api
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module StormgateWorld
17
+ class ActivityStatisticsActivity
18
+ attr_accessor :aggregated
19
+
20
+ attr_accessor :history
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'aggregated' => :'aggregated',
26
+ :'history' => :'history'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'aggregated' => :'ActivityStatisticsEntry',
39
+ :'history' => :'Array<ActivityStatisticsEntry>'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `StormgateWorld::ActivityStatisticsActivity` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `StormgateWorld::ActivityStatisticsActivity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'aggregated')
65
+ self.aggregated = attributes[:'aggregated']
66
+ else
67
+ self.aggregated = nil
68
+ end
69
+
70
+ if attributes.key?(:'history')
71
+ if (value = attributes[:'history']).is_a?(Array)
72
+ self.history = value
73
+ end
74
+ else
75
+ self.history = nil
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ if @aggregated.nil?
85
+ invalid_properties.push('invalid value for "aggregated", aggregated cannot be nil.')
86
+ end
87
+
88
+ if @history.nil?
89
+ invalid_properties.push('invalid value for "history", history cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @aggregated.nil?
100
+ return false if @history.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ aggregated == o.aggregated &&
110
+ history == o.history
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [aggregated, history].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def self._deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = StormgateWorld.const_get(type)
187
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -0,0 +1,263 @@
1
+ =begin
2
+ #api
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module StormgateWorld
17
+ class ActivityStatisticsEntry
18
+ attr_accessor :date
19
+
20
+ attr_accessor :matches
21
+
22
+ attr_accessor :players
23
+
24
+ attr_accessor :match_length_average
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'date' => :'date',
30
+ :'matches' => :'matches',
31
+ :'players' => :'players',
32
+ :'match_length_average' => :'match_length_average'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'date' => :'Date',
45
+ :'matches' => :'Integer',
46
+ :'players' => :'Integer',
47
+ :'match_length_average' => :'Float'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ :'date',
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `StormgateWorld::ActivityStatisticsEntry` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `StormgateWorld::ActivityStatisticsEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'date')
74
+ self.date = attributes[:'date']
75
+ end
76
+
77
+ if attributes.key?(:'matches')
78
+ self.matches = attributes[:'matches']
79
+ else
80
+ self.matches = nil
81
+ end
82
+
83
+ if attributes.key?(:'players')
84
+ self.players = attributes[:'players']
85
+ else
86
+ self.players = nil
87
+ end
88
+
89
+ if attributes.key?(:'match_length_average')
90
+ self.match_length_average = attributes[:'match_length_average']
91
+ else
92
+ self.match_length_average = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @matches.nil?
102
+ invalid_properties.push('invalid value for "matches", matches cannot be nil.')
103
+ end
104
+
105
+ if @players.nil?
106
+ invalid_properties.push('invalid value for "players", players cannot be nil.')
107
+ end
108
+
109
+ if @match_length_average.nil?
110
+ invalid_properties.push('invalid value for "match_length_average", match_length_average cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @matches.nil?
121
+ return false if @players.nil?
122
+ return false if @match_length_average.nil?
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ date == o.date &&
132
+ matches == o.matches &&
133
+ players == o.players &&
134
+ match_length_average == o.match_length_average
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [date, matches, players, match_length_average].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def self._deserialize(type, value)
177
+ case type.to_sym
178
+ when :Time
179
+ Time.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ # models (e.g. Pet) or oneOf
210
+ klass = StormgateWorld.const_get(type)
211
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+
263
+ end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #api
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module StormgateWorld
17
+ class Aggregation
18
+ LAST = "last".freeze
19
+ MAX_MMR = "max_mmr".freeze
20
+ MAX_POINTS = "max_points".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [LAST, MAX_MMR, MAX_POINTS].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if Aggregation.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #Aggregation"
39
+ end
40
+ end
41
+ end