class Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListItemInstance

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.

Public Class Methods

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

Initialize the SyncListItemInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The service_sid @param [String] list_sid The list_sid @param [String] index The index @return [SyncListItemInstance] SyncListItemInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
273 def initialize(version, payload, service_sid: nil, list_sid: nil, index: nil)
274   super(version)
275 
276   # Marshaled Properties
277   @properties = {
278       'index' => payload['index'].to_i,
279       'account_sid' => payload['account_sid'],
280       'service_sid' => payload['service_sid'],
281       'list_sid' => payload['list_sid'],
282       'url' => payload['url'],
283       'revision' => payload['revision'],
284       'data' => payload['data'],
285       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
286       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
287       'created_by' => payload['created_by'],
288   }
289 
290   # Context
291   @instance_context = nil
292   @params = {
293       'service_sid' => service_sid,
294       'list_sid' => list_sid,
295       'index' => index || @properties['index'],
296   }
297 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
323 def account_sid
324   @properties['account_sid']
325 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 [SyncListItemContext] SyncListItemContext for this SyncListItemInstance

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
303 def context
304   unless @instance_context
305     @instance_context = SyncListItemContext.new(
306         @version,
307         @params['service_sid'],
308         @params['list_sid'],
309         @params['index'],
310     )
311   end
312   @instance_context
313 end
created_by() click to toggle source

@return [String] The created_by

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
371 def created_by
372   @properties['created_by']
373 end
data() click to toggle source

@return [Hash] The data

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
353 def data
354   @properties['data']
355 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
359 def date_created
360   @properties['date_created']
361 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
365 def date_updated
366   @properties['date_updated']
367 end
delete(if_match: :unset) click to toggle source

Delete the SyncListItemInstance @param [String] if_match The If-Match HTTP request header @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
386 def delete(if_match: :unset)
387   context.delete(if_match: if_match, )
388 end
fetch() click to toggle source

Fetch the SyncListItemInstance @return [SyncListItemInstance] Fetched SyncListItemInstance

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
378 def fetch
379   context.fetch
380 end
index() click to toggle source

@return [String] The index

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
317 def index
318   @properties['index']
319 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
408 def inspect
409   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
410   "<Twilio.Preview.Sync.SyncListItemInstance #{values}>"
411 end
list_sid() click to toggle source

@return [String] The list_sid

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
335 def list_sid
336   @properties['list_sid']
337 end
revision() click to toggle source

@return [String] The revision

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
347 def revision
348   @properties['revision']
349 end
service_sid() click to toggle source

@return [String] The service_sid

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
329 def service_sid
330   @properties['service_sid']
331 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
401 def to_s
402   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
403   "<Twilio.Preview.Sync.SyncListItemInstance #{values}>"
404 end
update(data: nil, if_match: :unset) click to toggle source

Update the SyncListItemInstance @param [Hash] data The data @param [String] if_match The If-Match HTTP request header @return [SyncListItemInstance] Updated SyncListItemInstance

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
395 def update(data: nil, if_match: :unset)
396   context.update(data: data, if_match: if_match, )
397 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
341 def url
342   @properties['url']
343 end