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

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

  • account_sid (String) —

    The SID of the Account that created this StreamMessage resource.

  • sid (String) —

    The SID of the Call resource to fetch.



146
147
148
149
150
151
152
153
154
155
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 146

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

#data ⇒ Hash

Returns An arbitrary, schema-less object that contains the Stream Message body. Can be up to 4 KiB in length.

Returns:

  • (Hash) —

    An arbitrary, schema-less object that contains the Stream Message body. Can be up to 4 KiB in length.



166
167
168
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 166

def data
    @properties['data']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



178
179
180
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 178

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

#sid ⇒ String

Returns The unique string that we created to identify the Stream Message resource.

Returns:

  • (String) —

    The unique string that we created to identify the Stream Message resource.



160
161
162
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 160

def sid
    @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



172
173
174
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 172

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