Class: Twilio::REST::Sync::V1::ServiceContext::SyncStreamContext::StreamMessageList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Sync::V1::ServiceContext::SyncStreamContext::StreamMessageList
- Defined in:
- lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb
Instance Method Summary collapse
-
#create(data: nil) ⇒ StreamMessageInstance
Create the StreamMessageInstance.
-
#initialize(version, service_sid: nil, stream_sid: nil) ⇒ StreamMessageList
constructor
Initialize the StreamMessageList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid: nil, stream_sid: nil) ⇒ StreamMessageList
Initialize the StreamMessageList
29 30 31 32 33 34 35 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 29 def initialize(version, service_sid: nil, stream_sid: nil) super(version) # Path Solution @solution = { service_sid: service_sid, stream_sid: stream_sid } @uri = "/Services/#{@solution[:service_sid]}/Streams/#{@solution[:stream_sid]}/Messages" end |
Instance Method Details
#create(data: nil) ⇒ StreamMessageInstance
Create the StreamMessageInstance
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 40 def create( data: nil ) data = Twilio::Values.of({ 'Data' => Twilio.serialize_object(data), }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, data: data, headers: headers) StreamMessageInstance.new( @version, payload, service_sid: @solution[:service_sid], stream_sid: @solution[:stream_sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
67 68 69 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb', line 67 def to_s '#<Twilio.Sync.V1.StreamMessageList>' end |