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

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, map_sid: nil, identity: nil) ⇒ SyncMapPermissionInstance

Initialize the SyncMapPermissionInstance

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 SyncMapPermission resource.

  • sid (String)

    The SID of the Call resource to fetch.



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 271

def initialize(version, payload , service_sid: nil, map_sid: nil, identity: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'service_sid' => payload['service_sid'],
        'map_sid' => payload['map_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']  ,'map_sid' => map_sid  || @properties['map_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 Map Permission resource.

Returns:



304
305
306
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 304

def 
    @properties['account_sid']
end

#contextSyncMapPermissionContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



295
296
297
298
299
300
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 295

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

#deleteBoolean

Delete the SyncMapPermissionInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



353
354
355
356
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 353

def delete

    context.delete
end

#fetchSyncMapPermissionInstance

Fetch the SyncMapPermissionInstance

Returns:



361
362
363
364
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 361

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.



322
323
324
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 322

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



394
395
396
397
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 394

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

#manageBoolean

Returns Whether the identity can delete the Sync Map.

Returns:

  • (Boolean)

    Whether the identity can delete the Sync Map.



340
341
342
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 340

def manage
    @properties['manage']
end

#map_sidString

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

Returns:

  • (String)

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



316
317
318
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 316

def map_sid
    @properties['map_sid']
end

#readBoolean

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

Returns:

  • (Boolean)

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



328
329
330
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 328

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:



310
311
312
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 310

def service_sid
    @properties['service_sid']
end

#to_sObject

Provide a user friendly representation



387
388
389
390
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 387

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

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

Update the SyncMapPermissionInstance

Parameters:

  • read (Boolean) (defaults to: nil)

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

  • write (Boolean) (defaults to: nil)

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

  • manage (Boolean) (defaults to: nil)

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

Returns:



372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 372

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 Map Permission resource.

Returns:

  • (String)

    The absolute URL of the Sync Map Permission resource.



346
347
348
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 346

def url
    @properties['url']
end

#writeBoolean

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

Returns:

  • (Boolean)

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



334
335
336
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 334

def write
    @properties['write']
end