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.
-
#update(ttl: :unset) ⇒ SyncStreamInstance
Update the SyncStreamInstance.
Constructor Details
#initialize(version, service_sid, sid) ⇒ SyncStreamContext
Initialize the SyncStreamContext
177 178 179 180 181 182 183 184 185 186 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 177 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
211 212 213 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 211 def delete @version.delete('delete', @uri) end |
#fetch ⇒ SyncStreamInstance
Fetch a SyncStreamInstance
191 192 193 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 191 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
241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 241 def unless = StreamMessageList.new( @version, service_sid: @solution[:service_sid], stream_sid: @solution[:sid], ) end end |
#to_s ⇒ Object
Provide a user friendly representation
255 256 257 258 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 255 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncStreamContext #{context}>" end |
#update(ttl: :unset) ⇒ SyncStreamInstance
Update the SyncStreamInstance
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb', line 220 def update(ttl: :unset) data = Twilio::Values.of({'Ttl' => ttl, }) payload = @version.update( 'POST', @uri, data: data, ) SyncStreamInstance.new( @version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) end |