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.



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

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.



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



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