Class: HookSniff::MessageAttemptFailingEventData
- Inherits:
-
Object
- Object
- HookSniff::MessageAttemptFailingEventData
- Defined in:
- lib/hooksniff/webhook_event.rb,
lib/hooksniff/models/message_attempt_failing_event_data.rb
Overview
Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a “message.attempt.exhausted” type or after it’s failed four times as a “message.attempt.failing” event.
Instance Attribute Summary collapse
-
#app_id ⇒ Object
The Application’s ID.
-
#app_uid ⇒ Object
The Application’s UID.
-
#attempt ⇒ Object
readonly
Returns the value of attribute attempt.
-
#endpoint_id ⇒ Object
The Endpoint’s ID.
-
#last_attempt ⇒ Object
Returns the value of attribute last_attempt.
-
#msg_event_id ⇒ Object
The Message’s UID.
-
#msg_id ⇒ Object
The Message’s ID.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ MessageAttemptFailingEventData
constructor
A new instance of MessageAttemptFailingEventData.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ MessageAttemptFailingEventData
Returns a new instance of MessageAttemptFailingEventData.
101 102 103 104 105 106 |
# File 'lib/hooksniff/webhook_event.rb', line 101 def initialize(app_id:, msg_id:, attempt:, app_uid: nil) @app_id = app_id @msg_id = msg_id @attempt = attempt @app_uid = app_uid end |
Instance Attribute Details
#app_id ⇒ Object
The Application’s ID.
9 10 11 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 9 def app_id @app_id end |
#app_uid ⇒ Object
The Application’s UID.
11 12 13 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 11 def app_uid @app_uid end |
#attempt ⇒ Object (readonly)
Returns the value of attribute attempt.
99 100 101 |
# File 'lib/hooksniff/webhook_event.rb', line 99 def attempt @attempt end |
#endpoint_id ⇒ Object
The Endpoint’s ID.
13 14 15 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 13 def endpoint_id @endpoint_id end |
#last_attempt ⇒ Object
Returns the value of attribute last_attempt.
14 15 16 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 14 def last_attempt @last_attempt end |
#msg_event_id ⇒ Object
The Message’s UID.
16 17 18 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 16 def msg_event_id @msg_event_id end |
#msg_id ⇒ Object
The Message’s ID.
18 19 20 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 18 def msg_id @msg_id end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 41 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["app_id"] = attributes["appId"] attrs["app_uid"] = attributes["appUid"] attrs["endpoint_id"] = attributes["endpointId"] attrs["last_attempt"] = HookSniff::MessageAttemptFailedData.deserialize(attributes["lastAttempt"]) attrs["msg_event_id"] = attributes["msgEventId"] attrs["msg_id"] = attributes["msgId"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 53 def serialize out = Hash.new out["appId"] = HookSniff::serialize_primitive(@app_id) if @app_id out["appUid"] = HookSniff::serialize_primitive(@app_uid) if @app_uid out["endpointId"] = HookSniff::serialize_primitive(@endpoint_id) if @endpoint_id out["lastAttempt"] = HookSniff::serialize_schema_ref(@last_attempt) if @last_attempt out["msgEventId"] = HookSniff::serialize_primitive(@msg_event_id) if @msg_event_id out["msgId"] = HookSniff::serialize_primitive(@msg_id) if @msg_id out end |
#to_json ⇒ Object
Serializes the object to a json string
66 67 68 |
# File 'lib/hooksniff/models/message_attempt_failing_event_data.rb', line 66 def to_json JSON.dump(serialize) end |