Class: Svix::MessageAttemptLog
- Inherits:
-
Object
- Object
- Svix::MessageAttemptLog
- Defined in:
- lib/svix/models/message_attempt_log.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
The Application’s ID.
-
#app_uid ⇒ Object
The Application’s UID.
-
#attempt_count ⇒ Object
Returns the value of attribute attempt_count.
-
#attempt_end ⇒ Object
Returns the value of attribute attempt_end.
-
#attempt_id ⇒ Object
The MessageAttempt’s ID.
-
#attempt_start ⇒ Object
Returns the value of attribute attempt_start.
-
#endpoint_id ⇒ Object
The Endpoint’s ID.
-
#event_type ⇒ Object
The event type’s name.
-
#http_times ⇒ Object
Returns the value of attribute http_times.
-
#msg_created ⇒ Object
Returns the value of attribute msg_created.
-
#msg_event_id ⇒ Object
The Message’s UID.
-
#msg_id ⇒ Object
The Message’s ID.
-
#org_id ⇒ Object
The Environment’s ID.
-
#response_status_code ⇒ Object
Returns the value of attribute response_status_code.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ MessageAttemptLog
constructor
A new instance of MessageAttemptLog.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ MessageAttemptLog
Returns a new instance of MessageAttemptLog.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/svix/models/message_attempt_log.rb', line 50 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::MessageAttemptLog` 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::MessageAttemptLog") 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.
8 9 10 |
# File 'lib/svix/models/message_attempt_log.rb', line 8 def app_id @app_id end |
#app_uid ⇒ Object
The Application’s UID.
10 11 12 |
# File 'lib/svix/models/message_attempt_log.rb', line 10 def app_uid @app_uid end |
#attempt_count ⇒ Object
Returns the value of attribute attempt_count.
11 12 13 |
# File 'lib/svix/models/message_attempt_log.rb', line 11 def attempt_count @attempt_count end |
#attempt_end ⇒ Object
Returns the value of attribute attempt_end.
12 13 14 |
# File 'lib/svix/models/message_attempt_log.rb', line 12 def attempt_end @attempt_end end |
#attempt_id ⇒ Object
The MessageAttempt’s ID.
14 15 16 |
# File 'lib/svix/models/message_attempt_log.rb', line 14 def attempt_id @attempt_id end |
#attempt_start ⇒ Object
Returns the value of attribute attempt_start.
15 16 17 |
# File 'lib/svix/models/message_attempt_log.rb', line 15 def attempt_start @attempt_start end |
#endpoint_id ⇒ Object
The Endpoint’s ID.
17 18 19 |
# File 'lib/svix/models/message_attempt_log.rb', line 17 def endpoint_id @endpoint_id end |
#event_type ⇒ Object
The event type’s name
19 20 21 |
# File 'lib/svix/models/message_attempt_log.rb', line 19 def event_type @event_type end |
#http_times ⇒ Object
Returns the value of attribute http_times.
20 21 22 |
# File 'lib/svix/models/message_attempt_log.rb', line 20 def http_times @http_times end |
#msg_created ⇒ Object
Returns the value of attribute msg_created.
21 22 23 |
# File 'lib/svix/models/message_attempt_log.rb', line 21 def msg_created @msg_created end |
#msg_event_id ⇒ Object
The Message’s UID.
23 24 25 |
# File 'lib/svix/models/message_attempt_log.rb', line 23 def msg_event_id @msg_event_id end |
#msg_id ⇒ Object
The Message’s ID.
25 26 27 |
# File 'lib/svix/models/message_attempt_log.rb', line 25 def msg_id @msg_id end |
#org_id ⇒ Object
The Environment’s ID.
27 28 29 |
# File 'lib/svix/models/message_attempt_log.rb', line 27 def org_id @org_id end |
#response_status_code ⇒ Object
Returns the value of attribute response_status_code.
28 29 30 |
# File 'lib/svix/models/message_attempt_log.rb', line 28 def response_status_code @response_status_code end |
#status ⇒ Object
Returns the value of attribute status.
29 30 31 |
# File 'lib/svix/models/message_attempt_log.rb', line 29 def status @status end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/svix/models/message_attempt_log.rb', line 65 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["app_id"] = attributes["appId"] attrs["app_uid"] = attributes["appUid"] attrs["attempt_count"] = attributes["attemptCount"] attrs["attempt_end"] = DateTime.rfc3339(attributes["attemptEnd"]).to_time attrs["attempt_id"] = attributes["attemptId"] attrs["attempt_start"] = DateTime.rfc3339(attributes["attemptStart"]).to_time attrs["endpoint_id"] = attributes["endpointId"] attrs["event_type"] = attributes["eventType"] attrs["http_times"] = Svix::HttpAttemptTimes.deserialize(attributes["httpTimes"]) if attributes["httpTimes"] attrs["msg_created"] = DateTime.rfc3339(attributes["msgCreated"]).to_time attrs["msg_event_id"] = attributes["msgEventId"] attrs["msg_id"] = attributes["msgId"] attrs["org_id"] = attributes["orgId"] attrs["response_status_code"] = attributes["responseStatusCode"] attrs["status"] = Svix::MessageStatus.deserialize(attributes["status"]) new(attrs) end |
Instance Method Details
#serialize ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/svix/models/message_attempt_log.rb', line 86 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["attemptCount"] = Svix::serialize_primitive(@attempt_count) if @attempt_count out["attemptEnd"] = Svix::serialize_primitive(@attempt_end) if @attempt_end out["attemptId"] = Svix::serialize_primitive(@attempt_id) if @attempt_id out["attemptStart"] = Svix::serialize_primitive(@attempt_start) if @attempt_start out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id out["eventType"] = Svix::serialize_primitive(@event_type) if @event_type out["httpTimes"] = Svix::serialize_schema_ref(@http_times) if @http_times out["msgCreated"] = Svix::serialize_primitive(@msg_created) if @msg_created out["msgEventId"] = Svix::serialize_primitive(@msg_event_id) if @msg_event_id out["msgId"] = Svix::serialize_primitive(@msg_id) if @msg_id out["orgId"] = Svix::serialize_primitive(@org_id) if @org_id out["responseStatusCode"] = Svix::serialize_primitive(@response_status_code) if @response_status_code out["status"] = Svix::serialize_schema_ref(@status) if @status out end |
#to_json ⇒ Object
Serializes the object to a json string
108 109 110 |
# File 'lib/svix/models/message_attempt_log.rb', line 108 def to_json JSON.dump(serialize) end |