trophy_api_client 1.0.30 → 1.0.31
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/achievements/client.rb +18 -10
- data/lib/trophy_api_client/leaderboards/client.rb +16 -6
- data/lib/trophy_api_client/leaderboards/types/leaderboards_all_response_item.rb +10 -2
- data/lib/trophy_api_client/points/client.rb +4 -4
- data/lib/trophy_api_client/types/leaderboard_response.rb +10 -2
- data/lib/trophy_api_client/types/leaderboard_response_with_rankings.rb +10 -2
- data/lib/trophy_api_client/types/metric_event_leaderboard_response.rb +20 -2
- data/lib/trophy_api_client/types/user_leaderboard_response.rb +10 -2
- data/lib/trophy_api_client/types/user_leaderboard_response_with_history.rb +10 -2
- data/lib/trophy_api_client/types/webhook_user_leaderboard_response.rb +9 -1
- 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: ae06f4ad10f6292d25008af408ba0947190adfdda8bf9a243333e21b3d1b2bd8
|
|
4
|
+
data.tar.gz: c54d6136018d217c6236c43f9683d362903060538d5429e5a35266d2a7e0983c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 255581f34cedb5460cbed75b5c8a946150f5e2c768c445fd01a532d0f4dc3986d3bf0318eb2580a1126229e1a88c0f1a53291708011e57623700c2aee1cf28dd
|
|
7
|
+
data.tar.gz: eedad3138a96ca0f72d3e661c03db489db53cde53cc9a8dc652600db1c9964ebdab6553daf089b791c54183d40bcf4db255db38d26f4819fdd67555dea592c28
|
data/lib/gemconfig.rb
CHANGED
|
@@ -20,6 +20,9 @@ module TrophyApiClient
|
|
|
20
20
|
|
|
21
21
|
# Get all achievements and their completion stats.
|
|
22
22
|
#
|
|
23
|
+
# @param user_attributes [String] Optional colon-delimited user attributes in the format
|
|
24
|
+
# attribute:value,attribute:value. Only achievements accessible to a user with the
|
|
25
|
+
# provided attributes will be returned.
|
|
23
26
|
# @param request_options [TrophyApiClient::RequestOptions]
|
|
24
27
|
# @return [Array<TrophyApiClient::AchievementWithStatsResponse>]
|
|
25
28
|
# @example
|
|
@@ -28,8 +31,8 @@ module TrophyApiClient
|
|
|
28
31
|
# environment: TrophyApiClient::Environment::PRODUCTION,
|
|
29
32
|
# api_key: "YOUR_API_KEY"
|
|
30
33
|
# )
|
|
31
|
-
# api.achievements.all
|
|
32
|
-
def all(request_options: nil)
|
|
34
|
+
# api.achievements.all(user_attributes: "plan-type:premium,region:us-east")
|
|
35
|
+
def all(user_attributes: nil, request_options: nil)
|
|
33
36
|
response = @request_client.conn.get do |req|
|
|
34
37
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
35
38
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
@@ -38,9 +41,10 @@ module TrophyApiClient
|
|
|
38
41
|
**@request_client.get_headers,
|
|
39
42
|
**(request_options&.additional_headers || {})
|
|
40
43
|
}.compact
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
req.params = {
|
|
45
|
+
**(request_options&.additional_query_parameters || {}),
|
|
46
|
+
"userAttributes": user_attributes
|
|
47
|
+
}.compact
|
|
44
48
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
|
45
49
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
|
46
50
|
end
|
|
@@ -105,6 +109,9 @@ module TrophyApiClient
|
|
|
105
109
|
|
|
106
110
|
# Get all achievements and their completion stats.
|
|
107
111
|
#
|
|
112
|
+
# @param user_attributes [String] Optional colon-delimited user attributes in the format
|
|
113
|
+
# attribute:value,attribute:value. Only achievements accessible to a user with the
|
|
114
|
+
# provided attributes will be returned.
|
|
108
115
|
# @param request_options [TrophyApiClient::RequestOptions]
|
|
109
116
|
# @return [Array<TrophyApiClient::AchievementWithStatsResponse>]
|
|
110
117
|
# @example
|
|
@@ -113,8 +120,8 @@ module TrophyApiClient
|
|
|
113
120
|
# environment: TrophyApiClient::Environment::PRODUCTION,
|
|
114
121
|
# api_key: "YOUR_API_KEY"
|
|
115
122
|
# )
|
|
116
|
-
# api.achievements.all
|
|
117
|
-
def all(request_options: nil)
|
|
123
|
+
# api.achievements.all(user_attributes: "plan-type:premium,region:us-east")
|
|
124
|
+
def all(user_attributes: nil, request_options: nil)
|
|
118
125
|
Async do
|
|
119
126
|
response = @request_client.conn.get do |req|
|
|
120
127
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
@@ -124,9 +131,10 @@ module TrophyApiClient
|
|
|
124
131
|
**@request_client.get_headers,
|
|
125
132
|
**(request_options&.additional_headers || {})
|
|
126
133
|
}.compact
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
req.params = {
|
|
135
|
+
**(request_options&.additional_query_parameters || {}),
|
|
136
|
+
"userAttributes": user_attributes
|
|
137
|
+
}.compact
|
|
130
138
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
|
131
139
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
|
132
140
|
end
|
|
@@ -61,6 +61,9 @@ module TrophyApiClient
|
|
|
61
61
|
# run.
|
|
62
62
|
# @param user_id [String] When provided, offset is relative to this user's position on the leaderboard. If
|
|
63
63
|
# the user is not found in the leaderboard, returns empty rankings array.
|
|
64
|
+
# @param user_attributes [String] Attribute key and value to filter the rankings by, separated by a colon. This
|
|
65
|
+
# parameter is required, and only valid for leaderboards with a breakdown
|
|
66
|
+
# attribute.
|
|
64
67
|
# @param request_options [TrophyApiClient::RequestOptions]
|
|
65
68
|
# @return [TrophyApiClient::LeaderboardResponseWithRankings]
|
|
66
69
|
# @example
|
|
@@ -74,9 +77,10 @@ module TrophyApiClient
|
|
|
74
77
|
# offset: 1,
|
|
75
78
|
# limit: 1,
|
|
76
79
|
# run: "2025-01-15",
|
|
77
|
-
# user_id: "user-123"
|
|
80
|
+
# user_id: "user-123",
|
|
81
|
+
# user_attributes: "city:London"
|
|
78
82
|
# )
|
|
79
|
-
def get(key:, offset: nil, limit: nil, run: nil, user_id: nil, request_options: nil)
|
|
83
|
+
def get(key:, offset: nil, limit: nil, run: nil, user_id: nil, user_attributes: nil, request_options: nil)
|
|
80
84
|
response = @request_client.conn.get do |req|
|
|
81
85
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
82
86
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
@@ -90,7 +94,8 @@ module TrophyApiClient
|
|
|
90
94
|
"offset": offset,
|
|
91
95
|
"limit": limit,
|
|
92
96
|
"run": run,
|
|
93
|
-
"userId": user_id
|
|
97
|
+
"userId": user_id,
|
|
98
|
+
"userAttributes": user_attributes
|
|
94
99
|
}.compact
|
|
95
100
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
|
96
101
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
|
@@ -157,6 +162,9 @@ module TrophyApiClient
|
|
|
157
162
|
# run.
|
|
158
163
|
# @param user_id [String] When provided, offset is relative to this user's position on the leaderboard. If
|
|
159
164
|
# the user is not found in the leaderboard, returns empty rankings array.
|
|
165
|
+
# @param user_attributes [String] Attribute key and value to filter the rankings by, separated by a colon. This
|
|
166
|
+
# parameter is required, and only valid for leaderboards with a breakdown
|
|
167
|
+
# attribute.
|
|
160
168
|
# @param request_options [TrophyApiClient::RequestOptions]
|
|
161
169
|
# @return [TrophyApiClient::LeaderboardResponseWithRankings]
|
|
162
170
|
# @example
|
|
@@ -170,9 +178,10 @@ module TrophyApiClient
|
|
|
170
178
|
# offset: 1,
|
|
171
179
|
# limit: 1,
|
|
172
180
|
# run: "2025-01-15",
|
|
173
|
-
# user_id: "user-123"
|
|
181
|
+
# user_id: "user-123",
|
|
182
|
+
# user_attributes: "city:London"
|
|
174
183
|
# )
|
|
175
|
-
def get(key:, offset: nil, limit: nil, run: nil, user_id: nil, request_options: nil)
|
|
184
|
+
def get(key:, offset: nil, limit: nil, run: nil, user_id: nil, user_attributes: nil, request_options: nil)
|
|
176
185
|
Async do
|
|
177
186
|
response = @request_client.conn.get do |req|
|
|
178
187
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
@@ -187,7 +196,8 @@ module TrophyApiClient
|
|
|
187
196
|
"offset": offset,
|
|
188
197
|
"limit": limit,
|
|
189
198
|
"run": run,
|
|
190
|
-
"userId": user_id
|
|
199
|
+
"userId": user_id,
|
|
200
|
+
"userAttributes": user_attributes
|
|
191
201
|
}.compact
|
|
192
202
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
|
193
203
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
|
@@ -19,6 +19,8 @@ module TrophyApiClient
|
|
|
19
19
|
attr_reader :key
|
|
20
20
|
# @return [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
21
21
|
attr_reader :rank_by
|
|
22
|
+
# @return [String] The key of the attribute to break down this leaderboard by.
|
|
23
|
+
attr_reader :breakdown_attribute
|
|
22
24
|
# @return [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
23
25
|
attr_reader :metric_key
|
|
24
26
|
# @return [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
@@ -55,6 +57,7 @@ module TrophyApiClient
|
|
|
55
57
|
# @param name [String] The user-facing name of the leaderboard.
|
|
56
58
|
# @param key [String] The unique key used to reference the leaderboard in APIs.
|
|
57
59
|
# @param rank_by [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
60
|
+
# @param breakdown_attribute [String] The key of the attribute to break down this leaderboard by.
|
|
58
61
|
# @param metric_key [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
59
62
|
# @param metric_name [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
60
63
|
# @param points_system_key [String] The key of the points system to rank by, if rankBy is 'points'.
|
|
@@ -70,13 +73,14 @@ module TrophyApiClient
|
|
|
70
73
|
# type.
|
|
71
74
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
72
75
|
# @return [TrophyApiClient::Leaderboards::LeaderboardsAllResponseItem]
|
|
73
|
-
def initialize(status:, id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:,
|
|
74
|
-
points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
76
|
+
def initialize(status:, id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:, breakdown_attribute: OMIT, metric_key: OMIT,
|
|
77
|
+
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
75
78
|
@status = status
|
|
76
79
|
@id = id
|
|
77
80
|
@name = name
|
|
78
81
|
@key = key
|
|
79
82
|
@rank_by = rank_by
|
|
83
|
+
@breakdown_attribute = breakdown_attribute if breakdown_attribute != OMIT
|
|
80
84
|
@metric_key = metric_key if metric_key != OMIT
|
|
81
85
|
@metric_name = metric_name if metric_name != OMIT
|
|
82
86
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
@@ -94,6 +98,7 @@ module TrophyApiClient
|
|
|
94
98
|
"name": name,
|
|
95
99
|
"key": key,
|
|
96
100
|
"rankBy": rank_by,
|
|
101
|
+
"breakdownAttribute": breakdown_attribute,
|
|
97
102
|
"metricKey": metric_key,
|
|
98
103
|
"metricName": metric_name,
|
|
99
104
|
"pointsSystemKey": points_system_key,
|
|
@@ -121,6 +126,7 @@ module TrophyApiClient
|
|
|
121
126
|
name = parsed_json["name"]
|
|
122
127
|
key = parsed_json["key"]
|
|
123
128
|
rank_by = parsed_json["rankBy"]
|
|
129
|
+
breakdown_attribute = parsed_json["breakdownAttribute"]
|
|
124
130
|
metric_key = parsed_json["metricKey"]
|
|
125
131
|
metric_name = parsed_json["metricName"]
|
|
126
132
|
points_system_key = parsed_json["pointsSystemKey"]
|
|
@@ -137,6 +143,7 @@ module TrophyApiClient
|
|
|
137
143
|
name: name,
|
|
138
144
|
key: key,
|
|
139
145
|
rank_by: rank_by,
|
|
146
|
+
breakdown_attribute: breakdown_attribute,
|
|
140
147
|
metric_key: metric_key,
|
|
141
148
|
metric_name: metric_name,
|
|
142
149
|
points_system_key: points_system_key,
|
|
@@ -170,6 +177,7 @@ module TrophyApiClient
|
|
|
170
177
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
171
178
|
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
|
172
179
|
obj.rank_by.is_a?(TrophyApiClient::LeaderboardResponseRankBy) != false || raise("Passed value for field obj.rank_by is not the expected type, validation failed.")
|
|
180
|
+
obj.breakdown_attribute&.is_a?(String) != false || raise("Passed value for field obj.breakdown_attribute is not the expected type, validation failed.")
|
|
173
181
|
obj.metric_key&.is_a?(String) != false || raise("Passed value for field obj.metric_key is not the expected type, validation failed.")
|
|
174
182
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
175
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.")
|
|
@@ -21,8 +21,8 @@ module TrophyApiClient
|
|
|
21
21
|
#
|
|
22
22
|
# @param key [String] Key of the points system.
|
|
23
23
|
# @param user_attributes [String] Optional colon-delimited user attribute filters in the format
|
|
24
|
-
#
|
|
25
|
-
#
|
|
24
|
+
# attribute:value,attribute:value. Only users matching ALL specified attributes
|
|
25
|
+
# will be included in the points breakdown.
|
|
26
26
|
# @param request_options [TrophyApiClient::RequestOptions]
|
|
27
27
|
# @return [TrophyApiClient::POINTS_SUMMARY_RESPONSE]
|
|
28
28
|
# @example
|
|
@@ -104,8 +104,8 @@ module TrophyApiClient
|
|
|
104
104
|
#
|
|
105
105
|
# @param key [String] Key of the points system.
|
|
106
106
|
# @param user_attributes [String] Optional colon-delimited user attribute filters in the format
|
|
107
|
-
#
|
|
108
|
-
#
|
|
107
|
+
# attribute:value,attribute:value. Only users matching ALL specified attributes
|
|
108
|
+
# will be included in the points breakdown.
|
|
109
109
|
# @param request_options [TrophyApiClient::RequestOptions]
|
|
110
110
|
# @return [TrophyApiClient::POINTS_SUMMARY_RESPONSE]
|
|
111
111
|
# @example
|
|
@@ -16,6 +16,8 @@ module TrophyApiClient
|
|
|
16
16
|
attr_reader :key
|
|
17
17
|
# @return [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
18
18
|
attr_reader :rank_by
|
|
19
|
+
# @return [String] The key of the attribute to break down this leaderboard by.
|
|
20
|
+
attr_reader :breakdown_attribute
|
|
19
21
|
# @return [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
20
22
|
attr_reader :metric_key
|
|
21
23
|
# @return [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
@@ -51,6 +53,7 @@ module TrophyApiClient
|
|
|
51
53
|
# @param name [String] The user-facing name of the leaderboard.
|
|
52
54
|
# @param key [String] The unique key used to reference the leaderboard in APIs.
|
|
53
55
|
# @param rank_by [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
56
|
+
# @param breakdown_attribute [String] The key of the attribute to break down this leaderboard by.
|
|
54
57
|
# @param metric_key [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
55
58
|
# @param metric_name [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
56
59
|
# @param points_system_key [String] The key of the points system to rank by, if rankBy is 'points'.
|
|
@@ -66,12 +69,13 @@ module TrophyApiClient
|
|
|
66
69
|
# type.
|
|
67
70
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
68
71
|
# @return [TrophyApiClient::LeaderboardResponse]
|
|
69
|
-
def initialize(id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:,
|
|
70
|
-
points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
72
|
+
def initialize(id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:, breakdown_attribute: OMIT, metric_key: OMIT, metric_name: OMIT,
|
|
73
|
+
points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
71
74
|
@id = id
|
|
72
75
|
@name = name
|
|
73
76
|
@key = key
|
|
74
77
|
@rank_by = rank_by
|
|
78
|
+
@breakdown_attribute = breakdown_attribute if breakdown_attribute != OMIT
|
|
75
79
|
@metric_key = metric_key if metric_key != OMIT
|
|
76
80
|
@metric_name = metric_name if metric_name != OMIT
|
|
77
81
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
@@ -88,6 +92,7 @@ module TrophyApiClient
|
|
|
88
92
|
"name": name,
|
|
89
93
|
"key": key,
|
|
90
94
|
"rankBy": rank_by,
|
|
95
|
+
"breakdownAttribute": breakdown_attribute,
|
|
91
96
|
"metricKey": metric_key,
|
|
92
97
|
"metricName": metric_name,
|
|
93
98
|
"pointsSystemKey": points_system_key,
|
|
@@ -114,6 +119,7 @@ module TrophyApiClient
|
|
|
114
119
|
name = parsed_json["name"]
|
|
115
120
|
key = parsed_json["key"]
|
|
116
121
|
rank_by = parsed_json["rankBy"]
|
|
122
|
+
breakdown_attribute = parsed_json["breakdownAttribute"]
|
|
117
123
|
metric_key = parsed_json["metricKey"]
|
|
118
124
|
metric_name = parsed_json["metricName"]
|
|
119
125
|
points_system_key = parsed_json["pointsSystemKey"]
|
|
@@ -129,6 +135,7 @@ module TrophyApiClient
|
|
|
129
135
|
name: name,
|
|
130
136
|
key: key,
|
|
131
137
|
rank_by: rank_by,
|
|
138
|
+
breakdown_attribute: breakdown_attribute,
|
|
132
139
|
metric_key: metric_key,
|
|
133
140
|
metric_name: metric_name,
|
|
134
141
|
points_system_key: points_system_key,
|
|
@@ -161,6 +168,7 @@ module TrophyApiClient
|
|
|
161
168
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
162
169
|
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
|
163
170
|
obj.rank_by.is_a?(TrophyApiClient::LeaderboardResponseRankBy) != false || raise("Passed value for field obj.rank_by is not the expected type, validation failed.")
|
|
171
|
+
obj.breakdown_attribute&.is_a?(String) != false || raise("Passed value for field obj.breakdown_attribute is not the expected type, validation failed.")
|
|
164
172
|
obj.metric_key&.is_a?(String) != false || raise("Passed value for field obj.metric_key is not the expected type, validation failed.")
|
|
165
173
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
166
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.")
|
|
@@ -21,6 +21,8 @@ module TrophyApiClient
|
|
|
21
21
|
attr_reader :key
|
|
22
22
|
# @return [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
23
23
|
attr_reader :rank_by
|
|
24
|
+
# @return [String] The key of the attribute to break down this leaderboard by.
|
|
25
|
+
attr_reader :breakdown_attribute
|
|
24
26
|
# @return [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
25
27
|
attr_reader :metric_key
|
|
26
28
|
# @return [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
@@ -58,6 +60,7 @@ module TrophyApiClient
|
|
|
58
60
|
# @param name [String] The user-facing name of the leaderboard.
|
|
59
61
|
# @param key [String] The unique key used to reference the leaderboard in APIs.
|
|
60
62
|
# @param rank_by [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
63
|
+
# @param breakdown_attribute [String] The key of the attribute to break down this leaderboard by.
|
|
61
64
|
# @param metric_key [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
62
65
|
# @param metric_name [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
63
66
|
# @param points_system_key [String] The key of the points system to rank by, if rankBy is 'points'.
|
|
@@ -73,14 +76,15 @@ module TrophyApiClient
|
|
|
73
76
|
# type.
|
|
74
77
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
75
78
|
# @return [TrophyApiClient::LeaderboardResponseWithRankings]
|
|
76
|
-
def initialize(status:, rankings:, id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:,
|
|
77
|
-
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:, description:, start:, max_participants:, run_interval:, breakdown_attribute: OMIT, metric_key: OMIT,
|
|
80
|
+
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
78
81
|
@status = status
|
|
79
82
|
@rankings = rankings
|
|
80
83
|
@id = id
|
|
81
84
|
@name = name
|
|
82
85
|
@key = key
|
|
83
86
|
@rank_by = rank_by
|
|
87
|
+
@breakdown_attribute = breakdown_attribute if breakdown_attribute != OMIT
|
|
84
88
|
@metric_key = metric_key if metric_key != OMIT
|
|
85
89
|
@metric_name = metric_name if metric_name != OMIT
|
|
86
90
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
@@ -99,6 +103,7 @@ module TrophyApiClient
|
|
|
99
103
|
"name": name,
|
|
100
104
|
"key": key,
|
|
101
105
|
"rankBy": rank_by,
|
|
106
|
+
"breakdownAttribute": breakdown_attribute,
|
|
102
107
|
"metricKey": metric_key,
|
|
103
108
|
"metricName": metric_name,
|
|
104
109
|
"pointsSystemKey": points_system_key,
|
|
@@ -130,6 +135,7 @@ module TrophyApiClient
|
|
|
130
135
|
name = parsed_json["name"]
|
|
131
136
|
key = parsed_json["key"]
|
|
132
137
|
rank_by = parsed_json["rankBy"]
|
|
138
|
+
breakdown_attribute = parsed_json["breakdownAttribute"]
|
|
133
139
|
metric_key = parsed_json["metricKey"]
|
|
134
140
|
metric_name = parsed_json["metricName"]
|
|
135
141
|
points_system_key = parsed_json["pointsSystemKey"]
|
|
@@ -147,6 +153,7 @@ module TrophyApiClient
|
|
|
147
153
|
name: name,
|
|
148
154
|
key: key,
|
|
149
155
|
rank_by: rank_by,
|
|
156
|
+
breakdown_attribute: breakdown_attribute,
|
|
150
157
|
metric_key: metric_key,
|
|
151
158
|
metric_name: metric_name,
|
|
152
159
|
points_system_key: points_system_key,
|
|
@@ -181,6 +188,7 @@ module TrophyApiClient
|
|
|
181
188
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
182
189
|
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
|
183
190
|
obj.rank_by.is_a?(TrophyApiClient::LeaderboardResponseRankBy) != false || raise("Passed value for field obj.rank_by is not the expected type, validation failed.")
|
|
191
|
+
obj.breakdown_attribute&.is_a?(String) != false || raise("Passed value for field obj.breakdown_attribute is not the expected type, validation failed.")
|
|
184
192
|
obj.metric_key&.is_a?(String) != false || raise("Passed value for field obj.metric_key is not the expected type, validation failed.")
|
|
185
193
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
186
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.")
|
|
@@ -19,6 +19,9 @@ module TrophyApiClient
|
|
|
19
19
|
# @return [Integer] The minimum value required to enter the leaderboard according to its current
|
|
20
20
|
# rankings.
|
|
21
21
|
attr_reader :threshold
|
|
22
|
+
# @return [String] For leaderboards with a breakdown attribute, the value of the attribute for the
|
|
23
|
+
# user.
|
|
24
|
+
attr_reader :breakdown_attribute_value
|
|
22
25
|
# @return [String] The unique ID of the leaderboard.
|
|
23
26
|
attr_reader :id
|
|
24
27
|
# @return [String] The user-facing name of the leaderboard.
|
|
@@ -27,6 +30,8 @@ module TrophyApiClient
|
|
|
27
30
|
attr_reader :key
|
|
28
31
|
# @return [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
29
32
|
attr_reader :rank_by
|
|
33
|
+
# @return [String] The key of the attribute to break down this leaderboard by.
|
|
34
|
+
attr_reader :breakdown_attribute
|
|
30
35
|
# @return [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
31
36
|
attr_reader :metric_key
|
|
32
37
|
# @return [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
@@ -63,10 +68,13 @@ module TrophyApiClient
|
|
|
63
68
|
# on the leaderboard before the event.
|
|
64
69
|
# @param threshold [Integer] The minimum value required to enter the leaderboard according to its current
|
|
65
70
|
# rankings.
|
|
71
|
+
# @param breakdown_attribute_value [String] For leaderboards with a breakdown attribute, the value of the attribute for the
|
|
72
|
+
# user.
|
|
66
73
|
# @param id [String] The unique ID of the leaderboard.
|
|
67
74
|
# @param name [String] The user-facing name of the leaderboard.
|
|
68
75
|
# @param key [String] The unique key used to reference the leaderboard in APIs.
|
|
69
76
|
# @param rank_by [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
77
|
+
# @param breakdown_attribute [String] The key of the attribute to break down this leaderboard by.
|
|
70
78
|
# @param metric_key [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
71
79
|
# @param metric_name [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
72
80
|
# @param points_system_key [String] The key of the points system to rank by, if rankBy is 'points'.
|
|
@@ -80,16 +88,18 @@ module TrophyApiClient
|
|
|
80
88
|
# type.
|
|
81
89
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
82
90
|
# @return [TrophyApiClient::MetricEventLeaderboardResponse]
|
|
83
|
-
def initialize(threshold:, id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:,
|
|
84
|
-
metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
91
|
+
def initialize(threshold:, id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:,
|
|
92
|
+
end_: OMIT, rank: OMIT, previous_rank: OMIT, breakdown_attribute_value: OMIT, breakdown_attribute: OMIT, metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
85
93
|
@end_ = end_ if end_ != OMIT
|
|
86
94
|
@rank = rank if rank != OMIT
|
|
87
95
|
@previous_rank = previous_rank if previous_rank != OMIT
|
|
88
96
|
@threshold = threshold
|
|
97
|
+
@breakdown_attribute_value = breakdown_attribute_value if breakdown_attribute_value != OMIT
|
|
89
98
|
@id = id
|
|
90
99
|
@name = name
|
|
91
100
|
@key = key
|
|
92
101
|
@rank_by = rank_by
|
|
102
|
+
@breakdown_attribute = breakdown_attribute if breakdown_attribute != OMIT
|
|
93
103
|
@metric_key = metric_key if metric_key != OMIT
|
|
94
104
|
@metric_name = metric_name if metric_name != OMIT
|
|
95
105
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
@@ -105,10 +115,12 @@ module TrophyApiClient
|
|
|
105
115
|
"rank": rank,
|
|
106
116
|
"previousRank": previous_rank,
|
|
107
117
|
"threshold": threshold,
|
|
118
|
+
"breakdownAttributeValue": breakdown_attribute_value,
|
|
108
119
|
"id": id,
|
|
109
120
|
"name": name,
|
|
110
121
|
"key": key,
|
|
111
122
|
"rankBy": rank_by,
|
|
123
|
+
"breakdownAttribute": breakdown_attribute,
|
|
112
124
|
"metricKey": metric_key,
|
|
113
125
|
"metricName": metric_name,
|
|
114
126
|
"pointsSystemKey": points_system_key,
|
|
@@ -134,10 +146,12 @@ module TrophyApiClient
|
|
|
134
146
|
rank = parsed_json["rank"]
|
|
135
147
|
previous_rank = parsed_json["previousRank"]
|
|
136
148
|
threshold = parsed_json["threshold"]
|
|
149
|
+
breakdown_attribute_value = parsed_json["breakdownAttributeValue"]
|
|
137
150
|
id = parsed_json["id"]
|
|
138
151
|
name = parsed_json["name"]
|
|
139
152
|
key = parsed_json["key"]
|
|
140
153
|
rank_by = parsed_json["rankBy"]
|
|
154
|
+
breakdown_attribute = parsed_json["breakdownAttribute"]
|
|
141
155
|
metric_key = parsed_json["metricKey"]
|
|
142
156
|
metric_name = parsed_json["metricName"]
|
|
143
157
|
points_system_key = parsed_json["pointsSystemKey"]
|
|
@@ -152,10 +166,12 @@ module TrophyApiClient
|
|
|
152
166
|
rank: rank,
|
|
153
167
|
previous_rank: previous_rank,
|
|
154
168
|
threshold: threshold,
|
|
169
|
+
breakdown_attribute_value: breakdown_attribute_value,
|
|
155
170
|
id: id,
|
|
156
171
|
name: name,
|
|
157
172
|
key: key,
|
|
158
173
|
rank_by: rank_by,
|
|
174
|
+
breakdown_attribute: breakdown_attribute,
|
|
159
175
|
metric_key: metric_key,
|
|
160
176
|
metric_name: metric_name,
|
|
161
177
|
points_system_key: points_system_key,
|
|
@@ -187,10 +203,12 @@ module TrophyApiClient
|
|
|
187
203
|
obj.rank&.is_a?(Integer) != false || raise("Passed value for field obj.rank is not the expected type, validation failed.")
|
|
188
204
|
obj.previous_rank&.is_a?(Integer) != false || raise("Passed value for field obj.previous_rank is not the expected type, validation failed.")
|
|
189
205
|
obj.threshold.is_a?(Integer) != false || raise("Passed value for field obj.threshold is not the expected type, validation failed.")
|
|
206
|
+
obj.breakdown_attribute_value&.is_a?(String) != false || raise("Passed value for field obj.breakdown_attribute_value is not the expected type, validation failed.")
|
|
190
207
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
191
208
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
192
209
|
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
|
193
210
|
obj.rank_by.is_a?(TrophyApiClient::LeaderboardResponseRankBy) != false || raise("Passed value for field obj.rank_by is not the expected type, validation failed.")
|
|
211
|
+
obj.breakdown_attribute&.is_a?(String) != false || raise("Passed value for field obj.breakdown_attribute is not the expected type, validation failed.")
|
|
194
212
|
obj.metric_key&.is_a?(String) != false || raise("Passed value for field obj.metric_key is not the expected type, validation failed.")
|
|
195
213
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
196
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.")
|
|
@@ -22,6 +22,8 @@ module TrophyApiClient
|
|
|
22
22
|
attr_reader :key
|
|
23
23
|
# @return [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
24
24
|
attr_reader :rank_by
|
|
25
|
+
# @return [String] The key of the attribute to break down this leaderboard by.
|
|
26
|
+
attr_reader :breakdown_attribute
|
|
25
27
|
# @return [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
26
28
|
attr_reader :metric_key
|
|
27
29
|
# @return [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
@@ -61,6 +63,7 @@ module TrophyApiClient
|
|
|
61
63
|
# @param name [String] The user-facing name of the leaderboard.
|
|
62
64
|
# @param key [String] The unique key used to reference the leaderboard in APIs.
|
|
63
65
|
# @param rank_by [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
66
|
+
# @param breakdown_attribute [String] The key of the attribute to break down this leaderboard by.
|
|
64
67
|
# @param metric_key [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
65
68
|
# @param metric_name [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
66
69
|
# @param points_system_key [String] The key of the points system to rank by, if rankBy is 'points'.
|
|
@@ -76,14 +79,15 @@ module TrophyApiClient
|
|
|
76
79
|
# type.
|
|
77
80
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
78
81
|
# @return [TrophyApiClient::UserLeaderboardResponse]
|
|
79
|
-
def initialize(id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:, rank: OMIT, value: OMIT,
|
|
80
|
-
points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
82
|
+
def initialize(id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:, rank: OMIT, value: OMIT, breakdown_attribute: OMIT, metric_key: OMIT,
|
|
83
|
+
metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
81
84
|
@rank = rank if rank != OMIT
|
|
82
85
|
@value = value if value != OMIT
|
|
83
86
|
@id = id
|
|
84
87
|
@name = name
|
|
85
88
|
@key = key
|
|
86
89
|
@rank_by = rank_by
|
|
90
|
+
@breakdown_attribute = breakdown_attribute if breakdown_attribute != OMIT
|
|
87
91
|
@metric_key = metric_key if metric_key != OMIT
|
|
88
92
|
@metric_name = metric_name if metric_name != OMIT
|
|
89
93
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
@@ -102,6 +106,7 @@ module TrophyApiClient
|
|
|
102
106
|
"name": name,
|
|
103
107
|
"key": key,
|
|
104
108
|
"rankBy": rank_by,
|
|
109
|
+
"breakdownAttribute": breakdown_attribute,
|
|
105
110
|
"metricKey": metric_key,
|
|
106
111
|
"metricName": metric_name,
|
|
107
112
|
"pointsSystemKey": points_system_key,
|
|
@@ -130,6 +135,7 @@ module TrophyApiClient
|
|
|
130
135
|
name = parsed_json["name"]
|
|
131
136
|
key = parsed_json["key"]
|
|
132
137
|
rank_by = parsed_json["rankBy"]
|
|
138
|
+
breakdown_attribute = parsed_json["breakdownAttribute"]
|
|
133
139
|
metric_key = parsed_json["metricKey"]
|
|
134
140
|
metric_name = parsed_json["metricName"]
|
|
135
141
|
points_system_key = parsed_json["pointsSystemKey"]
|
|
@@ -147,6 +153,7 @@ module TrophyApiClient
|
|
|
147
153
|
name: name,
|
|
148
154
|
key: key,
|
|
149
155
|
rank_by: rank_by,
|
|
156
|
+
breakdown_attribute: breakdown_attribute,
|
|
150
157
|
metric_key: metric_key,
|
|
151
158
|
metric_name: metric_name,
|
|
152
159
|
points_system_key: points_system_key,
|
|
@@ -181,6 +188,7 @@ module TrophyApiClient
|
|
|
181
188
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
182
189
|
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
|
183
190
|
obj.rank_by.is_a?(TrophyApiClient::LeaderboardResponseRankBy) != false || raise("Passed value for field obj.rank_by is not the expected type, validation failed.")
|
|
191
|
+
obj.breakdown_attribute&.is_a?(String) != false || raise("Passed value for field obj.breakdown_attribute is not the expected type, validation failed.")
|
|
184
192
|
obj.metric_key&.is_a?(String) != false || raise("Passed value for field obj.metric_key is not the expected type, validation failed.")
|
|
185
193
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
186
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.")
|
|
@@ -25,6 +25,8 @@ module TrophyApiClient
|
|
|
25
25
|
attr_reader :key
|
|
26
26
|
# @return [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
27
27
|
attr_reader :rank_by
|
|
28
|
+
# @return [String] The key of the attribute to break down this leaderboard by.
|
|
29
|
+
attr_reader :breakdown_attribute
|
|
28
30
|
# @return [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
29
31
|
attr_reader :metric_key
|
|
30
32
|
# @return [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
@@ -65,6 +67,7 @@ module TrophyApiClient
|
|
|
65
67
|
# @param name [String] The user-facing name of the leaderboard.
|
|
66
68
|
# @param key [String] The unique key used to reference the leaderboard in APIs.
|
|
67
69
|
# @param rank_by [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
70
|
+
# @param breakdown_attribute [String] The key of the attribute to break down this leaderboard by.
|
|
68
71
|
# @param metric_key [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
69
72
|
# @param metric_name [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
70
73
|
# @param points_system_key [String] The key of the points system to rank by, if rankBy is 'points'.
|
|
@@ -80,8 +83,8 @@ module TrophyApiClient
|
|
|
80
83
|
# type.
|
|
81
84
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
82
85
|
# @return [TrophyApiClient::UserLeaderboardResponseWithHistory]
|
|
83
|
-
def initialize(history:, id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:, rank: OMIT, value: OMIT,
|
|
84
|
-
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:, description:, start:, max_participants:, run_interval:, rank: OMIT, value: OMIT, breakdown_attribute: OMIT,
|
|
87
|
+
metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
85
88
|
@history = history
|
|
86
89
|
@rank = rank if rank != OMIT
|
|
87
90
|
@value = value if value != OMIT
|
|
@@ -89,6 +92,7 @@ module TrophyApiClient
|
|
|
89
92
|
@name = name
|
|
90
93
|
@key = key
|
|
91
94
|
@rank_by = rank_by
|
|
95
|
+
@breakdown_attribute = breakdown_attribute if breakdown_attribute != OMIT
|
|
92
96
|
@metric_key = metric_key if metric_key != OMIT
|
|
93
97
|
@metric_name = metric_name if metric_name != OMIT
|
|
94
98
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
@@ -108,6 +112,7 @@ module TrophyApiClient
|
|
|
108
112
|
"name": name,
|
|
109
113
|
"key": key,
|
|
110
114
|
"rankBy": rank_by,
|
|
115
|
+
"breakdownAttribute": breakdown_attribute,
|
|
111
116
|
"metricKey": metric_key,
|
|
112
117
|
"metricName": metric_name,
|
|
113
118
|
"pointsSystemKey": points_system_key,
|
|
@@ -140,6 +145,7 @@ module TrophyApiClient
|
|
|
140
145
|
name = parsed_json["name"]
|
|
141
146
|
key = parsed_json["key"]
|
|
142
147
|
rank_by = parsed_json["rankBy"]
|
|
148
|
+
breakdown_attribute = parsed_json["breakdownAttribute"]
|
|
143
149
|
metric_key = parsed_json["metricKey"]
|
|
144
150
|
metric_name = parsed_json["metricName"]
|
|
145
151
|
points_system_key = parsed_json["pointsSystemKey"]
|
|
@@ -158,6 +164,7 @@ module TrophyApiClient
|
|
|
158
164
|
name: name,
|
|
159
165
|
key: key,
|
|
160
166
|
rank_by: rank_by,
|
|
167
|
+
breakdown_attribute: breakdown_attribute,
|
|
161
168
|
metric_key: metric_key,
|
|
162
169
|
metric_name: metric_name,
|
|
163
170
|
points_system_key: points_system_key,
|
|
@@ -193,6 +200,7 @@ module TrophyApiClient
|
|
|
193
200
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
194
201
|
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
|
195
202
|
obj.rank_by.is_a?(TrophyApiClient::LeaderboardResponseRankBy) != false || raise("Passed value for field obj.rank_by is not the expected type, validation failed.")
|
|
203
|
+
obj.breakdown_attribute&.is_a?(String) != false || raise("Passed value for field obj.breakdown_attribute is not the expected type, validation failed.")
|
|
196
204
|
obj.metric_key&.is_a?(String) != false || raise("Passed value for field obj.metric_key is not the expected type, validation failed.")
|
|
197
205
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
198
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.")
|
|
@@ -26,6 +26,8 @@ module TrophyApiClient
|
|
|
26
26
|
attr_reader :key
|
|
27
27
|
# @return [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
28
28
|
attr_reader :rank_by
|
|
29
|
+
# @return [String] The key of the attribute to break down this leaderboard by.
|
|
30
|
+
attr_reader :breakdown_attribute
|
|
29
31
|
# @return [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
30
32
|
attr_reader :metric_key
|
|
31
33
|
# @return [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
@@ -67,6 +69,7 @@ module TrophyApiClient
|
|
|
67
69
|
# @param name [String] The user-facing name of the leaderboard.
|
|
68
70
|
# @param key [String] The unique key used to reference the leaderboard in APIs.
|
|
69
71
|
# @param rank_by [TrophyApiClient::LeaderboardResponseRankBy] What the leaderboard ranks by.
|
|
72
|
+
# @param breakdown_attribute [String] The key of the attribute to break down this leaderboard by.
|
|
70
73
|
# @param metric_key [String] The key of the metric to rank by, if rankBy is 'metric'.
|
|
71
74
|
# @param metric_name [String] The name of the metric to rank by, if rankBy is 'metric'.
|
|
72
75
|
# @param points_system_key [String] The key of the points system to rank by, if rankBy is 'points'.
|
|
@@ -83,7 +86,7 @@ module TrophyApiClient
|
|
|
83
86
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
84
87
|
# @return [TrophyApiClient::WebhookUserLeaderboardResponse]
|
|
85
88
|
def initialize(id:, name:, key:, rank_by:, description:, start:, max_participants:, run_interval:, previous_rank: OMIT, previous_value: OMIT, rank: OMIT, value: OMIT,
|
|
86
|
-
metric_key: OMIT, metric_name: OMIT, points_system_key: OMIT, points_system_name: OMIT, end_: OMIT, run_unit: OMIT, additional_properties: nil)
|
|
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)
|
|
87
90
|
@previous_rank = previous_rank if previous_rank != OMIT
|
|
88
91
|
@previous_value = previous_value if previous_value != OMIT
|
|
89
92
|
@rank = rank if rank != OMIT
|
|
@@ -92,6 +95,7 @@ module TrophyApiClient
|
|
|
92
95
|
@name = name
|
|
93
96
|
@key = key
|
|
94
97
|
@rank_by = rank_by
|
|
98
|
+
@breakdown_attribute = breakdown_attribute if breakdown_attribute != OMIT
|
|
95
99
|
@metric_key = metric_key if metric_key != OMIT
|
|
96
100
|
@metric_name = metric_name if metric_name != OMIT
|
|
97
101
|
@points_system_key = points_system_key if points_system_key != OMIT
|
|
@@ -112,6 +116,7 @@ module TrophyApiClient
|
|
|
112
116
|
"name": name,
|
|
113
117
|
"key": key,
|
|
114
118
|
"rankBy": rank_by,
|
|
119
|
+
"breakdownAttribute": breakdown_attribute,
|
|
115
120
|
"metricKey": metric_key,
|
|
116
121
|
"metricName": metric_name,
|
|
117
122
|
"pointsSystemKey": points_system_key,
|
|
@@ -142,6 +147,7 @@ module TrophyApiClient
|
|
|
142
147
|
name = parsed_json["name"]
|
|
143
148
|
key = parsed_json["key"]
|
|
144
149
|
rank_by = parsed_json["rankBy"]
|
|
150
|
+
breakdown_attribute = parsed_json["breakdownAttribute"]
|
|
145
151
|
metric_key = parsed_json["metricKey"]
|
|
146
152
|
metric_name = parsed_json["metricName"]
|
|
147
153
|
points_system_key = parsed_json["pointsSystemKey"]
|
|
@@ -161,6 +167,7 @@ module TrophyApiClient
|
|
|
161
167
|
name: name,
|
|
162
168
|
key: key,
|
|
163
169
|
rank_by: rank_by,
|
|
170
|
+
breakdown_attribute: breakdown_attribute,
|
|
164
171
|
metric_key: metric_key,
|
|
165
172
|
metric_name: metric_name,
|
|
166
173
|
points_system_key: points_system_key,
|
|
@@ -197,6 +204,7 @@ module TrophyApiClient
|
|
|
197
204
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
198
205
|
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
|
199
206
|
obj.rank_by.is_a?(TrophyApiClient::LeaderboardResponseRankBy) != false || raise("Passed value for field obj.rank_by is not the expected type, validation failed.")
|
|
207
|
+
obj.breakdown_attribute&.is_a?(String) != false || raise("Passed value for field obj.breakdown_attribute is not the expected type, validation failed.")
|
|
200
208
|
obj.metric_key&.is_a?(String) != false || raise("Passed value for field obj.metric_key is not the expected type, validation failed.")
|
|
201
209
|
obj.metric_name&.is_a?(String) != false || raise("Passed value for field obj.metric_name is not the expected type, validation failed.")
|
|
202
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.")
|