Class: Twilio::REST::Sync::V1::ServiceContext::SyncStreamContext::StreamMessageInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, stream_sid: nil) ⇒ StreamMessageInstance

Initialize the StreamMessageInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • service_sid (String) (defaults to: nil)

    The unique SID identifier of the Service Instance.

  • stream_sid (String) (defaults to: nil)

    The unique 34-character SID identifier of the Stream.



111
112
113
114
115
116
117
118
119
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 111

def initialize(version, payload, service_sid: nil, stream_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'data' => payload['data'],
  }
end

Instance Method Details

#dataHash

Returns Stream Message body.

Returns:

  • (Hash)

    Stream Message body.



129
130
131
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 129

def data
  @properties['data']
end

#inspectObject

Provide a detailed, user friendly representation



141
142
143
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 141

def inspect
  "<Twilio.Sync.V1.StreamMessageInstance>"
end

#sidString

Returns Stream Message SID.

Returns:

  • (String)

    Stream Message SID.



123
124
125
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 123

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



135
136
137
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 135

def to_s
  "<Twilio.Sync.V1.StreamMessageInstance>"
end