lib/simplyq/models/delivery_attempt.rb in simplyq-0.8.2rc vs lib/simplyq/models/delivery_attempt.rb in simplyq-0.8.3

- old
+ new

@@ -7,40 +7,64 @@ attr_accessor :event_id attr_accessor :endpoint_id + # The endpoint url of the endpoint when the event delivery was attempted. + attr_accessor :endpoint_url + # The response of the endpoint when a delivery attempt was made or null if not yet attempted. attr_accessor :response + # The response headers of the endpoint when the event delivery was attempted. + attr_accessor :response_headers + # The response code of the endpoint when the event delivery was attempted. attr_accessor :response_status_code + # The response code class i.e. 2xx, 3xx, 4xx, 5xx of the endpoint when the event delivery was attempted. + attr_accessor :response_status_code_class + # The delivery status of the event to the endpoint attr_accessor :status # The tigger of the delivery attempt attr_accessor :trigger_type - # This is the timestamp of when the delivery attempt was made to the endpoint. In case it has not yet been attempted and the status of the delivery attempt is **pending**, then the value of the timestamp will be **null**. + # Number of times an event delivery attempt failed before the current attempt. + attr_accessor :retry_count + + # This is the timestamp of when the delivery attempt was made to the endpoint. + # In case it has not yet been attempted and the status of the delivery attempt + # is **pending**, then the value of the timestamp will be **null**. attr_accessor :attempted_at def initialize(attributes = {}) self.id = attributes[:id] if attributes.key?(:id) self.event_id = attributes[:event_id] if attributes.key?(:event_id) self.endpoint_id = attributes[:endpoint_id] if attributes.key?(:endpoint_id) + self.endpoint_url = attributes[:endpoint_url] if attributes.key?(:endpoint_url) + self.response = attributes[:response] if attributes.key?(:response) + self.response_headers = attributes[:response_headers] if attributes.key?(:response_headers) + self.response_status_code = attributes[:response_status_code] if attributes.key?(:response_status_code) + if attributes.key?(:response_status_code_class) + self.response_status_code_class = attributes[:response_status_code_class] + end + self.status = attributes[:status] if attributes.key?(:status) self.trigger_type = attributes[:trigger_type] if attributes.key?(:trigger_type) + self.retry_count = attributes[:retry_count] if attributes.key?(:retry_count) + self.attempted_at = attributes[:attempted_at] if attributes.key?(:attempted_at) end # The model identifier attribute used in list operations # @@ -80,25 +104,33 @@ self.class == other.class && id == other.id && event_id == other.event_id && endpoint_id == other.endpoint_id && + endpoint_url == other.endpoint_url && response == other.response && + response_headers == other.response_headers && response_status_code == other.response_status_code && + response_status_code_class == other.response_status_code_class && status == other.status && trigger_type == other.trigger_type && + retry_count == other.retry_count && attempted_at == other.attempted_at end def to_h { id: id, event_id: event_id, endpoint_id: endpoint_id, + endpoint_url: endpoint_url, response: response, + response_headers: response_headers, response_status_code: response_status_code, + response_status_code_class: response_status_code_class, status: status, trigger_type: trigger_type, + retry_count: retry_count, attempted_at: attempted_at } end def to_json(*args)