Class: Svix::IngestMessageAttemptExhaustedEventData

Inherits:
Object
  • Object
show all
Defined in:
lib/svix/models/ingest_message_attempt_exhausted_event_data.rb

Overview

Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a “ingest.message.attempt.exhausted” type, after it’s failed four times as a “ingest.message.attempt.failing” event, or after it’s recovered as a “ingest.message.attempt.recovered” event.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ IngestMessageAttemptExhaustedEventData

Returns a new instance of IngestMessageAttemptExhaustedEventData.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 21

def initialize(attributes = {})
  unless attributes.is_a?(Hash)
    fail(
      ArgumentError,
      "The input argument (attributes) must be a hash in `Svix::IngestMessageAttemptExhaustedEventData` 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::IngestMessageAttemptExhaustedEventData")
    end

    instance_variable_set("@#{k}", v)
    instance_variable_set("@__#{k}_is_defined", true)
  end
end

Instance Attribute Details

#endpoint_idObject

The Endpoint’s ID.



9
10
11
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 9

def endpoint_id
  @endpoint_id
end

#last_attemptObject

Returns the value of attribute last_attempt.



10
11
12
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 10

def last_attempt
  @last_attempt
end

#msg_event_idObject

The Message’s UID.



12
13
14
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 12

def msg_event_id
  @msg_event_id
end

#msg_idObject

The Message’s ID.



14
15
16
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 14

def msg_id
  @msg_id
end

#source_idObject

The Source’s ID.



16
17
18
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 16

def source_id
  @source_id
end

Class Method Details

.deserialize(attributes = {}) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 39

def self.deserialize(attributes = {})
  attributes = attributes.transform_keys(&:to_s)
  attrs = Hash.new
  attrs["endpoint_id"] = attributes["endpointId"]
  attrs["last_attempt"] = Svix::MessageAttemptFailedData.deserialize(attributes["lastAttempt"])
  attrs["msg_event_id"] = attributes["msgEventId"]
  attrs["msg_id"] = attributes["msgId"]
  attrs["source_id"] = attributes["sourceId"]
  new(attrs)
end

Instance Method Details

#serializeObject



50
51
52
53
54
55
56
57
58
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 50

def serialize
  out = Hash.new
  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["sourceId"] = Svix::serialize_primitive(@source_id) if @source_id
  out
end

#to_jsonObject

Serializes the object to a json string

Returns:

  • String



62
63
64
# File 'lib/svix/models/ingest_message_attempt_exhausted_event_data.rb', line 62

def to_json
  JSON.dump(serialize)
end