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.



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

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



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

def data
  @properties['data']
end

#inspectObject

Provide a detailed, user friendly representation



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

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



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

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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