class Twilio::REST::Sync::V1::ServiceContext::SyncListInstance
Public Class Methods
Initialize the SyncListInstance
@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
List resource to fetch. Can be the Sync
List resource's `sid` or its `unique_name`.
@return [SyncListInstance] SyncListInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 294 def initialize(version, payload, service_sid: nil, sid: nil) 295 super(version) 296 297 # Marshaled Properties 298 @properties = { 299 'sid' => payload['sid'], 300 'unique_name' => payload['unique_name'], 301 'account_sid' => payload['account_sid'], 302 'service_sid' => payload['service_sid'], 303 'url' => payload['url'], 304 'links' => payload['links'], 305 'revision' => payload['revision'], 306 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']), 307 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 308 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 309 'created_by' => payload['created_by'], 310 } 311 312 # Context 313 @instance_context = nil 314 @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } 315 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 342 def account_sid 343 @properties['account_sid'] 344 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 [SyncListContext] SyncListContext
for this SyncListInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 321 def context 322 unless @instance_context 323 @instance_context = SyncListContext.new(@version, @params['service_sid'], @params['sid'], ) 324 end 325 @instance_context 326 end
@return [String] The identity of the Sync
List's creator
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 390 def created_by 391 @properties['created_by'] 392 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_list.rb 378 def date_created 379 @properties['date_created'] 380 end
@return [Time] The ISO 8601 date and time in GMT when the Sync
List expires
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 372 def date_expires 373 @properties['date_expires'] 374 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_list.rb 384 def date_updated 385 @properties['date_updated'] 386 end
Delete the SyncListInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 404 def delete 405 context.delete 406 end
Fetch the SyncListInstance
@return [SyncListInstance] Fetched SyncListInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 397 def fetch 398 context.fetch 399 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 443 def inspect 444 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 445 "<Twilio.Sync.V1.SyncListInstance #{values}>" 446 end
@return [String] The URLs of the Sync
List's nested resources
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 360 def links 361 @properties['links'] 362 end
@return [String] The current revision of the Sync
List, represented as a string
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 366 def revision 367 @properties['revision'] 368 end
@return [String] The SID of the Sync
Service that the resource is associated with
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 348 def service_sid 349 @properties['service_sid'] 350 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 330 def sid 331 @properties['sid'] 332 end
Access the sync_list_items
@return [sync_list_items] sync_list_items
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 423 def sync_list_items 424 context.sync_list_items 425 end
Access the sync_list_permissions
@return [sync_list_permissions] sync_list_permissions
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 430 def sync_list_permissions 431 context.sync_list_permissions 432 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 436 def to_s 437 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 438 "<Twilio.Sync.V1.SyncListInstance #{values}>" 439 end
@return [String] An application-defined string that uniquely identifies the resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 336 def unique_name 337 @properties['unique_name'] 338 end
Update the SyncListInstance
@param [String] ttl An alias for `collection_ttl`. If both 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 List expires (time-to-live) and is deleted.
@return [SyncListInstance] Updated SyncListInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 416 def update(ttl: :unset, collection_ttl: :unset) 417 context.update(ttl: ttl, collection_ttl: collection_ttl, ) 418 end
@return [String] The absolute URL of the Sync
List resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_list.rb 354 def url 355 @properties['url'] 356 end