stormgate_world 1.0.0

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 (137) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +141 -0
  4. data/Rakefile +10 -0
  5. data/docs/ErrorResponse.md +26 -0
  6. data/docs/Leaderboard.md +15 -0
  7. data/docs/LeaderboardDumpResponse.md +22 -0
  8. data/docs/LeaderboardEntriesApi.md +70 -0
  9. data/docs/LeaderboardEntryHistory.md +18 -0
  10. data/docs/LeaderboardEntryHistoryEntry.md +24 -0
  11. data/docs/LeaderboardEntryResponse.md +52 -0
  12. data/docs/LeaderboardOrder.md +15 -0
  13. data/docs/LeaderboardResponse.md +24 -0
  14. data/docs/LeaderboardsApi.md +140 -0
  15. data/docs/MatchParticipantPlayerLeaderboardEntryResponse.md +32 -0
  16. data/docs/MatchParticipantPlayerResponse.md +22 -0
  17. data/docs/MatchParticipantResponse.md +38 -0
  18. data/docs/MatchResponse.md +34 -0
  19. data/docs/MatchResult.md +15 -0
  20. data/docs/MatchState.md +15 -0
  21. data/docs/MatchesApi.md +76 -0
  22. data/docs/MatchesResponse.md +24 -0
  23. data/docs/PlayerActivityStats.md +24 -0
  24. data/docs/PlayerActivityStatsRace.md +20 -0
  25. data/docs/PlayerMatchesResponse.md +22 -0
  26. data/docs/PlayerMatchupsStats.md +20 -0
  27. data/docs/PlayerMatchupsStatsEntry.md +34 -0
  28. data/docs/PlayerMatchupsStatsMatchup.md +24 -0
  29. data/docs/PlayerOpponentsStats.md +22 -0
  30. data/docs/PlayerOpponentsStatsOpponent.md +34 -0
  31. data/docs/PlayerPreferences.md +18 -0
  32. data/docs/PlayerResponse.md +28 -0
  33. data/docs/PlayerStatsEntry.md +36 -0
  34. data/docs/PlayerStatsEntryAggregated.md +34 -0
  35. data/docs/PlayerStatsEntryNumBreakdown.md +24 -0
  36. data/docs/PlayersApi.md +531 -0
  37. data/docs/ProfilePrivacy.md +15 -0
  38. data/docs/Race.md +15 -0
  39. data/docs/StatisticsApi.md +72 -0
  40. data/docs/StatsByTime.md +30 -0
  41. data/docs/StatsByTimeEntry.md +22 -0
  42. data/docs/StatsByTimeHistoryPoint.md +34 -0
  43. data/docs/StatsByTimeMatchLength.md +20 -0
  44. data/docs/StatsByTimeMatchLengthEntry.md +28 -0
  45. data/git_push.sh +57 -0
  46. data/lib/stormgate_world/api/leaderboard_entries_api.rb +81 -0
  47. data/lib/stormgate_world/api/leaderboards_api.rb +151 -0
  48. data/lib/stormgate_world/api/matches_api.rb +92 -0
  49. data/lib/stormgate_world/api/players_api.rb +512 -0
  50. data/lib/stormgate_world/api/statistics_api.rb +78 -0
  51. data/lib/stormgate_world/api_client.rb +394 -0
  52. data/lib/stormgate_world/api_error.rb +58 -0
  53. data/lib/stormgate_world/configuration.rb +298 -0
  54. data/lib/stormgate_world/models/error_response.rb +289 -0
  55. data/lib/stormgate_world/models/leaderboard.rb +41 -0
  56. data/lib/stormgate_world/models/leaderboard_dump_response.rb +274 -0
  57. data/lib/stormgate_world/models/leaderboard_entry_history.rb +223 -0
  58. data/lib/stormgate_world/models/leaderboard_entry_history_entry.rb +257 -0
  59. data/lib/stormgate_world/models/leaderboard_entry_response.rb +461 -0
  60. data/lib/stormgate_world/models/leaderboard_order.rb +40 -0
  61. data/lib/stormgate_world/models/leaderboard_response.rb +328 -0
  62. data/lib/stormgate_world/models/match_participant_player_leaderboard_entry_response.rb +309 -0
  63. data/lib/stormgate_world/models/match_participant_player_response.rb +241 -0
  64. data/lib/stormgate_world/models/match_participant_response.rb +361 -0
  65. data/lib/stormgate_world/models/match_response.rb +355 -0
  66. data/lib/stormgate_world/models/match_result.rb +41 -0
  67. data/lib/stormgate_world/models/match_state.rb +40 -0
  68. data/lib/stormgate_world/models/matches_response.rb +328 -0
  69. data/lib/stormgate_world/models/player_activity_stats.rb +267 -0
  70. data/lib/stormgate_world/models/player_activity_stats_race.rb +233 -0
  71. data/lib/stormgate_world/models/player_matches_response.rb +293 -0
  72. data/lib/stormgate_world/models/player_matchups_stats.rb +239 -0
  73. data/lib/stormgate_world/models/player_matchups_stats_entry.rb +337 -0
  74. data/lib/stormgate_world/models/player_matchups_stats_matchup.rb +293 -0
  75. data/lib/stormgate_world/models/player_opponents_stats.rb +274 -0
  76. data/lib/stormgate_world/models/player_opponents_stats_opponent.rb +343 -0
  77. data/lib/stormgate_world/models/player_preferences.rb +237 -0
  78. data/lib/stormgate_world/models/player_response.rb +285 -0
  79. data/lib/stormgate_world/models/player_stats_entry.rb +369 -0
  80. data/lib/stormgate_world/models/player_stats_entry_aggregated.rb +343 -0
  81. data/lib/stormgate_world/models/player_stats_entry_num_breakdown.rb +245 -0
  82. data/lib/stormgate_world/models/profile_privacy.rb +40 -0
  83. data/lib/stormgate_world/models/race.rb +41 -0
  84. data/lib/stormgate_world/models/stats_by_time.rb +332 -0
  85. data/lib/stormgate_world/models/stats_by_time_entry.rb +277 -0
  86. data/lib/stormgate_world/models/stats_by_time_history_point.rb +303 -0
  87. data/lib/stormgate_world/models/stats_by_time_match_length.rb +239 -0
  88. data/lib/stormgate_world/models/stats_by_time_match_length_entry.rb +265 -0
  89. data/lib/stormgate_world/version.rb +15 -0
  90. data/lib/stormgate_world.rb +79 -0
  91. data/openapitools.json +7 -0
  92. data/pkg/stormgate_world_client-1.0.0.gem +0 -0
  93. data/spec/api/leaderboard_entries_api_spec.rb +45 -0
  94. data/spec/api/leaderboards_api_spec.rb +58 -0
  95. data/spec/api/matches_api_spec.rb +47 -0
  96. data/spec/api/players_api_spec.rb +117 -0
  97. data/spec/api/statistics_api_spec.rb +45 -0
  98. data/spec/models/error_response_spec.rb +60 -0
  99. data/spec/models/leaderboard_dump_response_spec.rb +48 -0
  100. data/spec/models/leaderboard_entry_history_entry_spec.rb +54 -0
  101. data/spec/models/leaderboard_entry_history_spec.rb +36 -0
  102. data/spec/models/leaderboard_entry_response_spec.rb +138 -0
  103. data/spec/models/leaderboard_order_spec.rb +30 -0
  104. data/spec/models/leaderboard_response_spec.rb +54 -0
  105. data/spec/models/leaderboard_spec.rb +30 -0
  106. data/spec/models/match_participant_player_leaderboard_entry_response_spec.rb +78 -0
  107. data/spec/models/match_participant_player_response_spec.rb +48 -0
  108. data/spec/models/match_participant_response_spec.rb +96 -0
  109. data/spec/models/match_response_spec.rb +84 -0
  110. data/spec/models/match_result_spec.rb +30 -0
  111. data/spec/models/match_state_spec.rb +30 -0
  112. data/spec/models/matches_response_spec.rb +54 -0
  113. data/spec/models/player_activity_stats_race_spec.rb +42 -0
  114. data/spec/models/player_activity_stats_spec.rb +54 -0
  115. data/spec/models/player_matches_response_spec.rb +48 -0
  116. data/spec/models/player_matchups_stats_entry_spec.rb +84 -0
  117. data/spec/models/player_matchups_stats_matchup_spec.rb +54 -0
  118. data/spec/models/player_matchups_stats_spec.rb +42 -0
  119. data/spec/models/player_opponents_stats_opponent_spec.rb +84 -0
  120. data/spec/models/player_opponents_stats_spec.rb +48 -0
  121. data/spec/models/player_preferences_spec.rb +36 -0
  122. data/spec/models/player_response_spec.rb +66 -0
  123. data/spec/models/player_stats_entry_aggregated_spec.rb +84 -0
  124. data/spec/models/player_stats_entry_num_breakdown_spec.rb +54 -0
  125. data/spec/models/player_stats_entry_spec.rb +90 -0
  126. data/spec/models/profile_privacy_spec.rb +30 -0
  127. data/spec/models/race_spec.rb +30 -0
  128. data/spec/models/stats_by_time_entry_spec.rb +48 -0
  129. data/spec/models/stats_by_time_history_point_spec.rb +84 -0
  130. data/spec/models/stats_by_time_match_length_entry_spec.rb +66 -0
  131. data/spec/models/stats_by_time_match_length_spec.rb +42 -0
  132. data/spec/models/stats_by_time_spec.rb +72 -0
  133. data/spec/spec_helper.rb +111 -0
  134. data/stormgate_world.gemspec +40 -0
  135. data/stormgate_world.json +1 -0
  136. data/update.sh +4 -0
  137. metadata +260 -0
