class Twilio::REST::Sync::V1::ServiceContext::SyncListContext::SyncListPermissionInstance
Public Class Methods
Initialize the SyncListPermissionInstance
@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] list_sid
The SID of the Sync
List to which the Permission
applies.
@param [String] identity The application-defined string that uniquely identifies
the User's Sync List Permission resource to fetch.
@return [SyncListPermissionInstance] SyncListPermissionInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 247 def initialize(version, payload, service_sid: nil, list_sid: nil, identity: nil) 248 super(version) 249 250 # Marshaled Properties 251 @properties = { 252 'account_sid' => payload['account_sid'], 253 'service_sid' => payload['service_sid'], 254 'list_sid' => payload['list_sid'], 255 'identity' => payload['identity'], 256 'read' => payload['read'], 257 'write' => payload['write'], 258 'manage' => payload['manage'], 259 'url' => payload['url'], 260 } 261 262 # Context 263 @instance_context = nil 264 @params = { 265 'service_sid' => service_sid, 266 'list_sid' => list_sid, 267 'identity' => identity || @properties['identity'], 268 } 269 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/sync_list_permission.rb 289 def account_sid 290 @properties['account_sid'] 291 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 [SyncListPermissionContext] SyncListPermissionContext
for this SyncListPermissionInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 275 def context 276 unless @instance_context 277 @instance_context = SyncListPermissionContext.new( 278 @version, 279 @params['service_sid'], 280 @params['list_sid'], 281 @params['identity'], 282 ) 283 end 284 @instance_context 285 end
Delete the SyncListPermissionInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 345 def delete 346 context.delete 347 end
Fetch the SyncListPermissionInstance
@return [SyncListPermissionInstance] Fetched SyncListPermissionInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 338 def fetch 339 context.fetch 340 end
@return [String] The identity of the user to whom the Sync
List Permission applies
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 307 def identity 308 @properties['identity'] 309 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 371 def inspect 372 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 373 "<Twilio.Sync.V1.SyncListPermissionInstance #{values}>" 374 end
@return [String] The SID of the Sync
List to which the Permission applies
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 301 def list_sid 302 @properties['list_sid'] 303 end
@return [Boolean] Manage access
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 325 def manage 326 @properties['manage'] 327 end
@return [Boolean] Read access
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 313 def read 314 @properties['read'] 315 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/sync_list_permission.rb 295 def service_sid 296 @properties['service_sid'] 297 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 364 def to_s 365 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 366 "<Twilio.Sync.V1.SyncListPermissionInstance #{values}>" 367 end
Update the SyncListPermissionInstance
@param [Boolean] read Whether the identity can read the Sync
List and its Items.
Default value is `false`.
@param [Boolean] write Whether the identity can create, update, and delete Items
in the Sync List. Default value is `false`.
@param [Boolean] manage Whether the identity can delete the Sync
List. Default
value is `false`.
@return [SyncListPermissionInstance] Updated SyncListPermissionInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 358 def update(read: nil, write: nil, manage: nil) 359 context.update(read: read, write: write, manage: manage, ) 360 end
@return [String] The absolute URL of the Sync
List Permission resource
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 331 def url 332 @properties['url'] 333 end
@return [Boolean] Write access
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 319 def write 320 @properties['write'] 321 end