Class: Twilio::REST::Preview::Sync::ServiceContext::SyncMapInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/sync/service/sync_map.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, sid: nil) ⇒ SyncMapInstance

Initialize the SyncMapInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this SyncMap resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 300

def initialize(version, payload , service_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'unique_name' => payload['unique_name'],
        'account_sid' => payload['account_sid'],
        'service_sid' => payload['service_sid'],
        'url' => payload['url'],
        'links' => payload['links'],
        'revision' => payload['revision'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'created_by' => payload['created_by'],
    }

    # Context
    @instance_context = nil
    @params = { 'service_sid' => service_sid  || @properties['service_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns:

  • (String)


347
348
349
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 347

def 
    @properties['account_sid']
end

#contextSyncMapContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



326
327
328
329
330
331
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 326

def context
    unless @instance_context
        @instance_context = SyncMapContext.new(@version , @params['service_sid'], @params['sid'])
    end
    @instance_context
end

#created_byString

Returns:

  • (String)


389
390
391
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 389

def created_by
    @properties['created_by']
end

#date_createdTime

Returns:

  • (Time)


377
378
379
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 377

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns:

  • (Time)


383
384
385
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 383

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the SyncMapInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



396
397
398
399
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 396

def delete

    context.delete
end

#fetchSyncMapInstance

Fetch the SyncMapInstance

Returns:



404
405
406
407
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 404

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



432
433
434
435
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 432

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Preview.Sync.SyncMapInstance #{values}>"
end

Returns:

  • (Hash)


365
366
367
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 365

def links
    @properties['links']
end

#revisionString

Returns:

  • (String)


371
372
373
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 371

def revision
    @properties['revision']
end

#service_sidString

Returns:

  • (String)


353
354
355
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 353

def service_sid
    @properties['service_sid']
end

#sidString

Returns:

  • (String)


335
336
337
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 335

def sid
    @properties['sid']
end

#sync_map_itemssync_map_items

Access the sync_map_items

Returns:



412
413
414
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 412

def sync_map_items
    context.sync_map_items
end

#sync_map_permissionssync_map_permissions

Access the sync_map_permissions

Returns:



419
420
421
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 419

def sync_map_permissions
    context.sync_map_permissions
end

#to_sObject

Provide a user friendly representation



425
426
427
428
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 425

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Preview.Sync.SyncMapInstance #{values}>"
end

#unique_nameString

Returns:

  • (String)


341
342
343
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 341

def unique_name
    @properties['unique_name']
end

#urlString

Returns:

  • (String)


359
360
361
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 359

def url
    @properties['url']
end