class Twilio::REST::Sync::V1::ServiceContext::SyncStreamInstance
Public Class Methods
Initialize the SyncStreamInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] service_sid
The SID of the {Sync
Service}[https://www.twilio.com/docs/sync/api/service] the resource is associated with.
@param [String] sid The SID of the Stream resource to fetch. @return [SyncStreamInstance] SyncStreamInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 265 def initialize(version, payload, service_sid: nil, sid: nil) 266 super(version) 267 268 # Marshaled Properties 269 @properties = { 270 'sid' => payload['sid'], 271 'unique_name' => payload['unique_name'], 272 'account_sid' => payload['account_sid'], 273 'service_sid' => payload['service_sid'], 274 'url' => payload['url'], 275 'links' => payload['links'], 276 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']), 277 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 278 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 279 'created_by' => payload['created_by'], 280 } 281 282 # Context 283 @instance_context = nil 284 @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } 285 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 312 def account_sid 313 @properties['account_sid'] 314 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SyncStreamContext] SyncStreamContext
for this SyncStreamInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 291 def context 292 unless @instance_context 293 @instance_context = SyncStreamContext.new(@version, @params['service_sid'], @params['sid'], ) 294 end 295 @instance_context 296 end
@return [String] The Identity of the Stream's creator
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 354 def created_by 355 @properties['created_by'] 356 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 342 def date_created 343 @properties['date_created'] 344 end
@return [Time] The ISO 8601 date and time in GMT when the Message Stream expires
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 336 def date_expires 337 @properties['date_expires'] 338 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 348 def date_updated 349 @properties['date_updated'] 350 end
Delete the SyncStreamInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 368 def delete 369 context.delete 370 end
Fetch the SyncStreamInstance
@return [SyncStreamInstance] Fetched SyncStreamInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 361 def fetch 362 context.fetch 363 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 398 def inspect 399 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 400 "<Twilio.Sync.V1.SyncStreamInstance #{values}>" 401 end
@return [String] The URLs of the Stream's nested resources
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 330 def links 331 @properties['links'] 332 end
@return [String] The SID of the Sync
Service that the resource is associated with
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 318 def service_sid 319 @properties['service_sid'] 320 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 300 def sid 301 @properties['sid'] 302 end
Access the stream_messages
@return [stream_messages] stream_messages
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 385 def stream_messages 386 context.stream_messages 387 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 391 def to_s 392 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 393 "<Twilio.Sync.V1.SyncStreamInstance #{values}>" 394 end
@return [String] An application-defined string that uniquely identifies the resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 306 def unique_name 307 @properties['unique_name'] 308 end
Update the SyncStreamInstance
@param [String] ttl How long, {in
seconds}[https://www.twilio.com/docs/sync/limits#sync-payload-limits], before the Stream expires and is deleted (time-to-live).
@return [SyncStreamInstance] Updated SyncStreamInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 378 def update(ttl: :unset) 379 context.update(ttl: ttl, ) 380 end
@return [String] The absolute URL of the Message Stream resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb 324 def url 325 @properties['url'] 326 end