Class: Twilio::REST::PreviewIam::Versionless::OrganizationContext::RoleAssignmentInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, organization_sid: nil, sid: nil) ⇒ RoleAssignmentInstance

Initialize the RoleAssignmentInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 267

def initialize(version, payload , organization_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'role_sid' => payload['role_sid'],
        'scope' => payload['scope'],
        'identity' => payload['identity'],
        'code' => payload['code'],
        'message' => payload['message'],
        'more_info' => payload['more_info'],
        'status' => payload['status'],
    }

    # Context
    @instance_context = nil
    @params = { 'organization_sid' => organization_sid  || @properties['organization_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#codeString

Returns Twilio-specific error code.

Returns:

  • (String)

    Twilio-specific error code



324
325
326
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 324

def code
    @properties['code']
end

#contextRoleAssignmentContext

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

Returns:



291
292
293
294
295
296
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 291

def context
    unless @instance_context
        @instance_context = RoleAssignmentContext.new(@version , @params['organization_sid'], @params['sid'])
    end
    @instance_context
end

#deleteBoolean

Delete the RoleAssignmentInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



349
350
351
352
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 349

def delete

    context.delete
end

#identityString

Returns Twilio Sid representing scope of this assignment.

Returns:

  • (String)

    Twilio Sid representing scope of this assignment



318
319
320
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 318

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



363
364
365
366
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 363

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

#messageString

Returns Error message.

Returns:

  • (String)

    Error message



330
331
332
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 330

def message
    @properties['message']
end

#more_infoString

Returns Link to Error Code References.

Returns:

  • (String)

    Link to Error Code References



336
337
338
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 336

def more_info
    @properties['more_info']
end

#role_sidString

Returns Twilio Role Sid representing assigned role.

Returns:

  • (String)

    Twilio Role Sid representing assigned role



306
307
308
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 306

def role_sid
    @properties['role_sid']
end

#scopeString

Returns Twilio Sid representing identity of this assignment.

Returns:

  • (String)

    Twilio Sid representing identity of this assignment



312
313
314
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 312

def scope
    @properties['scope']
end

#sidString

Returns Twilio Role Assignment Sid representing this role assignment.

Returns:

  • (String)

    Twilio Role Assignment Sid representing this role assignment



300
301
302
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 300

def sid
    @properties['sid']
end

#statusString

Returns HTTP response status code.

Returns:

  • (String)

    HTTP response status code



342
343
344
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 342

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



356
357
358
359
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/role_assignment.rb', line 356

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