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

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 help@twilio.com.

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 unique SID identifier of the Sync Service

Instance.

@param [String] map_sid The unique SID identifier of the Sync Map to which the

Permission applies.

@param [String] identity Arbitrary string identifier representing a user

associated with an FPA token, assigned by the developer.

@return [SyncMapPermissionInstance] SyncMapPermissionInstance

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

Public Instance Methods

account_sid() click to toggle source

@return [String] Twilio Account SID.

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
293 def account_sid
294   @properties['account_sid']
295 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/preview/sync/service/sync_map/sync_map_permission.rb
279 def context
280   unless @instance_context
281     @instance_context = SyncMapPermissionContext.new(
282         @version,
283         @params['service_sid'],
284         @params['map_sid'],
285         @params['identity'],
286     )
287   end
288   @instance_context
289 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
349 def delete
350   context.delete
351 end
fetch() click to toggle source

Fetch the SyncMapPermissionInstance @return [SyncMapPermissionInstance] Fetched SyncMapPermissionInstance

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

@return [String] Identity of the user to whom the Sync Map Permission applies.

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

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
375 def inspect
376   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
377   "<Twilio.Preview.Sync.SyncMapPermissionInstance #{values}>"
378 end
manage() click to toggle source

@return [Boolean] Manage access.

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

@return [String] Sync Map SID.

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

@return [Boolean] Read access.

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
317 def read
318   @properties['read']
319 end
service_sid() click to toggle source

@return [String] Sync Service Instance SID.

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

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
368 def to_s
369   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
370   "<Twilio.Preview.Sync.SyncMapPermissionInstance #{values}>"
371 end
update(read: nil, write: nil, manage: nil) click to toggle source

Update the SyncMapPermissionInstance @param [Boolean] read Boolean flag specifying whether the identity can read the

Sync Map.

@param [Boolean] write Boolean flag specifying whether the identity can create,

update and delete Items of the Sync Map.

@param [Boolean] manage Boolean flag specifying whether the identity can delete

the Sync Map.

@return [SyncMapPermissionInstance] Updated SyncMapPermissionInstance

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
362 def update(read: nil, write: nil, manage: nil)
363   context.update(read: read, write: write, manage: manage, )
364 end
url() click to toggle source

@return [String] URL of this Sync Map Permission.

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
335 def url
336   @properties['url']
337 end
write() click to toggle source

@return [Boolean] Write access.

    # File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
323 def write
324   @properties['write']
325 end