trophy_api_client 1.0.25 → 1.0.27

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e83bc714888213fee4230e282f81c84167b7a06f299bfb64fa88c6f31fdbccf
4
- data.tar.gz: 8a8fd15093b0f52a3e740eda1c09992fafea425a66a3ec699ce4e4bd335f1a63
3
+ metadata.gz: 0e3484d45e81c35f161702f00ad9dcce297343027a21629217ef081124a9dbcb
4
+ data.tar.gz: df935734b5f6622d7423a8cdef76e89527e6619b1a137d33e00f0ca951ddfba9
5
5
  SHA512:
6
- metadata.gz: db6436076a0426b84f0d1db8d6be58d0b37333cc72af12141e0823add83f0688eedb2ae9ab184b43b748daaf34dcc6ca7f35e29fc1aedb8a0caad445f391b038
7
- data.tar.gz: e3951f80976187af389151dcadef50b80089d30f9525c0f5abecd382538fa2507045f9221b3bddda585979e00fe12fdef6d9b018f8aa465c78f94e14431f680f
6
+ metadata.gz: eb346f1ca9fbc7c6eb7e18d5f85157d4bb8c50a999f846dbcd8f78256ddb66847cd8ea0fb32ba048ceafe1ef03e4dd2c34eb207a504d71bf657af760e0f8be87
7
+ data.tar.gz: 3d5393f945486bbb12fa88e6ea2e1e9eddb2009dab7e2350f9086042f6e1a6be1d75015457a4621e0e14a73851f0d2db4c2bd14adfb63729fa5566fb1ac1d30c
data/lib/gemconfig.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module TrophyApiClient
4
4
  module Gemconfig
5
- VERSION = "1.0.25"
5
+ VERSION = "1.0.27"
6
6
  AUTHORS = ["Trophy Labs, Inc"].freeze
7
7
  EMAIL = ""
8
8
  SUMMARY = "Ruby library for the Trophy API."
@@ -8,7 +8,7 @@ module TrophyApiClient
8
8
  # A leaderboard event representing a change in a user's rank or value.
9
9
  class LeaderboardEvent
10
10
  # @return [DateTime] The timestamp when the event occurred.
11
- attr_reader :time
11
+ attr_reader :timestamp
12
12
  # @return [Integer] The user's rank before this event, or null if they were not on the leaderboard.
13
13
  attr_reader :previous_rank
14
14
  # @return [Integer] The user's rank after this event, or null if they are no longer on the
@@ -27,7 +27,7 @@ module TrophyApiClient
27
27
 
28
28
  OMIT = Object.new
29
29
 
30
- # @param time [DateTime] The timestamp when the event occurred.
30
+ # @param timestamp [DateTime] The timestamp when the event occurred.
31
31
  # @param previous_rank [Integer] The user's rank before this event, or null if they were not on the leaderboard.
32
32
  # @param rank [Integer] The user's rank after this event, or null if they are no longer on the
33
33
  # leaderboard.
@@ -36,16 +36,16 @@ module TrophyApiClient
36
36
  # leaderboard.
37
37
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
38
38
  # @return [TrophyApiClient::LeaderboardEvent]
39
- def initialize(time:, previous_rank: OMIT, rank: OMIT, previous_value: OMIT, value: OMIT,
39
+ def initialize(timestamp: OMIT, previous_rank: OMIT, rank: OMIT, previous_value: OMIT, value: OMIT,
40
40
  additional_properties: nil)
41
- @time = time
41
+ @timestamp = timestamp if timestamp != OMIT
42
42
  @previous_rank = previous_rank if previous_rank != OMIT
43
43
  @rank = rank if rank != OMIT
44
44
  @previous_value = previous_value if previous_value != OMIT
45
45
  @value = value if value != OMIT
46
46
  @additional_properties = additional_properties
47
47
  @_field_set = {
48
- "time": time,
48
+ "timestamp": timestamp,
49
49
  "previousRank": previous_rank,
50
50
  "rank": rank,
51
51
  "previousValue": previous_value,
@@ -62,13 +62,13 @@ module TrophyApiClient
62
62
  def self.from_json(json_object:)
63
63
  struct = JSON.parse(json_object, object_class: OpenStruct)
64
64
  parsed_json = JSON.parse(json_object)
65
- time = (DateTime.parse(parsed_json["time"]) unless parsed_json["time"].nil?)
65
+ timestamp = (DateTime.parse(parsed_json["timestamp"]) unless parsed_json["timestamp"].nil?)
66
66
  previous_rank = parsed_json["previousRank"]
67
67
  rank = parsed_json["rank"]
68
68
  previous_value = parsed_json["previousValue"]
69
69
  value = parsed_json["value"]
70
70
  new(
71
- time: time,
71
+ timestamp: timestamp,
72
72
  previous_rank: previous_rank,
73
73
  rank: rank,
74
74
  previous_value: previous_value,
@@ -91,7 +91,7 @@ module TrophyApiClient
91
91
  # @param obj [Object]
92
92
  # @return [Void]
93
93
  def self.validate_raw(obj:)
94
- obj.time.is_a?(DateTime) != false || raise("Passed value for field obj.time is not the expected type, validation failed.")
94
+ obj.timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
95
95
  obj.previous_rank&.is_a?(Integer) != false || raise("Passed value for field obj.previous_rank is not the expected type, validation failed.")
96
96
  obj.rank&.is_a?(Integer) != false || raise("Passed value for field obj.rank is not the expected type, validation failed.")
97
97
  obj.previous_value&.is_a?(Integer) != false || raise("Passed value for field obj.previous_value is not the expected type, validation failed.")
@@ -463,12 +463,12 @@ module TrophyApiClient
463
463
  # environment: TrophyApiClient::Environment::DEFAULT,
464
464
  # api_key: "YOUR_API_KEY"
465
465
  # )
466
- # api.users.leaderboards(
466
+ # api.users.leaderboard(
467
467
  # id: "user-123",
468
468
  # key: "weekly-words",
469
469
  # run: "2025-01-15"
470
470
  # )
471
- def leaderboards(id:, key:, run: nil, request_options: nil)
471
+ def leaderboard(id:, key:, run: nil, request_options: nil)
472
472
  response = @request_client.conn.get do |req|
473
473
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
474
474
  req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
@@ -955,12 +955,12 @@ module TrophyApiClient
955
955
  # environment: TrophyApiClient::Environment::DEFAULT,
956
956
  # api_key: "YOUR_API_KEY"
957
957
  # )
958
- # api.users.leaderboards(
958
+ # api.users.leaderboard(
959
959
  # id: "user-123",
960
960
  # key: "weekly-words",
961
961
  # run: "2025-01-15"
962
962
  # )
963
- def leaderboards(id:, key:, run: nil, request_options: nil)
963
+ def leaderboard(id:, key:, run: nil, request_options: nil)
964
964
  Async do
965
965
  response = @request_client.conn.get do |req|
966
966
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -1,3 +1,3 @@
1
1
  module MyGem
2
- VERSION = "1.0.25"
2
+ VERSION = "1.0.27"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trophy_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.25
4
+ version: 1.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trophy Labs, Inc