trophy_api_client 1.0.21 → 1.0.22

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: 68357394d52195a47c44fc9355befe6eca436547e932e74dd0efa10f7c01821e
4
- data.tar.gz: d081f45005de17054f0acefc19e113e0a7788b73e8e3c1e942e66b7dbb4d90ee
3
+ metadata.gz: cab733c24577e49524eb7899160b7c172195e0d2e84b3b6cd11cadb32342ee9a
4
+ data.tar.gz: a3999029f59148a4208edf380c131f9c9539c51fd9512e3f7f9fdd5e58270b06
5
5
  SHA512:
6
- metadata.gz: d955c1f044f150e062e4740398028483d22935eb76a475f45a7fc13118767c6b6c3f2ac4dd032b7cd7a013e8e2aae7113598efe220c4e9f4d1f6fc0b1531894d
7
- data.tar.gz: b5b9402673a5981686b77aae50db69e28ddb683dddcd2db4a02471e23299868313361dcaa683d4ce9128cd767476854fe6d6e57bc9d925ac1e9ea9e0c3c7ded9
6
+ metadata.gz: dcb1a2eab70038ac53d6d85ef7f8267a17b29dbba682f4fd44d2af7bb7d88243c85d34adf337775b24d494ee7124e8cdf77d3cba64492908eb03293374821d0a
7
+ data.tar.gz: c173eacb9c7c5be6cd6cc540c055ecb3f7bfb1c811f20c3f143e838f3a01dd1bd287d2fc920b9e5f2a73547494b6e22b7e28fd6e78339dcdd279acde449c1940
data/lib/gemconfig.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module TrophyApiClient
4
4
  module Gemconfig
5
- VERSION = "1.0.21"
5
+ VERSION = "1.0.22"
6
6
  AUTHORS = ["Trophy Labs, Inc"].freeze
7
7
  EMAIL = ""
8
8
  SUMMARY = "Ruby library for the Trophy API."
@@ -19,6 +19,10 @@ module TrophyApiClient
19
19
  attr_reader :current_streak
20
20
  # @return [Hash{String => TrophyApiClient::MetricEventPointsResponse}] A map of points systems by key that were affected by this event.
21
21
  attr_reader :points
22
+ # @return [String] The idempotency key used for the event, if one was provided.
23
+ attr_reader :idempotency_key
24
+ # @return [Boolean] Whether the event was replayed due to idempotency.
25
+ attr_reader :idempotent_replayed
22
26
  # @return [OpenStruct] Additional properties unmapped to the current class definition
23
27
  attr_reader :additional_properties
24
28
  # @return [Object]
@@ -33,16 +37,20 @@ module TrophyApiClient
33
37
  # @param achievements [Array<TrophyApiClient::CompletedAchievementResponse>] Achievements completed as a result of this event.
34
38
  # @param current_streak [TrophyApiClient::MetricEventStreakResponse] The user's current streak for the metric, if the metric has streaks enabled.
35
39
  # @param points [Hash{String => TrophyApiClient::MetricEventPointsResponse}] A map of points systems by key that were affected by this event.
40
+ # @param idempotency_key [String] The idempotency key used for the event, if one was provided.
41
+ # @param idempotent_replayed [Boolean] Whether the event was replayed due to idempotency.
36
42
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
37
43
  # @return [TrophyApiClient::EventResponse]
38
44
  def initialize(event_id:, metric_id:, total:, achievements: OMIT, current_streak: OMIT, points: OMIT,
39
- additional_properties: nil)
45
+ idempotency_key: OMIT, idempotent_replayed: OMIT, additional_properties: nil)
40
46
  @event_id = event_id
41
47
  @metric_id = metric_id
42
48
  @total = total
43
49
  @achievements = achievements if achievements != OMIT
44
50
  @current_streak = current_streak if current_streak != OMIT
45
51
  @points = points if points != OMIT
52
+ @idempotency_key = idempotency_key if idempotency_key != OMIT
53
+ @idempotent_replayed = idempotent_replayed if idempotent_replayed != OMIT
46
54
  @additional_properties = additional_properties
47
55
  @_field_set = {
48
56
  "eventId": event_id,
@@ -50,7 +58,9 @@ module TrophyApiClient
50
58
  "total": total,
51
59
  "achievements": achievements,
52
60
  "currentStreak": current_streak,
53
- "points": points
61
+ "points": points,
62
+ "idempotencyKey": idempotency_key,
63
+ "idempotentReplayed": idempotent_replayed
54
64
  }.reject do |_k, v|
55
65
  v == OMIT
56
66
  end
@@ -80,6 +90,8 @@ module TrophyApiClient
80
90
  value = value.to_json
81
91
  TrophyApiClient::MetricEventPointsResponse.from_json(json_object: value)
82
92
  end
93
+ idempotency_key = parsed_json["idempotencyKey"]
94
+ idempotent_replayed = parsed_json["idempotentReplayed"]
83
95
  new(
84
96
  event_id: event_id,
85
97
  metric_id: metric_id,
@@ -87,6 +99,8 @@ module TrophyApiClient
87
99
  achievements: achievements,
88
100
  current_streak: current_streak,
89
101
  points: points,
102
+ idempotency_key: idempotency_key,
103
+ idempotent_replayed: idempotent_replayed,
90
104
  additional_properties: struct
91
105
  )
92
106
  end
@@ -111,6 +125,8 @@ module TrophyApiClient
111
125
  obj.achievements&.is_a?(Array) != false || raise("Passed value for field obj.achievements is not the expected type, validation failed.")
112
126
  obj.current_streak.nil? || TrophyApiClient::MetricEventStreakResponse.validate_raw(obj: obj.current_streak)
113
127
  obj.points&.is_a?(Hash) != false || raise("Passed value for field obj.points is not the expected type, validation failed.")
128
+ obj.idempotency_key&.is_a?(String) != false || raise("Passed value for field obj.idempotency_key is not the expected type, validation failed.")
129
+ obj.idempotent_replayed&.is_a?(Boolean) != false || raise("Passed value for field obj.idempotent_replayed is not the expected type, validation failed.")
114
130
  end
115
131
  end
116
132
  end
@@ -1,3 +1,3 @@
1
1
  module MyGem
2
- VERSION = "1.0.21"
2
+ VERSION = "1.0.22"
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.21
4
+ version: 1.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trophy Labs, Inc