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

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/sync/v1/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.



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 498

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 SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Sync List Permission resource.

Returns:



532
533
534
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 532

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:



523
524
525
526
527
528
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 523

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



581
582
583
584
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 581

def delete

    context.delete
end

#fetchSyncListPermissionInstance

Fetch the SyncListPermissionInstance

Returns:



589
590
591
592
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 589

def fetch

    context.fetch
end

#identityString

Returns The application-defined string that uniquely identifies the resource’s User within the Service to an FPA token.

Returns:

  • (String)

    The application-defined string that uniquely identifies the resource’s User within the Service to an FPA token.



550
551
552
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 550

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



622
623
624
625
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 622

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

#list_sidString

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

Returns:

  • (String)

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



544
545
546
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 544

def list_sid
    @properties['list_sid']
end

#manageBoolean

Returns Whether the identity can delete the Sync List.

Returns:

  • (Boolean)

    Whether the identity can delete the Sync List.



568
569
570
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 568

def manage
    @properties['manage']
end

#readBoolean

Returns Whether the identity can read the Sync List and its Items.

Returns:

  • (Boolean)

    Whether the identity can read the Sync List and its Items.



556
557
558
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 556

def read
    @properties['read']
end

#service_sidString

Returns The SID of the [Sync Service](www.twilio.com/docs/sync/api/service) the resource is associated with.

Returns:



538
539
540
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 538

def service_sid
    @properties['service_sid']
end

#to_sObject

Provide a user friendly representation



615
616
617
618
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 615

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

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

Update the SyncListPermissionInstance

Parameters:

  • read (Boolean) (defaults to: nil)

    Whether the identity can read the Sync List and its Items. Default value is ‘false`.

  • write (Boolean) (defaults to: nil)

    Whether the identity can create, update, and delete Items in the Sync List. Default value is ‘false`.

  • manage (Boolean) (defaults to: nil)

    Whether the identity can delete the Sync List. Default value is ‘false`.

Returns:



600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 600

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

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

#urlString

Returns The absolute URL of the Sync List Permission resource.

Returns:

  • (String)

    The absolute URL of the Sync List Permission resource.



574
575
576
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 574

def url
    @properties['url']
end

#writeBoolean

Returns Whether the identity can create, update, and delete Items in the Sync List.

Returns:

  • (Boolean)

    Whether the identity can create, update, and delete Items in the Sync List.



562
563
564
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 562

def write
    @properties['write']
end