Class: Muxi::Webhook::WebhookEvent
- Inherits:
-
Struct
- Object
- Struct
- Muxi::Webhook::WebhookEvent
- Defined in:
- lib/muxi/webhook.rb
Instance Attribute Summary collapse
-
#clarification ⇒ Object
Returns the value of attribute clarification.
-
#content ⇒ Object
Returns the value of attribute content.
-
#error ⇒ Object
Returns the value of attribute error.
-
#formation_id ⇒ Object
Returns the value of attribute formation_id.
-
#processing_mode ⇒ Object
Returns the value of attribute processing_mode.
-
#processing_time ⇒ Object
Returns the value of attribute processing_time.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
Class Method Summary collapse
Instance Attribute Details
#clarification ⇒ Object
Returns the value of attribute clarification
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def clarification @clarification end |
#content ⇒ Object
Returns the value of attribute content
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def content @content end |
#error ⇒ Object
Returns the value of attribute error
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def error @error end |
#formation_id ⇒ Object
Returns the value of attribute formation_id
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def formation_id @formation_id end |
#processing_mode ⇒ Object
Returns the value of attribute processing_mode
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def processing_mode @processing_mode end |
#processing_time ⇒ Object
Returns the value of attribute processing_time
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def processing_time @processing_time end |
#raw ⇒ Object
Returns the value of attribute raw
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def raw @raw end |
#request_id ⇒ Object
Returns the value of attribute request_id
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def request_id @request_id end |
#status ⇒ Object
Returns the value of attribute status
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def status @status end |
#timestamp ⇒ Object
Returns the value of attribute timestamp
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def @timestamp end |
#user_id ⇒ Object
Returns the value of attribute user_id
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def user_id @user_id end |
#webhook_url ⇒ Object
Returns the value of attribute webhook_url
47 48 49 |
# File 'lib/muxi/webhook.rb', line 47 def webhook_url @webhook_url end |
Class Method Details
.from_hash(data) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/muxi/webhook.rb', line 52 def self.from_hash(data) content = (data["response"] || []).map { |item| ContentItem.from_hash(item) } error = data["error"] ? ErrorDetails.from_hash(data["error"]) : nil clarification = data["status"] == "awaiting_clarification" ? Clarification.from_hash(data) : nil new( request_id: data["id"] || "", status: data["status"] || "unknown", timestamp: data["timestamp"] || 0, content: content, error: error, clarification: clarification, formation_id: data["formation_id"], user_id: data["user_id"], processing_time: data["processing_time"], processing_mode: data["processing_mode"] || "async", webhook_url: data["webhook_url"], raw: data ) end |