class Twilio::REST::Sync::V1::ServiceContext::SyncMapInstance
Public Class Methods
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
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
@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
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
@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
@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
@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
@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 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 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
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
@return [String] The URLs of the Sync
Map's nested resources
# File lib/twilio-ruby/rest/sync/v1/service/sync_map.rb 359 def links 360 @properties['links'] 361 end
@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
@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
@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
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
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
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
@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 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
@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