class Twilio::REST::Sync::V1::ServiceContext::SyncStreamInstance

Public Class Methods

new(version, payload, service_sid: nil, sid: nil) click to toggle source

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

Calls superclass method 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

account_sid() click to toggle source

@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
context() click to toggle source

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
created_by() click to toggle source

@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
date_created() click to toggle source

@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
date_expires() click to toggle source

@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
date_updated() click to toggle source

@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() click to toggle source

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() click to toggle source

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
inspect() click to toggle source

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
service_sid() click to toggle source

@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
sid() click to toggle source

@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
stream_messages() click to toggle source

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
to_s() click to toggle source

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
unique_name() click to toggle source

@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(ttl: :unset) click to toggle source

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
url() click to toggle source

@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