Class: SDM::GrantedRoleEntitlement

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

GrantedRoleEntitlement represents an individual resource entitlement granted through a Role.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group_id: nil, last_accessed: nil, mapped_identities: nil, resource_id: nil) ⇒ GrantedRoleEntitlement

Returns a new instance of GrantedRoleEntitlement.



8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
# File 'lib/models/porcelain.rb', line 8274

def initialize(
  group_id: nil,
  last_accessed: nil,
  mapped_identities: nil,
  resource_id: nil
)
  @group_id = group_id == nil ? "" : group_id
  @last_accessed = last_accessed == nil ? nil : last_accessed
  @mapped_identities = mapped_identities == nil ? nil : mapped_identities
  @resource_id = resource_id == nil ? "" : resource_id
end

Instance Attribute Details

#group_id ⇒ Object

The unique identifier of the group associated with this entitlement, if any.



8265
8266
8267
# File 'lib/models/porcelain.rb', line 8265

def group_id
  @group_id
end

#last_accessed ⇒ Object

The most recent time at which any account in the organization accessed this resource. Empty if the resource has never been accessed.



8268
8269
8270
# File 'lib/models/porcelain.rb', line 8268

def last_accessed
  @last_accessed
end

#mapped_identities ⇒ Object

The mapped identity privileges for this entitlement, such as Kubernetes group memberships.



8270
8271
8272
# File 'lib/models/porcelain.rb', line 8270

def mapped_identities
  @mapped_identities
end

#resource_id ⇒ Object

The unique identifier of the Resource to which the role grants access.



8272
8273
8274
# File 'lib/models/porcelain.rb', line 8272

def resource_id
  @resource_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8286
8287
8288
8289
8290
8291
8292
# File 'lib/models/porcelain.rb', line 8286

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end