class Twilio::REST::Sync::V1::ServiceContext::SyncMapInstance

Public Class Methods

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

Initialize the SyncMapInstance @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 Sync Map resource to fetch. Can be the Sync

Map's `sid` or its `unique_name`.

@return [SyncMapInstance] SyncMapInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
293 def initialize(version, payload, service_sid: nil, sid: nil)
294   super(version)
295 
296   # Marshaled Properties
297   @properties = {
298       'sid' => payload['sid'],
299       'unique_name' => payload['unique_name'],
300       'account_sid' => payload['account_sid'],
301       'service_sid' => payload['service_sid'],
302       'url' => payload['url'],
303       'links' => payload['links'],
304       'revision' => payload['revision'],
305       'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
306       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
307       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
308       'created_by' => payload['created_by'],
309   }
310 
311   # Context
312   @instance_context = nil
313   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
314 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_map.rb
341 def account_sid
342   @properties['account_sid']
343 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 [SyncMapContext] SyncMapContext for this SyncMapInstance

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
320 def context
321   unless @instance_context
322     @instance_context = SyncMapContext.new(@version, @params['service_sid'], @params['sid'], )
323   end
324   @instance_context
325 end
created_by() click to toggle source

@return [String] The identity of the Sync Map's creator

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
389 def created_by
390   @properties['created_by']
391 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_map.rb
377 def date_created
378   @properties['date_created']
379 end
date_expires() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the Sync Map expires

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
371 def date_expires
372   @properties['date_expires']
373 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_map.rb
383 def date_updated
384   @properties['date_updated']
385 end
delete() click to toggle source

Delete the SyncMapInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
403 def delete
404   context.delete
405 end
fetch() click to toggle source

Fetch the SyncMapInstance @return [SyncMapInstance] Fetched SyncMapInstance

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
396 def fetch
397   context.fetch
398 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
442 def inspect
443   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
444   "<Twilio.Sync.V1.SyncMapInstance #{values}>"
445 end
revision() click to toggle source

@return [String] The current revision of the Sync Map, represented as a string

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
365 def revision
366   @properties['revision']
367 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_map.rb
347 def service_sid
348   @properties['service_sid']
349 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
329 def sid
330   @properties['sid']
331 end
sync_map_items() click to toggle source

Access the sync_map_items @return [sync_map_items] sync_map_items

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
422 def sync_map_items
423   context.sync_map_items
424 end
sync_map_permissions() click to toggle source

Access the sync_map_permissions @return [sync_map_permissions] sync_map_permissions

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
429 def sync_map_permissions
430   context.sync_map_permissions
431 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
435 def to_s
436   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
437   "<Twilio.Sync.V1.SyncMapInstance #{values}>"
438 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_map.rb
335 def unique_name
336   @properties['unique_name']
337 end
update(ttl: :unset, collection_ttl: :unset) click to toggle source

Update the SyncMapInstance @param [String] ttl An alias for `collection_ttl`. If both parameters are

provided, this value is ignored.

@param [String] collection_ttl How long, {in

seconds}[https://www.twilio.com/docs/sync/limits#sync-payload-limits], before
the Sync Map expires (time-to-live) and is deleted.

@return [SyncMapInstance] Updated SyncMapInstance

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
415 def update(ttl: :unset, collection_ttl: :unset)
416   context.update(ttl: ttl, collection_ttl: collection_ttl, )
417 end
url() click to toggle source

@return [String] The absolute URL of the Sync Map resource

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb
353 def url
354   @properties['url']
355 end