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.



103
104
105
106
107
108
109
110
111
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 103

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 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.



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

def data
    @properties['data']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#sidString

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.



116
117
118
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 116

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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