Class: Svix::MessageAttemptRecoveredEventData
- Inherits:
-
Object
- Object
- Svix::MessageAttemptRecoveredEventData
- Defined in:
- lib/svix/models/message_attempt_recovered_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.
-
#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 = {}) ⇒ MessageAttemptRecoveredEventData
constructor
A new instance of MessageAttemptRecoveredEventData.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ MessageAttemptRecoveredEventData
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/svix/models/message_attempt_recovered_event_data.rb', line 23 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail( ArgumentError, "The input argument (attributes) must be a hash in `Svix::MessageAttemptRecoveredEventData` new method" ) end attributes.each do |k, v| unless ALL_FIELD.include?(k.to_s) fail(ArgumentError, "The field #{k} is not part of Svix::MessageAttemptRecoveredEventData") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#app_id ⇒ Object
The Application’s ID.
9 10 11 |
# File 'lib/svix/models/message_attempt_recovered_event_data.rb', line 9 def app_id @app_id end |
#app_uid ⇒ Object
The Application’s UID.
11 12 13 |
# File 'lib/svix/models/message_attempt_recovered_event_data.rb', line 11 def app_uid @app_uid end |
#endpoint_id ⇒ Object
The Endpoint’s ID.
13 14 15 |
# File 'lib/svix/models/message_attempt_recovered_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/svix/models/message_attempt_recovered_event_data.rb', line 14 def last_attempt @last_attempt end |
#msg_event_id ⇒ Object
The Message’s UID.
16 17 18 |
# File 'lib/svix/models/message_attempt_recovered_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/svix/models/message_attempt_recovered_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/svix/models/message_attempt_recovered_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"] = Svix::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/svix/models/message_attempt_recovered_event_data.rb', line 53 def serialize out = Hash.new out["appId"] = Svix::serialize_primitive(@app_id) if @app_id out["appUid"] = Svix::serialize_primitive(@app_uid) if @app_uid out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id out["lastAttempt"] = Svix::serialize_schema_ref(@last_attempt) if @last_attempt out["msgEventId"] = Svix::serialize_primitive(@msg_event_id) if @msg_event_id out["msgId"] = Svix::serialize_primitive(@msg_id) if @msg_id out end |
#to_json ⇒ Object
Serializes the object to a json string
66 67 68 |
# File 'lib/svix/models/message_attempt_recovered_event_data.rb', line 66 def to_json JSON.dump(serialize) end |