@@ -0,0 +1,355 @@
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 MatchResponse
18
+ attr_accessor :cached_at
19
+
20
+ attr_accessor :match_id
21
+
22
+ attr_accessor :state
23
+
24
+ attr_accessor :leaderboard
25
+
26
+ attr_accessor :server
27
+
28
+ attr_accessor :players
29
+
30
+ attr_accessor :created_at
31
+
32
+ attr_accessor :ended_at
33
+
34
+ attr_accessor :duration
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'cached_at' => :'cached_at',
62
+ :'match_id' => :'match_id',
63
+ :'state' => :'state',
64
+ :'leaderboard' => :'leaderboard',
65
+ :'server' => :'server',
66
+ :'players' => :'players',
67
+ :'created_at' => :'created_at',
68
+ :'ended_at' => :'ended_at',
69
+ :'duration' => :'duration'
70
+ }
71
+ end
72
+
73
+ # Returns all the JSON keys this model knows about
74
+ def self.acceptable_attributes
75
+ attribute_map.values
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.openapi_types
80
+ {
81
+ :'cached_at' => :'Time',
82
+ :'match_id' => :'String',
83
+ :'state' => :'MatchState',
84
+ :'leaderboard' => :'Leaderboard',
85
+ :'server' => :'String',
86
+ :'players' => :'Array<MatchParticipantResponse>',
87
+ :'created_at' => :'Time',
88
+ :'ended_at' => :'Time',
89
+ :'duration' => :'Integer'
90
+ }
91
+ end
92
+
93
+ # List of attributes with nullable: true
94
+ def self.openapi_nullable
95
+ Set.new([
96
+ :'state',
97
+ :'ended_at',
98
+ :'duration'
99
+ ])
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, "The input argument (attributes) must be a hash in `StormgateWorld::MatchResponse` initialize method"
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h|
111
+ if (!self.class.attribute_map.key?(k.to_sym))
112
+ fail ArgumentError, "`#{k}` is not a valid attribute in `StormgateWorld::MatchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
113
+ end
114
+ h[k.to_sym] = v
115
+ }
116
+
117
+ if attributes.key?(:'cached_at')
118
+ self.cached_at = attributes[:'cached_at']
119
+ else
120
+ self.cached_at = nil
121
+ end
122
+
123
+ if attributes.key?(:'match_id')
124
+ self.match_id = attributes[:'match_id']
125
+ else
126
+ self.match_id = nil
127
+ end
128
+
129
+ if attributes.key?(:'state')
130
+ self.state = attributes[:'state']
131
+ end
132
+
133
+ if attributes.key?(:'leaderboard')
134
+ self.leaderboard = attributes[:'leaderboard']
135
+ else
136
+ self.leaderboard = nil
137
+ end
138
+
139
+ if attributes.key?(:'server')
140
+ self.server = attributes[:'server']
141
+ else
142
+ self.server = nil
143
+ end
144
+
145
+ if attributes.key?(:'players')
146
+ if (value = attributes[:'players']).is_a?(Array)
147
+ self.players = value
148
+ end
149
+ else
150
+ self.players = nil
151
+ end
152
+
153
+ if attributes.key?(:'created_at')
154
+ self.created_at = attributes[:'created_at']
155
+ else
156
+ self.created_at = nil
157
+ end
158
+
159
+ if attributes.key?(:'ended_at')
160
+ self.ended_at = attributes[:'ended_at']
161
+ end
162
+
163
+ if attributes.key?(:'duration')
164
+ self.duration = attributes[:'duration']
165
+ end
166
+ end
167
+
168
+ # Show invalid properties with the reasons. Usually used together with valid?
169
+ # @return Array for valid properties with the reasons
170
+ def list_invalid_properties
171
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
172
+ invalid_properties = Array.new
173
+ if @cached_at.nil?
174
+ invalid_properties.push('invalid value for "cached_at", cached_at cannot be nil.')
175
+ end
176
+
177
+ if @match_id.nil?
178
+ invalid_properties.push('invalid value for "match_id", match_id cannot be nil.')
179
+ end
180
+
181
+ if @leaderboard.nil?
182
+ invalid_properties.push('invalid value for "leaderboard", leaderboard cannot be nil.')
183
+ end
184
+
185
+ if @server.nil?
186
+ invalid_properties.push('invalid value for "server", server cannot be nil.')
187
+ end
188
+
189
+ if @players.nil?
190
+ invalid_properties.push('invalid value for "players", players cannot be nil.')
191
+ end
192
+
193
+ if @created_at.nil?
194
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
195
+ end
196
+
197
+ invalid_properties
198
+ end
199
+
200
+ # Check to see if the all the properties in the model are valid
201
+ # @return true if the model is valid
202
+ def valid?
203
+ warn '[DEPRECATED] the `valid?` method is obsolete'
204
+ return false if @cached_at.nil?
205
+ return false if @match_id.nil?
206
+ return false if @leaderboard.nil?
207
+ return false if @server.nil?
208
+ return false if @players.nil?
209
+ return false if @created_at.nil?
210
+ true
211
+ end
212
+
213
+ # Checks equality by comparing each attribute.
214
+ # @param [Object] Object to be compared
215
+ def ==(o)
216
+ return true if self.equal?(o)
217
+ self.class == o.class &&
218
+ cached_at == o.cached_at &&
219
+ match_id == o.match_id &&
220
+ state == o.state &&
221
+ leaderboard == o.leaderboard &&
222
+ server == o.server &&
223
+ players == o.players &&
224
+ created_at == o.created_at &&
225
+ ended_at == o.ended_at &&
226
+ duration == o.duration
227
+ end
228
+
229
+ # @see the `==` method
230
+ # @param [Object] Object to be compared
231
+ def eql?(o)
232
+ self == o
233
+ end
234
+
235
+ # Calculates hash code according to all attributes.
236
+ # @return [Integer] Hash code
237
+ def hash
238
+ [cached_at, match_id, state, leaderboard, server, players, created_at, ended_at, duration].hash
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def self.build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ attributes = attributes.transform_keys(&:to_sym)
247
+ transformed_hash = {}
248
+ openapi_types.each_pair do |key, type|
249
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = nil
251
+ elsif type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[attribute_map[key]].is_a?(Array)
255
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
256
+ end
257
+ elsif !attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
259
+ end
260
+ end
261
+ new(transformed_hash)
262
+ end
263
+
264
+ # Deserializes the data based on type
265
+ # @param string type Data type
266
+ # @param string value Value to be deserialized
267
+ # @return [Object] Deserialized data
268
+ def self._deserialize(type, value)
269
+ case type.to_sym
270
+ when :Time
271
+ Time.parse(value)
272
+ when :Date
273
+ Date.parse(value)
274
+ when :String
275
+ value.to_s
276
+ when :Integer
277
+ value.to_i
278
+ when :Float
279
+ value.to_f
280
+ when :Boolean
281
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
282
+ true
283
+ else
284
+ false
285
+ end
286
+ when :Object
287
+ # generic object (usually a Hash), return directly
288
+ value
289
+ when /\AArray<(?<inner_type>.+)>\z/
290
+ inner_type = Regexp.last_match[:inner_type]
291
+ value.map { |v| _deserialize(inner_type, v) }
292
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
293
+ k_type = Regexp.last_match[:k_type]
294
+ v_type = Regexp.last_match[:v_type]
295
+ {}.tap do |hash|
296
+ value.each do |k, v|
297
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
298
+ end
299
+ end
300
+ else # model
301
+ # models (e.g. Pet) or oneOf
302
+ klass = StormgateWorld.const_get(type)
303
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
304
+ end
305
+ end
306
+
307
+ # Returns the string representation of the object
308
+ # @return [String] String presentation of the object
309
+ def to_s
310
+ to_hash.to_s
311
+ end
312
+
313
+ # to_body is an alias to to_hash (backward compatibility)
314
+ # @return [Hash] Returns the object in the form of hash
315
+ def to_body
316
+ to_hash
317
+ end
318
+
319
+ # Returns the object in the form of hash
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_hash
322
+ hash = {}
323
+ self.class.attribute_map.each_pair do |attr, param|
324
+ value = self.send(attr)
325
+ if value.nil?
326
+ is_nullable = self.class.openapi_nullable.include?(attr)
327
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
328
+ end
329
+
330
+ hash[param] = _to_hash(value)
331
+ end
332
+ hash
333
+ end
334
+
335
+ # Outputs non-array value in the form of hash
336
+ # For object, use to_hash. Otherwise, just return the value
337
+ # @param [Object] value Any valid value
338
+ # @return [Hash] Returns the value in the form of hash
339
+ def _to_hash(value)
340
+ if value.is_a?(Array)
341
+ value.compact.map { |v| _to_hash(v) }
342
+ elsif value.is_a?(Hash)
343
+ {}.tap do |hash|
344
+ value.each { |k, v| hash[k] = _to_hash(v) }
345
+ end
346
+ elsif value.respond_to? :to_hash
347
+ value.to_hash
348
+ else
349
+ value
350
+ end
351
+ end
352
+
353
+ end
354
+
355
+ 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 MatchResult
18
+ WIN = "win".freeze
19
+ LOSS = "loss".freeze
20
+ UNDECIDED = "undecided".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [WIN, LOSS, UNDECIDED].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 MatchResult.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #MatchResult"
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,40 @@
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 MatchState
18
+ ONGOING = "ongoing".freeze
19
+ FINISHED = "finished".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [ONGOING, FINISHED].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if MatchState.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #MatchState"
38
+ end
39
+ end
40
+ end