trophy_api_client 1.0.11 → 1.0.12
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1552058b8e26bb11794e4add9f690522878779c123c84343f0a5091954596202
|
4
|
+
data.tar.gz: fe75b53fd1ddf0dc6f1479ca75060ac6d36665a07380fd7cb6575269cb0f9d74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c911e99071d6e1b6bcb4d30e9fd72d1a2385f0731137d96eb00fd357d64f93374b4fd77a5942f2c97cb23f2d7e12777ac0b30e422919861fcbbaa31d25d7e7a3
|
7
|
+
data.tar.gz: b96e3770f2d53ae133fcb651656db80a7a6b9e099255ccd1db064aec5dd862979a99c0ab83fea0d0aca8bfa64361ce2ca5e389f0d6922752223fac3fb1ef4054
|
data/lib/gemconfig.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "completed_achievement_response"
|
4
4
|
require_relative "metric_event_streak_response"
|
5
|
-
require_relative "
|
5
|
+
require_relative "metric_event_points_response"
|
6
6
|
require "ostruct"
|
7
7
|
require "json"
|
8
8
|
|
@@ -18,7 +18,7 @@ module TrophyApiClient
|
|
18
18
|
attr_reader :achievements
|
19
19
|
# @return [TrophyApiClient::MetricEventStreakResponse] The user's current streak for the metric, if the metric has streaks enabled.
|
20
20
|
attr_reader :current_streak
|
21
|
-
# @return [TrophyApiClient::
|
21
|
+
# @return [TrophyApiClient::MetricEventPointsResponse] The points added by this event, and a breakdown of the points awards that added
|
22
22
|
# points.
|
23
23
|
attr_reader :points
|
24
24
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -34,7 +34,7 @@ module TrophyApiClient
|
|
34
34
|
# @param total [Float] The user's new total progress against the metric.
|
35
35
|
# @param achievements [Array<TrophyApiClient::CompletedAchievementResponse>] Achievements completed as a result of this event.
|
36
36
|
# @param current_streak [TrophyApiClient::MetricEventStreakResponse] The user's current streak for the metric, if the metric has streaks enabled.
|
37
|
-
# @param points [TrophyApiClient::
|
37
|
+
# @param points [TrophyApiClient::MetricEventPointsResponse] The points added by this event, and a breakdown of the points awards that added
|
38
38
|
# points.
|
39
39
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
40
40
|
# @return [TrophyApiClient::EventResponse]
|
@@ -83,7 +83,7 @@ module TrophyApiClient
|
|
83
83
|
points = nil
|
84
84
|
else
|
85
85
|
points = parsed_json["points"].to_json
|
86
|
-
points = TrophyApiClient::
|
86
|
+
points = TrophyApiClient::MetricEventPointsResponse.from_json(json_object: points)
|
87
87
|
end
|
88
88
|
new(
|
89
89
|
event_id: event_id,
|
@@ -115,7 +115,7 @@ module TrophyApiClient
|
|
115
115
|
obj.total.is_a?(Float) != false || raise("Passed value for field obj.total is not the expected type, validation failed.")
|
116
116
|
obj.achievements&.is_a?(Array) != false || raise("Passed value for field obj.achievements is not the expected type, validation failed.")
|
117
117
|
obj.current_streak.nil? || TrophyApiClient::MetricEventStreakResponse.validate_raw(obj: obj.current_streak)
|
118
|
-
obj.points.nil? || TrophyApiClient::
|
118
|
+
obj.points.nil? || TrophyApiClient::MetricEventPointsResponse.validate_raw(obj: obj.points)
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
@@ -10,6 +10,10 @@ module TrophyApiClient
|
|
10
10
|
attr_reader :id
|
11
11
|
# @return [Float] The points awarded by this trigger
|
12
12
|
attr_reader :awarded
|
13
|
+
# @return [String] The date these points were awarded, in ISO 8601 format.
|
14
|
+
attr_reader :date
|
15
|
+
# @return [Float] The user's total points after this award occurred.
|
16
|
+
attr_reader :total
|
13
17
|
# @return [TrophyApiClient::PointsTrigger]
|
14
18
|
attr_reader :trigger
|
15
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -22,15 +26,25 @@ module TrophyApiClient
|
|
22
26
|
|
23
27
|
# @param id [String] The ID of the trigger award
|
24
28
|
# @param awarded [Float] The points awarded by this trigger
|
29
|
+
# @param date [String] The date these points were awarded, in ISO 8601 format.
|
30
|
+
# @param total [Float] The user's total points after this award occurred.
|
25
31
|
# @param trigger [TrophyApiClient::PointsTrigger]
|
26
32
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
27
33
|
# @return [TrophyApiClient::PointsAward]
|
28
|
-
def initialize(id: OMIT, awarded: OMIT, trigger: OMIT, additional_properties: nil)
|
34
|
+
def initialize(id: OMIT, awarded: OMIT, date: OMIT, total: OMIT, trigger: OMIT, additional_properties: nil)
|
29
35
|
@id = id if id != OMIT
|
30
36
|
@awarded = awarded if awarded != OMIT
|
37
|
+
@date = date if date != OMIT
|
38
|
+
@total = total if total != OMIT
|
31
39
|
@trigger = trigger if trigger != OMIT
|
32
40
|
@additional_properties = additional_properties
|
33
|
-
@_field_set = {
|
41
|
+
@_field_set = {
|
42
|
+
"id": id,
|
43
|
+
"awarded": awarded,
|
44
|
+
"date": date,
|
45
|
+
"total": total,
|
46
|
+
"trigger": trigger
|
47
|
+
}.reject do |_k, v|
|
34
48
|
v == OMIT
|
35
49
|
end
|
36
50
|
end
|
@@ -44,6 +58,8 @@ module TrophyApiClient
|
|
44
58
|
parsed_json = JSON.parse(json_object)
|
45
59
|
id = parsed_json["id"]
|
46
60
|
awarded = parsed_json["awarded"]
|
61
|
+
date = parsed_json["date"]
|
62
|
+
total = parsed_json["total"]
|
47
63
|
if parsed_json["trigger"].nil?
|
48
64
|
trigger = nil
|
49
65
|
else
|
@@ -53,6 +69,8 @@ module TrophyApiClient
|
|
53
69
|
new(
|
54
70
|
id: id,
|
55
71
|
awarded: awarded,
|
72
|
+
date: date,
|
73
|
+
total: total,
|
56
74
|
trigger: trigger,
|
57
75
|
additional_properties: struct
|
58
76
|
)
|
@@ -74,6 +92,8 @@ module TrophyApiClient
|
|
74
92
|
def self.validate_raw(obj:)
|
75
93
|
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
76
94
|
obj.awarded&.is_a?(Float) != false || raise("Passed value for field obj.awarded is not the expected type, validation failed.")
|
95
|
+
obj.date&.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
|
96
|
+
obj.total&.is_a?(Float) != false || raise("Passed value for field obj.total is not the expected type, validation failed.")
|
77
97
|
obj.trigger.nil? || TrophyApiClient::PointsTrigger.validate_raw(obj: obj.trigger)
|
78
98
|
end
|
79
99
|
end
|