Class: Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListPermissionInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, list_sid: nil, identity: nil) ⇒ SyncListPermissionInstance

Initialize the SyncListPermissionInstance

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 SyncListPermission resource.

  • sid (String)

    The SID of the Call resource to fetch.



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 258

def initialize(version, payload , service_sid: nil, list_sid: nil, identity: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'service_sid' => payload['service_sid'],
        'list_sid' => payload['list_sid'],
        'identity' => payload['identity'],
        'read' => payload['read'],
        'write' => payload['write'],
        'manage' => payload['manage'],
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Twilio Account.

Returns:

  • (String)

    The unique SID identifier of the Twilio Account.



291
292
293
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 291

def 
    @properties['account_sid']
end

#contextSyncListPermissionContext

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

Returns:



282
283
284
285
286
287
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 282

def context
    unless @instance_context
        @instance_context = SyncListPermissionContext.new(@version , @params['service_sid'], @params['list_sid'], @params['identity'])
    end
    @instance_context
end

#deleteBoolean

Delete the SyncListPermissionInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



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

def delete

    context.delete
end

#fetchSyncListPermissionInstance

Fetch the SyncListPermissionInstance

Returns:



348
349
350
351
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 348

def fetch

    context.fetch
end

#identityString

Returns Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer.

Returns:

  • (String)

    Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer.



309
310
311
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 309

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



381
382
383
384
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 381

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

#list_sidString

Returns The unique SID identifier of the Sync List to which the Permission applies.

Returns:

  • (String)

    The unique SID identifier of the Sync List to which the Permission applies.



303
304
305
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 303

def list_sid
    @properties['list_sid']
end

#manageBoolean

Returns Boolean flag specifying whether the identity can delete the Sync List.

Returns:

  • (Boolean)

    Boolean flag specifying whether the identity can delete the Sync List.



327
328
329
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 327

def manage
    @properties['manage']
end

#readBoolean

Returns Boolean flag specifying whether the identity can read the Sync List and its Items.

Returns:

  • (Boolean)

    Boolean flag specifying whether the identity can read the Sync List and its Items.



315
316
317
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 315

def read
    @properties['read']
end

#service_sidString

Returns The unique SID identifier of the Sync Service Instance.

Returns:

  • (String)

    The unique SID identifier of the Sync Service Instance.



297
298
299
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 297

def service_sid
    @properties['service_sid']
end

#to_sObject

Provide a user friendly representation



374
375
376
377
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 374

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

#update(read: nil, write: nil, manage: nil) ⇒ SyncListPermissionInstance

Update the SyncListPermissionInstance

Parameters:

  • read (Boolean) (defaults to: nil)

    Boolean flag specifying whether the identity can read the Sync List.

  • write (Boolean) (defaults to: nil)

    Boolean flag specifying whether the identity can create, update and delete Items of the Sync List.

  • manage (Boolean) (defaults to: nil)

    Boolean flag specifying whether the identity can delete the Sync List.

Returns:



359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 359

def update(
    read: nil, 
    write: nil, 
    manage: nil
)

    context.update(
        read: read, 
        write: write, 
        manage: manage, 
    )
end

#urlString

Returns Contains an absolute URL for this Sync List Permission.

Returns:

  • (String)

    Contains an absolute URL for this Sync List Permission.



333
334
335
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 333

def url
    @properties['url']
end

#writeBoolean

Returns Boolean flag specifying whether the identity can create, update and delete Items of the Sync List.

Returns:

  • (Boolean)

    Boolean flag specifying whether the identity can create, update and delete Items of the Sync List.



321
322
323
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 321

def write
    @properties['write']
end