Class: Svix::MessageAttemptOut
- Inherits:
-
Object
- Object
- Svix::MessageAttemptOut
- Defined in:
- lib/svix/models/message_attempt_out.rb
Instance Attribute Summary collapse
-
#endpoint_id ⇒ Object
The Endpoint’s ID.
-
#id ⇒ Object
The MessageAttempt’s ID.
-
#msg ⇒ Object
Returns the value of attribute msg.
-
#msg_id ⇒ Object
The Message’s ID.
-
#response ⇒ Object
Returns the value of attribute response.
-
#response_duration_ms ⇒ Object
Response duration in milliseconds.
-
#response_status_code ⇒ Object
Returns the value of attribute response_status_code.
-
#status ⇒ Object
Returns the value of attribute status.
-
#status_text ⇒ Object
Returns the value of attribute status_text.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#trigger_type ⇒ Object
Returns the value of attribute trigger_type.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ MessageAttemptOut
constructor
A new instance of MessageAttemptOut.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ MessageAttemptOut
Returns a new instance of MessageAttemptOut.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/svix/models/message_attempt_out.rb', line 40 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::MessageAttemptOut` 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::MessageAttemptOut") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#endpoint_id ⇒ Object
The Endpoint’s ID.
8 9 10 |
# File 'lib/svix/models/message_attempt_out.rb', line 8 def endpoint_id @endpoint_id end |
#id ⇒ Object
The MessageAttempt’s ID.
10 11 12 |
# File 'lib/svix/models/message_attempt_out.rb', line 10 def id @id end |
#msg ⇒ Object
Returns the value of attribute msg.
11 12 13 |
# File 'lib/svix/models/message_attempt_out.rb', line 11 def msg @msg end |
#msg_id ⇒ Object
The Message’s ID.
13 14 15 |
# File 'lib/svix/models/message_attempt_out.rb', line 13 def msg_id @msg_id end |
#response ⇒ Object
Returns the value of attribute response.
14 15 16 |
# File 'lib/svix/models/message_attempt_out.rb', line 14 def response @response end |
#response_duration_ms ⇒ Object
Response duration in milliseconds.
16 17 18 |
# File 'lib/svix/models/message_attempt_out.rb', line 16 def response_duration_ms @response_duration_ms end |
#response_status_code ⇒ Object
Returns the value of attribute response_status_code.
17 18 19 |
# File 'lib/svix/models/message_attempt_out.rb', line 17 def response_status_code @response_status_code end |
#status ⇒ Object
Returns the value of attribute status.
18 19 20 |
# File 'lib/svix/models/message_attempt_out.rb', line 18 def status @status end |
#status_text ⇒ Object
Returns the value of attribute status_text.
19 20 21 |
# File 'lib/svix/models/message_attempt_out.rb', line 19 def status_text @status_text end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
20 21 22 |
# File 'lib/svix/models/message_attempt_out.rb', line 20 def @timestamp end |
#trigger_type ⇒ Object
Returns the value of attribute trigger_type.
21 22 23 |
# File 'lib/svix/models/message_attempt_out.rb', line 21 def trigger_type @trigger_type end |
#url ⇒ Object
Returns the value of attribute url.
22 23 24 |
# File 'lib/svix/models/message_attempt_out.rb', line 22 def url @url end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/svix/models/message_attempt_out.rb', line 55 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["endpoint_id"] = attributes["endpointId"] attrs["id"] = attributes["id"] attrs["msg"] = Svix::MessageOut.deserialize(attributes["msg"]) if attributes["msg"] attrs["msg_id"] = attributes["msgId"] attrs["response"] = attributes["response"] attrs["response_duration_ms"] = attributes["responseDurationMs"] attrs["response_status_code"] = attributes["responseStatusCode"] attrs["status"] = Svix::MessageStatus.deserialize(attributes["status"]) attrs["status_text"] = Svix::MessageStatusText.deserialize(attributes["statusText"]) attrs["timestamp"] = DateTime.rfc3339(attributes["timestamp"]).to_time attrs["trigger_type"] = Svix::MessageAttemptTriggerType.deserialize(attributes["triggerType"]) attrs["url"] = attributes["url"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/svix/models/message_attempt_out.rb', line 73 def serialize out = Hash.new out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id out["id"] = Svix::serialize_primitive(@id) if @id out["msg"] = Svix::serialize_schema_ref(@msg) if @msg out["msgId"] = Svix::serialize_primitive(@msg_id) if @msg_id out["response"] = Svix::serialize_primitive(@response) if @response out["responseDurationMs"] = Svix::serialize_primitive(@response_duration_ms) if @response_duration_ms out["responseStatusCode"] = Svix::serialize_primitive(@response_status_code) if @response_status_code out["status"] = Svix::serialize_schema_ref(@status) if @status out["statusText"] = Svix::serialize_schema_ref(@status_text) if @status_text out["timestamp"] = Svix::serialize_primitive(@timestamp) if @timestamp out["triggerType"] = Svix::serialize_schema_ref(@trigger_type) if @trigger_type out["url"] = Svix::serialize_primitive(@url) if @url out end |
#to_json ⇒ Object
Serializes the object to a json string
92 93 94 |
# File 'lib/svix/models/message_attempt_out.rb', line 92 def to_json JSON.dump(serialize) end |