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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

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

  • service_sid (String) (defaults to: nil)

    The unique SID identifier of the Sync Service Instance.

  • list_sid (String) (defaults to: nil)

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

  • identity (String) (defaults to: nil)

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



272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 272

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,
      'list_sid' => list_sid,
      'identity' => identity || @properties['identity'],
  }
end

Instance Method Details

#account_sidString

Returns Twilio Account SID.

Returns:

  • (String)

    Twilio Account SID.



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

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:



300
301
302
303
304
305
306
307
308
309
310
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 300

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

#deleteBoolean

Deletes the SyncListPermissionInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



370
371
372
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 370

def delete
  context.delete
end

#fetchSyncListPermissionInstance

Fetch a SyncListPermissionInstance

Returns:



363
364
365
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 363

def fetch
  context.fetch
end

#identityString

Returns Identity of the user to whom the Sync List Permission applies.

Returns:

  • (String)

    Identity of the user to whom the Sync List Permission applies.



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

def identity
  @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



400
401
402
403
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 400

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

#list_sidString

Returns Sync List SID.

Returns:

  • (String)

    Sync List SID.



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

def list_sid
  @properties['list_sid']
end

#manageBoolean

Returns Manage access.

Returns:

  • (Boolean)

    Manage access.



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

def manage
  @properties['manage']
end

#readBoolean

Returns Read access.

Returns:

  • (Boolean)

    Read access.



338
339
340
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 338

def read
  @properties['read']
end

#service_sidString

Returns Sync Service Instance SID.

Returns:

  • (String)

    Sync Service Instance SID.



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

def service_sid
  @properties['service_sid']
end

#to_sObject

Provide a user friendly representation



393
394
395
396
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 393

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:



383
384
385
386
387
388
389
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 383

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

#urlString

Returns URL of this Sync List Permission.

Returns:

  • (String)

    URL of this Sync List Permission.



356
357
358
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 356

def url
  @properties['url']
end

#writeBoolean

Returns Write access.

Returns:

  • (Boolean)

    Write access.



344
345
346
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 344

def write
  @properties['write']
end