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 SID of the [Sync Service](www.twilio.com/docs/sync/api/service) the resource is associated with.

  • stream_sid (String) (defaults to: nil)

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



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

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 The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the 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