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

  • service_sid (String) (defaults to: nil)

    The SID of the Sync Service the resource is associated with.

  • stream_sid (String) (defaults to: nil)

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


103
104
105
106
107
108
# 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 Stream Message body.

Returns:

  • (Hash)

    Stream Message body


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

def data
  @properties['data']
end

#inspectObject

Provide a detailed, user friendly representation


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

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


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

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


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

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