Class: Twilio::REST::Sync::V1::ServiceContext::SyncStreamContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Sync::V1::ServiceContext::SyncStreamContext
- Defined in:
- lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb,
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.
Defined Under Namespace
Classes: StreamMessageInstance, StreamMessageList, StreamMessagePage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the SyncStreamInstance.
-
#fetch ⇒ SyncStreamInstance
Fetch a SyncStreamInstance.
-
#initialize(version, service_sid, sid) ⇒ SyncStreamContext
constructor
Initialize the SyncStreamContext.
-
#stream_messages ⇒ StreamMessageList, StreamMessageContext
Access the stream_messages.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, sid) ⇒ SyncStreamContext
Initialize the SyncStreamContext
194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 194 def initialize(version, service_sid, sid) super(version) # Path Solution @solution = { service_sid: service_sid, sid: sid, } @uri = "/Services/#{@solution[:service_sid]}/Streams/#{@solution[:sid]}" # Dependents = nil end |
Instance Method Details
#delete ⇒ Boolean
Deletes the SyncStreamInstance
231 232 233 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 231 def delete @version.delete('delete', @uri) end |
#fetch ⇒ SyncStreamInstance
Fetch a SyncStreamInstance
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 211 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) SyncStreamInstance.new( @version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) end |
#stream_messages ⇒ StreamMessageList, StreamMessageContext
Access the stream_messages
239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 239 def unless = StreamMessageList.new( @version, service_sid: @solution[:service_sid], stream_sid: @solution[:sid], ) end end |
#to_s ⇒ Object
Provide a user friendly representation
253 254 255 256 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 253 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncStreamContext #{context}>" end |