class Twilio::REST::Sync::V1::ServiceContext::SyncMapContext::SyncMapPermissionInstance

Public Class Methods

new(version, payload, service_sid: nil, map_sid: nil, identity: nil) click to toggle source

Initialize the SyncMapPermissionInstance @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] map_sid The SID of the Sync Map to which the Permission applies. @param [String] identity The application-defined string that uniquely identifies

the User's Sync Map Permission resource to fetch.

@return [SyncMapPermissionInstance] SyncMapPermissionInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
245 def initialize(version, payload, service_sid: nil, map_sid: nil, identity: nil)
246   super(version)
247 
248   # Marshaled Properties
249   @properties = {
250       'account_sid' => payload['account_sid'],
251       'service_sid' => payload['service_sid'],
252       'map_sid' => payload['map_sid'],
253       'identity' => payload['identity'],
254       'read' => payload['read'],
255       'write' => payload['write'],
256       'manage' => payload['manage'],
257       'url' => payload['url'],
258   }
259 
260   # Context
261   @instance_context = nil
262   @params = {
263       'service_sid' => service_sid,
264       'map_sid' => map_sid,
265       'identity' => identity || @properties['identity'],
266   }
267 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
287 def account_sid
288   @properties['account_sid']
289 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SyncMapPermissionContext] SyncMapPermissionContext for this SyncMapPermissionInstance

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
273 def context
274   unless @instance_context
275     @instance_context = SyncMapPermissionContext.new(
276         @version,
277         @params['service_sid'],
278         @params['map_sid'],
279         @params['identity'],
280     )
281   end
282   @instance_context
283 end
delete() click to toggle source

Delete the SyncMapPermissionInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
343 def delete
344   context.delete
345 end
fetch() click to toggle source

Fetch the SyncMapPermissionInstance @return [SyncMapPermissionInstance] Fetched SyncMapPermissionInstance

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
336 def fetch
337   context.fetch
338 end
identity() click to toggle source

@return [String] The identity of the user to whom the Sync Document Permission applies

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
305 def identity
306   @properties['identity']
307 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
369 def inspect
370   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
371   "<Twilio.Sync.V1.SyncMapPermissionInstance #{values}>"
372 end
manage() click to toggle source

@return [Boolean] Manage access

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
323 def manage
324   @properties['manage']
325 end
map_sid() click to toggle source

@return [String] Sync Map SID

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
299 def map_sid
300   @properties['map_sid']
301 end
read() click to toggle source

@return [Boolean] Read access

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
311 def read
312   @properties['read']
313 end
service_sid() click to toggle source

@return [String] The SID of the Sync Service that the resource is associated with

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
293 def service_sid
294   @properties['service_sid']
295 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
362 def to_s
363   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
364   "<Twilio.Sync.V1.SyncMapPermissionInstance #{values}>"
365 end
update(read: nil, write: nil, manage: nil) click to toggle source

Update the SyncMapPermissionInstance @param [Boolean] read Whether the identity can read the Sync Map and its Items.

Default value is `false`.

@param [Boolean] write Whether the identity can create, update, and delete Items

in the Sync Map. Default value is `false`.

@param [Boolean] manage Whether the identity can delete the Sync Map. Default

value is `false`.

@return [SyncMapPermissionInstance] Updated SyncMapPermissionInstance

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
356 def update(read: nil, write: nil, manage: nil)
357   context.update(read: read, write: write, manage: manage, )
358 end
url() click to toggle source

@return [String] The absolute URL of the Sync Map Permission resource

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
329 def url
330   @properties['url']
331 end
write() click to toggle source

@return [Boolean] Write access

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
317 def write
318   @properties['write']
319 end