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 unique SID identifier of the Service Instance.

  • stream_sid (String) (defaults to: nil)

    The unique 34-character SID identifier of the Stream.



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

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.



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

def data
  @properties['data']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#sidString

Returns Stream Message SID.

Returns:

  • (String)

    Stream Message SID.



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

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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