trophy_api_client 1.0.32 → 1.0.35
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.
- checksums.yaml +4 -4
- data/lib/gemconfig.rb +1 -1
- data/lib/trophy_api_client/leaderboards/types/leaderboards_all_response_item.rb +8 -8
- data/lib/trophy_api_client/types/event_response.rb +8 -4
- data/lib/trophy_api_client/types/leaderboard_response.rb +8 -8
- data/lib/trophy_api_client/types/leaderboard_response_with_rankings.rb +8 -8
- data/lib/trophy_api_client/types/metric_event_leaderboard_response.rb +8 -8
- data/lib/trophy_api_client/types/streak_frequency.rb +0 -1
- data/lib/trophy_api_client/types/user_leaderboard_response.rb +8 -8
- data/lib/trophy_api_client/types/user_leaderboard_response_with_history.rb +8 -8
- data/lib/trophy_api_client/types/webhook_user_leaderboard_response.rb +8 -8
- data/lib/trophy_api_client/users/client.rb +18 -6
- data/lib/trophy_api_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7e733021198dea1940f317242551238106a113bbcacdc42842c1f0a1bac227a
|
|
4
|
+
data.tar.gz: b7c8c709ec771024cff3b54e77d4f1df7a8644a1b64e2be2c470256aee08d214
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: edb848789103d0159d69f8fe6b852e562bf408f47ae7724dce1984b5d03715f7fc0135975214c787425d13821ddc2dc047fe6a356a4879671af79cba9f721287
|
|
7
|
+
data.tar.gz: 0117550ff5bfc745e68c913d18304861ae75b460c62391cda21b08cb21cae56a141f87457e5dd91f04e9f846af4fe3fd7875bdf11e0c6bf1d26131a68e3f78ef
|
data/lib/gemconfig.rb
CHANGED
|
@@ -42,7 +42,7 @@ module TrophyApiClient
|
|
|
42
42
|
# leaderboards.
|
|
43
43
|
attr_reader :run_unit
|
|
44
44
|
# @return [Integer] The interval between repetitions, relative to the start date and repetition
|
|
45
|
-
# type.
|
|
45
|
+
# type. Null for one-time leaderboards.
|
|
46
46
|
attr_reader :run_interval
|
|
47
47
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
48
48
|
attr_reader :additional_properties
|
|
@@ -70,11 +70,11 @@ module TrophyApiClient
|
|
|
70
70
|
# @param run_unit [TrophyApiClient::LeaderboardResponseRunUnit] The repetition type for recurring leaderboards, or null for one-time
|
|
71
71
|
# leaderboards.
|
|
72
72
|
# @param run_interval [Integer] The interval between repetitions, relative to the start date and repetition
|
|
73
|
-
# type.
|
|
73
|
+
# type. Null for one-time leaderboards.
|
|
74
74
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
75
75
|
# @return [TrophyApiClient::Leaderboards::LeaderboardsAllResponseItem]
|
|
76
|
-
def initialize(status:, id:, name:, key:, rank_by:,
|
|
77
|
-
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
76
|
+
def initialize(status:, id:, name:, key:, rank_by:, start:, max_participants:, breakdown_attribute: OMIT, metric_key: OMIT,
|
|
77
|
+
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, description: OMIT, end_: OMIT, run_unit: OMIT, run_interval: OMIT, additional_properties: nil)
|
|
78
78
|
@status = status
|
|
79
79
|
@id = id
|
|
80
80
|
@name = name
|
|
@@ -85,12 +85,12 @@ module TrophyApiClient
|
|
|
85
85
|
@metric_name = metric_name if metric_name != OMIT
|
|
86
86
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
87
87
|
@points_system_name = points_system_name if points_system_name != OMIT
|
|
88
|
-
@description = description
|
|
88
|
+
@description = description if description != OMIT
|
|
89
89
|
@start = start
|
|
90
90
|
@end_ = end_ if end_ != OMIT
|
|
91
91
|
@max_participants = max_participants
|
|
92
92
|
@run_unit = run_unit if run_unit != OMIT
|
|
93
|
-
@run_interval = run_interval
|
|
93
|
+
@run_interval = run_interval if run_interval != OMIT
|
|
94
94
|
@additional_properties = additional_properties
|
|
95
95
|
@_field_set = {
|
|
96
96
|
"status": status,
|
|
@@ -182,12 +182,12 @@ module TrophyApiClient
|
|
|
182
182
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
183
183
|
obj.points_system_key&.is_a?(String) != false || raise("Passed value for field obj.points_system_key is not the expected type, validation failed.")
|
|
184
184
|
obj.points_system_name&.is_a?(String) != false || raise("Passed value for field obj.points_system_name is not the expected type, validation failed.")
|
|
185
|
-
obj.description
|
|
185
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
186
186
|
obj.start.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
187
187
|
obj.end_&.is_a?(String) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
|
188
188
|
obj.max_participants.is_a?(Integer) != false || raise("Passed value for field obj.max_participants is not the expected type, validation failed.")
|
|
189
189
|
obj.run_unit&.is_a?(TrophyApiClient::LeaderboardResponseRunUnit) != false || raise("Passed value for field obj.run_unit is not the expected type, validation failed.")
|
|
190
|
-
obj.run_interval
|
|
190
|
+
obj.run_interval&.is_a?(Integer) != false || raise("Passed value for field obj.run_interval is not the expected type, validation failed.")
|
|
191
191
|
end
|
|
192
192
|
end
|
|
193
193
|
end
|
|
@@ -17,9 +17,11 @@ module TrophyApiClient
|
|
|
17
17
|
attr_reader :achievements
|
|
18
18
|
# @return [TrophyApiClient::MetricEventStreakResponse] The user's current streak.
|
|
19
19
|
attr_reader :current_streak
|
|
20
|
-
# @return [Hash{String => TrophyApiClient::MetricEventPointsResponse}] A map of points systems by key.
|
|
20
|
+
# @return [Hash{String => TrophyApiClient::MetricEventPointsResponse}] A map of points systems by key. Only contains points systems that were affected
|
|
21
|
+
# by the event.
|
|
21
22
|
attr_reader :points
|
|
22
|
-
# @return [Hash{String => TrophyApiClient::MetricEventLeaderboardResponse}] A map of leaderboards by key.
|
|
23
|
+
# @return [Hash{String => TrophyApiClient::MetricEventLeaderboardResponse}] A map of leaderboards by key. Only contains leaderboards that were affected by
|
|
24
|
+
# the event.
|
|
23
25
|
attr_reader :leaderboards
|
|
24
26
|
# @return [String] The idempotency key used for the event, if one was provided.
|
|
25
27
|
attr_reader :idempotency_key
|
|
@@ -38,8 +40,10 @@ module TrophyApiClient
|
|
|
38
40
|
# @param total [Float] The user's new total progress against the metric.
|
|
39
41
|
# @param achievements [Array<TrophyApiClient::CompletedAchievementResponse>] Achievements completed as a result of this event.
|
|
40
42
|
# @param current_streak [TrophyApiClient::MetricEventStreakResponse] The user's current streak.
|
|
41
|
-
# @param points [Hash{String => TrophyApiClient::MetricEventPointsResponse}] A map of points systems by key.
|
|
42
|
-
#
|
|
43
|
+
# @param points [Hash{String => TrophyApiClient::MetricEventPointsResponse}] A map of points systems by key. Only contains points systems that were affected
|
|
44
|
+
# by the event.
|
|
45
|
+
# @param leaderboards [Hash{String => TrophyApiClient::MetricEventLeaderboardResponse}] A map of leaderboards by key. Only contains leaderboards that were affected by
|
|
46
|
+
# the event.
|
|
43
47
|
# @param idempotency_key [String] The idempotency key used for the event, if one was provided.
|
|
44
48
|
# @param idempotent_replayed [Boolean] Whether the event was replayed due to idempotency.
|
|
45
49
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
@@ -39,7 +39,7 @@ module TrophyApiClient
|
|
|
39
39
|
# leaderboards.
|
|
40
40
|
attr_reader :run_unit
|
|
41
41
|
# @return [Integer] The interval between repetitions, relative to the start date and repetition
|
|
42
|
-
# type.
|
|
42
|
+
# type. Null for one-time leaderboards.
|
|
43
43
|
attr_reader :run_interval
|
|
44
44
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
45
45
|
attr_reader :additional_properties
|
|
@@ -66,11 +66,11 @@ module TrophyApiClient
|
|
|
66
66
|
# @param run_unit [TrophyApiClient::LeaderboardResponseRunUnit] The repetition type for recurring leaderboards, or null for one-time
|
|
67
67
|
# leaderboards.
|
|
68
68
|
# @param run_interval [Integer] The interval between repetitions, relative to the start date and repetition
|
|
69
|
-
# type.
|
|
69
|
+
# type. Null for one-time leaderboards.
|
|
70
70
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
71
71
|
# @return [TrophyApiClient::LeaderboardResponse]
|
|
72
|
-
def initialize(id:, name:, key:, rank_by:,
|
|
73
|
-
points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
72
|
+
def initialize(id:, name:, key:, rank_by:, start:, max_participants:, breakdown_attribute: OMIT, metric_key: OMIT, metric_name: OMIT,
|
|
73
|
+
points_system_key: OMIT, points_system_name: OMIT, description: OMIT, end_: OMIT, run_unit: OMIT, run_interval: OMIT, additional_properties: nil)
|
|
74
74
|
@id = id
|
|
75
75
|
@name = name
|
|
76
76
|
@key = key
|
|
@@ -80,12 +80,12 @@ module TrophyApiClient
|
|
|
80
80
|
@metric_name = metric_name if metric_name != OMIT
|
|
81
81
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
82
82
|
@points_system_name = points_system_name if points_system_name != OMIT
|
|
83
|
-
@description = description
|
|
83
|
+
@description = description if description != OMIT
|
|
84
84
|
@start = start
|
|
85
85
|
@end_ = end_ if end_ != OMIT
|
|
86
86
|
@max_participants = max_participants
|
|
87
87
|
@run_unit = run_unit if run_unit != OMIT
|
|
88
|
-
@run_interval = run_interval
|
|
88
|
+
@run_interval = run_interval if run_interval != OMIT
|
|
89
89
|
@additional_properties = additional_properties
|
|
90
90
|
@_field_set = {
|
|
91
91
|
"id": id,
|
|
@@ -173,12 +173,12 @@ module TrophyApiClient
|
|
|
173
173
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
174
174
|
obj.points_system_key&.is_a?(String) != false || raise("Passed value for field obj.points_system_key is not the expected type, validation failed.")
|
|
175
175
|
obj.points_system_name&.is_a?(String) != false || raise("Passed value for field obj.points_system_name is not the expected type, validation failed.")
|
|
176
|
-
obj.description
|
|
176
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
177
177
|
obj.start.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
178
178
|
obj.end_&.is_a?(String) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
|
179
179
|
obj.max_participants.is_a?(Integer) != false || raise("Passed value for field obj.max_participants is not the expected type, validation failed.")
|
|
180
180
|
obj.run_unit&.is_a?(TrophyApiClient::LeaderboardResponseRunUnit) != false || raise("Passed value for field obj.run_unit is not the expected type, validation failed.")
|
|
181
|
-
obj.run_interval
|
|
181
|
+
obj.run_interval&.is_a?(Integer) != false || raise("Passed value for field obj.run_interval is not the expected type, validation failed.")
|
|
182
182
|
end
|
|
183
183
|
end
|
|
184
184
|
end
|
|
@@ -44,7 +44,7 @@ module TrophyApiClient
|
|
|
44
44
|
# leaderboards.
|
|
45
45
|
attr_reader :run_unit
|
|
46
46
|
# @return [Integer] The interval between repetitions, relative to the start date and repetition
|
|
47
|
-
# type.
|
|
47
|
+
# type. Null for one-time leaderboards.
|
|
48
48
|
attr_reader :run_interval
|
|
49
49
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
50
50
|
attr_reader :additional_properties
|
|
@@ -73,11 +73,11 @@ module TrophyApiClient
|
|
|
73
73
|
# @param run_unit [TrophyApiClient::LeaderboardResponseRunUnit] The repetition type for recurring leaderboards, or null for one-time
|
|
74
74
|
# leaderboards.
|
|
75
75
|
# @param run_interval [Integer] The interval between repetitions, relative to the start date and repetition
|
|
76
|
-
# type.
|
|
76
|
+
# type. Null for one-time leaderboards.
|
|
77
77
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
78
78
|
# @return [TrophyApiClient::LeaderboardResponseWithRankings]
|
|
79
|
-
def initialize(status:, rankings:, id:, name:, key:, rank_by:,
|
|
80
|
-
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
79
|
+
def initialize(status:, rankings:, id:, name:, key:, rank_by:, start:, max_participants:, breakdown_attribute: OMIT, metric_key: OMIT,
|
|
80
|
+
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, description: OMIT, end_: OMIT, run_unit: OMIT, run_interval: OMIT, additional_properties: nil)
|
|
81
81
|
@status = status
|
|
82
82
|
@rankings = rankings
|
|
83
83
|
@id = id
|
|
@@ -89,12 +89,12 @@ module TrophyApiClient
|
|
|
89
89
|
@metric_name = metric_name if metric_name != OMIT
|
|
90
90
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
91
91
|
@points_system_name = points_system_name if points_system_name != OMIT
|
|
92
|
-
@description = description
|
|
92
|
+
@description = description if description != OMIT
|
|
93
93
|
@start = start
|
|
94
94
|
@end_ = end_ if end_ != OMIT
|
|
95
95
|
@max_participants = max_participants
|
|
96
96
|
@run_unit = run_unit if run_unit != OMIT
|
|
97
|
-
@run_interval = run_interval
|
|
97
|
+
@run_interval = run_interval if run_interval != OMIT
|
|
98
98
|
@additional_properties = additional_properties
|
|
99
99
|
@_field_set = {
|
|
100
100
|
"status": status,
|
|
@@ -193,12 +193,12 @@ module TrophyApiClient
|
|
|
193
193
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
194
194
|
obj.points_system_key&.is_a?(String) != false || raise("Passed value for field obj.points_system_key is not the expected type, validation failed.")
|
|
195
195
|
obj.points_system_name&.is_a?(String) != false || raise("Passed value for field obj.points_system_name is not the expected type, validation failed.")
|
|
196
|
-
obj.description
|
|
196
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
197
197
|
obj.start.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
198
198
|
obj.end_&.is_a?(String) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
|
199
199
|
obj.max_participants.is_a?(Integer) != false || raise("Passed value for field obj.max_participants is not the expected type, validation failed.")
|
|
200
200
|
obj.run_unit&.is_a?(TrophyApiClient::LeaderboardResponseRunUnit) != false || raise("Passed value for field obj.run_unit is not the expected type, validation failed.")
|
|
201
|
-
obj.run_interval
|
|
201
|
+
obj.run_interval&.is_a?(Integer) != false || raise("Passed value for field obj.run_interval is not the expected type, validation failed.")
|
|
202
202
|
end
|
|
203
203
|
end
|
|
204
204
|
end
|
|
@@ -50,7 +50,7 @@ module TrophyApiClient
|
|
|
50
50
|
# leaderboards.
|
|
51
51
|
attr_reader :run_unit
|
|
52
52
|
# @return [Integer] The interval between repetitions, relative to the start date and repetition
|
|
53
|
-
# type.
|
|
53
|
+
# type. Null for one-time leaderboards.
|
|
54
54
|
attr_reader :run_interval
|
|
55
55
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
56
56
|
attr_reader :additional_properties
|
|
@@ -85,11 +85,11 @@ module TrophyApiClient
|
|
|
85
85
|
# @param run_unit [TrophyApiClient::LeaderboardResponseRunUnit] The repetition type for recurring leaderboards, or null for one-time
|
|
86
86
|
# leaderboards.
|
|
87
87
|
# @param run_interval [Integer] The interval between repetitions, relative to the start date and repetition
|
|
88
|
-
# type.
|
|
88
|
+
# type. Null for one-time leaderboards.
|
|
89
89
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
90
90
|
# @return [TrophyApiClient::MetricEventLeaderboardResponse]
|
|
91
|
-
def initialize(threshold:, id:, name:, key:, rank_by:,
|
|
92
|
-
|
|
91
|
+
def initialize(threshold:, id:, name:, key:, rank_by:, start:, max_participants:, end_: OMIT, rank: OMIT,
|
|
92
|
+
previous_rank: OMIT, breakdown_attribute_value: OMIT, breakdown_attribute: OMIT, metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, description: OMIT, run_unit: OMIT, run_interval: OMIT, additional_properties: nil)
|
|
93
93
|
@end_ = end_ if end_ != OMIT
|
|
94
94
|
@rank = rank if rank != OMIT
|
|
95
95
|
@previous_rank = previous_rank if previous_rank != OMIT
|
|
@@ -104,11 +104,11 @@ module TrophyApiClient
|
|
|
104
104
|
@metric_name = metric_name if metric_name != OMIT
|
|
105
105
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
106
106
|
@points_system_name = points_system_name if points_system_name != OMIT
|
|
107
|
-
@description = description
|
|
107
|
+
@description = description if description != OMIT
|
|
108
108
|
@start = start
|
|
109
109
|
@max_participants = max_participants
|
|
110
110
|
@run_unit = run_unit if run_unit != OMIT
|
|
111
|
-
@run_interval = run_interval
|
|
111
|
+
@run_interval = run_interval if run_interval != OMIT
|
|
112
112
|
@additional_properties = additional_properties
|
|
113
113
|
@_field_set = {
|
|
114
114
|
"end": end_,
|
|
@@ -213,11 +213,11 @@ module TrophyApiClient
|
|
|
213
213
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
214
214
|
obj.points_system_key&.is_a?(String) != false || raise("Passed value for field obj.points_system_key is not the expected type, validation failed.")
|
|
215
215
|
obj.points_system_name&.is_a?(String) != false || raise("Passed value for field obj.points_system_name is not the expected type, validation failed.")
|
|
216
|
-
obj.description
|
|
216
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
217
217
|
obj.start.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
218
218
|
obj.max_participants.is_a?(Integer) != false || raise("Passed value for field obj.max_participants is not the expected type, validation failed.")
|
|
219
219
|
obj.run_unit&.is_a?(TrophyApiClient::LeaderboardResponseRunUnit) != false || raise("Passed value for field obj.run_unit is not the expected type, validation failed.")
|
|
220
|
-
obj.run_interval
|
|
220
|
+
obj.run_interval&.is_a?(Integer) != false || raise("Passed value for field obj.run_interval is not the expected type, validation failed.")
|
|
221
221
|
end
|
|
222
222
|
end
|
|
223
223
|
end
|
|
@@ -45,7 +45,7 @@ module TrophyApiClient
|
|
|
45
45
|
# leaderboards.
|
|
46
46
|
attr_reader :run_unit
|
|
47
47
|
# @return [Integer] The interval between repetitions, relative to the start date and repetition
|
|
48
|
-
# type.
|
|
48
|
+
# type. Null for one-time leaderboards.
|
|
49
49
|
attr_reader :run_interval
|
|
50
50
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
51
51
|
attr_reader :additional_properties
|
|
@@ -76,11 +76,11 @@ module TrophyApiClient
|
|
|
76
76
|
# @param run_unit [TrophyApiClient::LeaderboardResponseRunUnit] The repetition type for recurring leaderboards, or null for one-time
|
|
77
77
|
# leaderboards.
|
|
78
78
|
# @param run_interval [Integer] The interval between repetitions, relative to the start date and repetition
|
|
79
|
-
# type.
|
|
79
|
+
# type. Null for one-time leaderboards.
|
|
80
80
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
81
81
|
# @return [TrophyApiClient::UserLeaderboardResponse]
|
|
82
|
-
def initialize(id:, name:, key:, rank_by:,
|
|
83
|
-
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
82
|
+
def initialize(id:, name:, key:, rank_by:, start:, max_participants:, rank: OMIT, value: OMIT, breakdown_attribute: OMIT, metric_key: OMIT,
|
|
83
|
+
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, description: OMIT, end_: OMIT, run_unit: OMIT, run_interval: OMIT, additional_properties: nil)
|
|
84
84
|
@rank = rank if rank != OMIT
|
|
85
85
|
@value = value if value != OMIT
|
|
86
86
|
@id = id
|
|
@@ -92,12 +92,12 @@ module TrophyApiClient
|
|
|
92
92
|
@metric_name = metric_name if metric_name != OMIT
|
|
93
93
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
94
94
|
@points_system_name = points_system_name if points_system_name != OMIT
|
|
95
|
-
@description = description
|
|
95
|
+
@description = description if description != OMIT
|
|
96
96
|
@start = start
|
|
97
97
|
@end_ = end_ if end_ != OMIT
|
|
98
98
|
@max_participants = max_participants
|
|
99
99
|
@run_unit = run_unit if run_unit != OMIT
|
|
100
|
-
@run_interval = run_interval
|
|
100
|
+
@run_interval = run_interval if run_interval != OMIT
|
|
101
101
|
@additional_properties = additional_properties
|
|
102
102
|
@_field_set = {
|
|
103
103
|
"rank": rank,
|
|
@@ -193,12 +193,12 @@ module TrophyApiClient
|
|
|
193
193
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
194
194
|
obj.points_system_key&.is_a?(String) != false || raise("Passed value for field obj.points_system_key is not the expected type, validation failed.")
|
|
195
195
|
obj.points_system_name&.is_a?(String) != false || raise("Passed value for field obj.points_system_name is not the expected type, validation failed.")
|
|
196
|
-
obj.description
|
|
196
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
197
197
|
obj.start.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
198
198
|
obj.end_&.is_a?(String) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
|
199
199
|
obj.max_participants.is_a?(Integer) != false || raise("Passed value for field obj.max_participants is not the expected type, validation failed.")
|
|
200
200
|
obj.run_unit&.is_a?(TrophyApiClient::LeaderboardResponseRunUnit) != false || raise("Passed value for field obj.run_unit is not the expected type, validation failed.")
|
|
201
|
-
obj.run_interval
|
|
201
|
+
obj.run_interval&.is_a?(Integer) != false || raise("Passed value for field obj.run_interval is not the expected type, validation failed.")
|
|
202
202
|
end
|
|
203
203
|
end
|
|
204
204
|
end
|
|
@@ -48,7 +48,7 @@ module TrophyApiClient
|
|
|
48
48
|
# leaderboards.
|
|
49
49
|
attr_reader :run_unit
|
|
50
50
|
# @return [Integer] The interval between repetitions, relative to the start date and repetition
|
|
51
|
-
# type.
|
|
51
|
+
# type. Null for one-time leaderboards.
|
|
52
52
|
attr_reader :run_interval
|
|
53
53
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
54
54
|
attr_reader :additional_properties
|
|
@@ -80,11 +80,11 @@ module TrophyApiClient
|
|
|
80
80
|
# @param run_unit [TrophyApiClient::LeaderboardResponseRunUnit] The repetition type for recurring leaderboards, or null for one-time
|
|
81
81
|
# leaderboards.
|
|
82
82
|
# @param run_interval [Integer] The interval between repetitions, relative to the start date and repetition
|
|
83
|
-
# type.
|
|
83
|
+
# type. Null for one-time leaderboards.
|
|
84
84
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
85
85
|
# @return [TrophyApiClient::UserLeaderboardResponseWithHistory]
|
|
86
|
-
def initialize(history:, id:, name:, key:, rank_by:,
|
|
87
|
-
metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
86
|
+
def initialize(history:, id:, name:, key:, rank_by:, start:, max_participants:, rank: OMIT, value: OMIT, breakdown_attribute: OMIT,
|
|
87
|
+
metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, description: OMIT, end_: OMIT, run_unit: OMIT, run_interval: OMIT, additional_properties: nil)
|
|
88
88
|
@history = history
|
|
89
89
|
@rank = rank if rank != OMIT
|
|
90
90
|
@value = value if value != OMIT
|
|
@@ -97,12 +97,12 @@ module TrophyApiClient
|
|
|
97
97
|
@metric_name = metric_name if metric_name != OMIT
|
|
98
98
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
99
99
|
@points_system_name = points_system_name if points_system_name != OMIT
|
|
100
|
-
@description = description
|
|
100
|
+
@description = description if description != OMIT
|
|
101
101
|
@start = start
|
|
102
102
|
@end_ = end_ if end_ != OMIT
|
|
103
103
|
@max_participants = max_participants
|
|
104
104
|
@run_unit = run_unit if run_unit != OMIT
|
|
105
|
-
@run_interval = run_interval
|
|
105
|
+
@run_interval = run_interval if run_interval != OMIT
|
|
106
106
|
@additional_properties = additional_properties
|
|
107
107
|
@_field_set = {
|
|
108
108
|
"history": history,
|
|
@@ -205,12 +205,12 @@ module TrophyApiClient
|
|
|
205
205
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
206
206
|
obj.points_system_key&.is_a?(String) != false || raise("Passed value for field obj.points_system_key is not the expected type, validation failed.")
|
|
207
207
|
obj.points_system_name&.is_a?(String) != false || raise("Passed value for field obj.points_system_name is not the expected type, validation failed.")
|
|
208
|
-
obj.description
|
|
208
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
209
209
|
obj.start.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
210
210
|
obj.end_&.is_a?(String) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
|
211
211
|
obj.max_participants.is_a?(Integer) != false || raise("Passed value for field obj.max_participants is not the expected type, validation failed.")
|
|
212
212
|
obj.run_unit&.is_a?(TrophyApiClient::LeaderboardResponseRunUnit) != false || raise("Passed value for field obj.run_unit is not the expected type, validation failed.")
|
|
213
|
-
obj.run_interval
|
|
213
|
+
obj.run_interval&.is_a?(Integer) != false || raise("Passed value for field obj.run_interval is not the expected type, validation failed.")
|
|
214
214
|
end
|
|
215
215
|
end
|
|
216
216
|
end
|
|
@@ -49,7 +49,7 @@ module TrophyApiClient
|
|
|
49
49
|
# leaderboards.
|
|
50
50
|
attr_reader :run_unit
|
|
51
51
|
# @return [Integer] The interval between repetitions, relative to the start date and repetition
|
|
52
|
-
# type.
|
|
52
|
+
# type. Null for one-time leaderboards.
|
|
53
53
|
attr_reader :run_interval
|
|
54
54
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
55
55
|
attr_reader :additional_properties
|
|
@@ -82,11 +82,11 @@ module TrophyApiClient
|
|
|
82
82
|
# @param run_unit [TrophyApiClient::LeaderboardResponseRunUnit] The repetition type for recurring leaderboards, or null for one-time
|
|
83
83
|
# leaderboards.
|
|
84
84
|
# @param run_interval [Integer] The interval between repetitions, relative to the start date and repetition
|
|
85
|
-
# type.
|
|
85
|
+
# type. Null for one-time leaderboards.
|
|
86
86
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
87
87
|
# @return [TrophyApiClient::WebhookUserLeaderboardResponse]
|
|
88
|
-
def initialize(id:, name:, key:, rank_by:,
|
|
89
|
-
breakdown_attribute: OMIT, metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
88
|
+
def initialize(id:, name:, key:, rank_by:, start:, max_participants:, previous_rank: OMIT, previous_value: OMIT, rank: OMIT, value: OMIT,
|
|
89
|
+
breakdown_attribute: OMIT, metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, description: OMIT, end_: OMIT, run_unit: OMIT, run_interval: OMIT, additional_properties: nil)
|
|
90
90
|
@previous_rank = previous_rank if previous_rank != OMIT
|
|
91
91
|
@previous_value = previous_value if previous_value != OMIT
|
|
92
92
|
@rank = rank if rank != OMIT
|
|
@@ -100,12 +100,12 @@ module TrophyApiClient
|
|
|
100
100
|
@metric_name = metric_name if metric_name != OMIT
|
|
101
101
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
102
102
|
@points_system_name = points_system_name if points_system_name != OMIT
|
|
103
|
-
@description = description
|
|
103
|
+
@description = description if description != OMIT
|
|
104
104
|
@start = start
|
|
105
105
|
@end_ = end_ if end_ != OMIT
|
|
106
106
|
@max_participants = max_participants
|
|
107
107
|
@run_unit = run_unit if run_unit != OMIT
|
|
108
|
-
@run_interval = run_interval
|
|
108
|
+
@run_interval = run_interval if run_interval != OMIT
|
|
109
109
|
@additional_properties = additional_properties
|
|
110
110
|
@_field_set = {
|
|
111
111
|
"previousRank": previous_rank,
|
|
@@ -209,12 +209,12 @@ module TrophyApiClient
|
|
|
209
209
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
210
210
|
obj.points_system_key&.is_a?(String) != false || raise("Passed value for field obj.points_system_key is not the expected type, validation failed.")
|
|
211
211
|
obj.points_system_name&.is_a?(String) != false || raise("Passed value for field obj.points_system_name is not the expected type, validation failed.")
|
|
212
|
-
obj.description
|
|
212
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
213
213
|
obj.start.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
214
214
|
obj.end_&.is_a?(String) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
|
215
215
|
obj.max_participants.is_a?(Integer) != false || raise("Passed value for field obj.max_participants is not the expected type, validation failed.")
|
|
216
216
|
obj.run_unit&.is_a?(TrophyApiClient::LeaderboardResponseRunUnit) != false || raise("Passed value for field obj.run_unit is not the expected type, validation failed.")
|
|
217
|
-
obj.run_interval
|
|
217
|
+
obj.run_interval&.is_a?(Integer) != false || raise("Passed value for field obj.run_interval is not the expected type, validation failed.")
|
|
218
218
|
end
|
|
219
219
|
end
|
|
220
220
|
end
|
|
@@ -464,6 +464,7 @@ module TrophyApiClient
|
|
|
464
464
|
# @param key [String] Unique key of the leaderboard as set when created.
|
|
465
465
|
# @param run [String] Specific run date in YYYY-MM-DD format. If not provided, returns the current
|
|
466
466
|
# run.
|
|
467
|
+
# @param num_events [Integer] The number of events to return in the history array.
|
|
467
468
|
# @param request_options [TrophyApiClient::RequestOptions]
|
|
468
469
|
# @return [TrophyApiClient::UserLeaderboardResponseWithHistory]
|
|
469
470
|
# @example
|
|
@@ -475,9 +476,10 @@ module TrophyApiClient
|
|
|
475
476
|
# api.users.leaderboard(
|
|
476
477
|
# id: "user-123",
|
|
477
478
|
# key: "weekly-words",
|
|
478
|
-
# run: "2025-01-15"
|
|
479
|
+
# run: "2025-01-15",
|
|
480
|
+
# num_events: 1
|
|
479
481
|
# )
|
|
480
|
-
def leaderboard(id:, key:, run: nil, request_options: nil)
|
|
482
|
+
def leaderboard(id:, key:, run: nil, num_events: nil, request_options: nil)
|
|
481
483
|
response = @request_client.conn.get do |req|
|
|
482
484
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
483
485
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
@@ -486,7 +488,11 @@ module TrophyApiClient
|
|
|
486
488
|
**@request_client.get_headers,
|
|
487
489
|
**(request_options&.additional_headers || {})
|
|
488
490
|
}.compact
|
|
489
|
-
req.params = {
|
|
491
|
+
req.params = {
|
|
492
|
+
**(request_options&.additional_query_parameters || {}),
|
|
493
|
+
"run": run,
|
|
494
|
+
"numEvents": num_events
|
|
495
|
+
}.compact
|
|
490
496
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
|
491
497
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
|
492
498
|
end
|
|
@@ -966,6 +972,7 @@ module TrophyApiClient
|
|
|
966
972
|
# @param key [String] Unique key of the leaderboard as set when created.
|
|
967
973
|
# @param run [String] Specific run date in YYYY-MM-DD format. If not provided, returns the current
|
|
968
974
|
# run.
|
|
975
|
+
# @param num_events [Integer] The number of events to return in the history array.
|
|
969
976
|
# @param request_options [TrophyApiClient::RequestOptions]
|
|
970
977
|
# @return [TrophyApiClient::UserLeaderboardResponseWithHistory]
|
|
971
978
|
# @example
|
|
@@ -977,9 +984,10 @@ module TrophyApiClient
|
|
|
977
984
|
# api.users.leaderboard(
|
|
978
985
|
# id: "user-123",
|
|
979
986
|
# key: "weekly-words",
|
|
980
|
-
# run: "2025-01-15"
|
|
987
|
+
# run: "2025-01-15",
|
|
988
|
+
# num_events: 1
|
|
981
989
|
# )
|
|
982
|
-
def leaderboard(id:, key:, run: nil, request_options: nil)
|
|
990
|
+
def leaderboard(id:, key:, run: nil, num_events: nil, request_options: nil)
|
|
983
991
|
Async do
|
|
984
992
|
response = @request_client.conn.get do |req|
|
|
985
993
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
@@ -989,7 +997,11 @@ module TrophyApiClient
|
|
|
989
997
|
**@request_client.get_headers,
|
|
990
998
|
**(request_options&.additional_headers || {})
|
|
991
999
|
}.compact
|
|
992
|
-
req.params = {
|
|
1000
|
+
req.params = {
|
|
1001
|
+
**(request_options&.additional_query_parameters || {}),
|
|
1002
|
+
"run": run,
|
|
1003
|
+
"numEvents": num_events
|
|
1004
|
+
}.compact
|
|
993
1005
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
|
994
1006
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
|
995
1007
|
end
|