Skip to content

Commit 9ca1a61

Browse files
Automatically update Ruby SDK
1 parent 4adc32f commit 9ca1a61

5 files changed

Lines changed: 23 additions & 14 deletions

File tree

lib/gemconfig.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module TrophyApiClient
44
module Gemconfig
5-
VERSION = "1.10.0"
5+
VERSION = "1.11.0"
66
AUTHORS = ["Trophy Labs, Inc"].freeze
77
EMAIL = ""
88
SUMMARY = "Ruby library for the Trophy API."

lib/trophy_api_client/types/leaderboard_event.rb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
require "json"
66

77
module TrophyApiClient
8-
# A leaderboard event representing a change in a user's rank or value.
8+
# A daily leaderboard snapshot entry representing the user's rank/value state and
9+
# the previous persisted state.
910
class LeaderboardEvent
10-
# @return [DateTime] The timestamp when the event occurred.
11+
# @return [String] The leaderboard snapshot date in YYYY-MM-DD format.
12+
attr_reader :date
13+
# @return [DateTime] Deprecated ISO timestamp for the snapshot day boundary. Use `date` instead.
1114
attr_reader :timestamp
1215
# @return [Integer] The user's rank before this event, or null if they were not on the leaderboard.
1316
attr_reader :previous_rank
@@ -27,7 +30,8 @@ class LeaderboardEvent
2730

2831
OMIT = Object.new
2932

30-
# @param timestamp [DateTime] The timestamp when the event occurred.
33+
# @param date [String] The leaderboard snapshot date in YYYY-MM-DD format.
34+
# @param timestamp [DateTime] Deprecated ISO timestamp for the snapshot day boundary. Use `date` instead.
3135
# @param previous_rank [Integer] The user's rank before this event, or null if they were not on the leaderboard.
3236
# @param rank [Integer] The user's rank after this event, or null if they are no longer on the
3337
# leaderboard.
@@ -36,15 +40,17 @@ class LeaderboardEvent
3640
# leaderboard.
3741
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
3842
# @return [TrophyApiClient::LeaderboardEvent]
39-
def initialize(timestamp: OMIT, previous_rank: OMIT, rank: OMIT, previous_value: OMIT, value: OMIT,
43+
def initialize(date:, timestamp:, previous_rank: OMIT, rank: OMIT, previous_value: OMIT, value: OMIT,
4044
additional_properties: nil)
41-
@timestamp = timestamp if timestamp != OMIT
45+
@date = date
46+
@timestamp = timestamp
4247
@previous_rank = previous_rank if previous_rank != OMIT
4348
@rank = rank if rank != OMIT
4449
@previous_value = previous_value if previous_value != OMIT
4550
@value = value if value != OMIT
4651
@additional_properties = additional_properties
4752
@_field_set = {
53+
"date": date,
4854
"timestamp": timestamp,
4955
"previousRank": previous_rank,
5056
"rank": rank,
@@ -62,12 +68,14 @@ def initialize(timestamp: OMIT, previous_rank: OMIT, rank: OMIT, previous_value:
6268
def self.from_json(json_object:)
6369
struct = JSON.parse(json_object, object_class: OpenStruct)
6470
parsed_json = JSON.parse(json_object)
71+
date = parsed_json["date"]
6572
timestamp = (DateTime.parse(parsed_json["timestamp"]) unless parsed_json["timestamp"].nil?)
6673
previous_rank = parsed_json["previousRank"]
6774
rank = parsed_json["rank"]
6875
previous_value = parsed_json["previousValue"]
6976
value = parsed_json["value"]
7077
new(
78+
date: date,
7179
timestamp: timestamp,
7280
previous_rank: previous_rank,
7381
rank: rank,
@@ -91,7 +99,8 @@ def to_json(*_args)
9199
# @param obj [Object]
92100
# @return [Void]
93101
def self.validate_raw(obj:)
94-
obj.timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
102+
obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
103+
obj.timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
95104
obj.previous_rank&.is_a?(Integer) != false || raise("Passed value for field obj.previous_rank is not the expected type, validation failed.")
96105
obj.rank&.is_a?(Integer) != false || raise("Passed value for field obj.rank is not the expected type, validation failed.")
97106
obj.previous_value&.is_a?(Integer) != false || raise("Passed value for field obj.previous_value is not the expected type, validation failed.")

lib/trophy_api_client/types/user_leaderboard_response_with_history.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
module TrophyApiClient
1010
# A user's data for a specific leaderboard including rank, value, and history.
1111
class UserLeaderboardResponseWithHistory
12-
# @return [Array<TrophyApiClient::LeaderboardEvent>] An array of events showing the user's rank and value changes over time.
12+
# @return [Array<TrophyApiClient::LeaderboardEvent>] An array of daily change events showing the user's rank and value over time.
1313
attr_reader :history
1414
# @return [Integer] The user's current rank in this leaderboard. Null if the user is not on the
1515
# leaderboard.
@@ -60,7 +60,7 @@ class UserLeaderboardResponseWithHistory
6060

6161
OMIT = Object.new
6262

63-
# @param history [Array<TrophyApiClient::LeaderboardEvent>] An array of events showing the user's rank and value changes over time.
63+
# @param history [Array<TrophyApiClient::LeaderboardEvent>] An array of daily change events showing the user's rank and value over time.
6464
# @param rank [Integer] The user's current rank in this leaderboard. Null if the user is not on the
6565
# leaderboard.
6666
# @param value [Integer] The user's current value in this leaderboard. Null if the user is not on the

lib/trophy_api_client/users/client.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,13 +582,13 @@ def points_event_summary(id:, key:, aggregation:, start_date:, end_date:, reques
582582
end
583583
end
584584

585-
# Get a user's rank, value, and history for a specific leaderboard.
585+
# Get a user's rank, value, and daily ranking history for a specific leaderboard.
586586
#
587587
# @param id [String] The user's ID in your database.
588588
# @param key [String] Unique key of the leaderboard as set when created.
589589
# @param run [String] Specific run date in YYYY-MM-DD format. If not provided, returns the current
590590
# run.
591-
# @param num_events [Integer] The number of events to return in the history array.
591+
# @param num_events [Integer] The number of days to return in the leaderboard history for the user.
592592
# @param request_options [TrophyApiClient::RequestOptions]
593593
# @return [TrophyApiClient::UserLeaderboardResponseWithHistory]
594594
# @example
@@ -1252,13 +1252,13 @@ def points_event_summary(id:, key:, aggregation:, start_date:, end_date:, reques
12521252
end
12531253
end
12541254

1255-
# Get a user's rank, value, and history for a specific leaderboard.
1255+
# Get a user's rank, value, and daily ranking history for a specific leaderboard.
12561256
#
12571257
# @param id [String] The user's ID in your database.
12581258
# @param key [String] Unique key of the leaderboard as set when created.
12591259
# @param run [String] Specific run date in YYYY-MM-DD format. If not provided, returns the current
12601260
# run.
1261-
# @param num_events [Integer] The number of events to return in the history array.
1261+
# @param num_events [Integer] The number of days to return in the leaderboard history for the user.
12621262
# @param request_options [TrophyApiClient::RequestOptions]
12631263
# @return [TrophyApiClient::UserLeaderboardResponseWithHistory]
12641264
# @example

lib/trophy_api_client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module MyGem
2-
VERSION = "1.10.0"
2+
VERSION = "1.11.0"
33
end

0 commit comments

Comments
 (0)