class Twilio::REST::Preview::Sync::ServiceContext::SyncMapContext::SyncMapItemInstance

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, map_sid: nil, key: nil) click to toggle source

Initialize the SyncMapItemInstance @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] map_sid The map_sid @param [String] key The key @return [SyncMapItemInstance] SyncMapItemInstance

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

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
320 def account_sid
321   @properties['account_sid']
322 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 [SyncMapItemContext] SyncMapItemContext for this SyncMapItemInstance

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
300 def context
301   unless @instance_context
302     @instance_context = SyncMapItemContext.new(
303         @version,
304         @params['service_sid'],
305         @params['map_sid'],
306         @params['key'],
307     )
308   end
309   @instance_context
310 end
created_by() click to toggle source

@return [String] The created_by

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
368 def created_by
369   @properties['created_by']
370 end
data() click to toggle source

@return [Hash] The data

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
350 def data
351   @properties['data']
352 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
356 def date_created
357   @properties['date_created']
358 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
362 def date_updated
363   @properties['date_updated']
364 end
delete(if_match: :unset) click to toggle source

Delete the SyncMapItemInstance @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_map/sync_map_item.rb
383 def delete(if_match: :unset)
384   context.delete(if_match: if_match, )
385 end
fetch() click to toggle source

Fetch the SyncMapItemInstance @return [SyncMapItemInstance] Fetched SyncMapItemInstance

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
375 def fetch
376   context.fetch
377 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
405 def inspect
406   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
407   "<Twilio.Preview.Sync.SyncMapItemInstance #{values}>"
408 end
key() click to toggle source

@return [String] The key

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
314 def key
315   @properties['key']
316 end
map_sid() click to toggle source

@return [String] The map_sid

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
332 def map_sid
333   @properties['map_sid']
334 end
revision() click to toggle source

@return [String] The revision

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
344 def revision
345   @properties['revision']
346 end
service_sid() click to toggle source

@return [String] The service_sid

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
326 def service_sid
327   @properties['service_sid']
328 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
398 def to_s
399   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
400   "<Twilio.Preview.Sync.SyncMapItemInstance #{values}>"
401 end
update(data: nil, if_match: :unset) click to toggle source

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

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
392 def update(data: nil, if_match: :unset)
393   context.update(data: data, if_match: if_match, )
394 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
338 def url
339   @properties['url']
340 end