Class: SignalWire::Relay::MessageStateEvent
- Inherits:
-
RelayEvent
- Object
- RelayEvent
- SignalWire::Relay::MessageStateEvent
- Defined in:
- lib/signalwire/relay/relay_event.rb
Overview
messaging.state
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#from_number ⇒ Object
readonly
Returns the value of attribute from_number.
-
#media ⇒ Object
readonly
Returns the value of attribute media.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#message_state ⇒ Object
readonly
Returns the value of attribute message_state.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#to_number ⇒ Object
readonly
Returns the value of attribute to_number.
Attributes inherited from RelayEvent
#call_id, #event_type, #params, #timestamp
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message_id: '', context: '', direction: '', from_number: '', to_number: '', body: '', media: [], segments: 0, message_state: '', reason: '', tags: [], **base) ⇒ MessageStateEvent
constructor
A new instance of MessageStateEvent.
Constructor Details
#initialize(message_id: '', context: '', direction: '', from_number: '', to_number: '', body: '', media: [], segments: 0, message_state: '', reason: '', tags: [], **base) ⇒ MessageStateEvent
Returns a new instance of MessageStateEvent.
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 |
# File 'lib/signalwire/relay/relay_event.rb', line 618 def initialize(message_id: '', context: '', direction: '', from_number: '', to_number: '', body: '', media: [], segments: 0, message_state: '', reason: '', tags: [], **base) super(**base) @message_id = @context = context @direction = direction @from_number = from_number @to_number = to_number @body = body @media = media @segments = segments @message_state = @reason = reason @tags = end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def body @body end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def context @context end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def direction @direction end |
#from_number ⇒ Object (readonly)
Returns the value of attribute from_number.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def from_number @from_number end |
#media ⇒ Object (readonly)
Returns the value of attribute media.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def media @media end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def @message_id end |
#message_state ⇒ Object (readonly)
Returns the value of attribute message_state.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def @message_state end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def reason @reason end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def segments @segments end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def @tags end |
#to_number ⇒ Object (readonly)
Returns the value of attribute to_number.
595 596 597 |
# File 'lib/signalwire/relay/relay_event.rb', line 595 def to_number @to_number end |
Class Method Details
.from_payload(payload) ⇒ Object
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 |
# File 'lib/signalwire/relay/relay_event.rb', line 598 def self.from_payload(payload) base = RelayEvent.from_payload(payload) p = base.params new( event_type: base.event_type, params: base.params, call_id: base.call_id, timestamp: base., message_id: p['message_id'] || '', context: p['context'] || '', direction: p['direction'] || '', from_number: p['from_number'] || '', to_number: p['to_number'] || '', body: p['body'] || '', media: p['media'] || [], segments: p['segments'] || 0, message_state: p['message_state'] || '', reason: p['reason'] || '', tags: p['tags'] || [] ) end |