Class: SDM::GrantedResourceEntitlement

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

Overview

GrantedResourceEntitlement represents an individual entitlement of an Account to a Resource, viewed from the resource's perspective.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id: nil, group_id: nil, last_accessed: nil, mapped_identities: nil, origin_id: nil) ⇒ GrantedResourceEntitlement

Returns a new instance of GrantedResourceEntitlement.



8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
# File 'lib/models/porcelain.rb', line 8127

def initialize(
  account_id: nil,
  group_id: nil,
  last_accessed: nil,
  mapped_identities: nil,
  origin_id: nil
)
  @account_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
  @origin_id = origin_id == nil ? "" : origin_id
end

Instance Attribute Details

#account_idObject

The unique identifier of the Account that has access to this resource.



8117
8118
8119
# File 'lib/models/porcelain.rb', line 8117

def 
  @account_id
end

#group_idObject

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



8119
8120
8121
# File 'lib/models/porcelain.rb', line 8119

def group_id
  @group_id
end

#last_accessedObject

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



8121
8122
8123
# File 'lib/models/porcelain.rb', line 8121

def last_accessed
  @last_accessed
end

#mapped_identitiesObject

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



8123
8124
8125
# File 'lib/models/porcelain.rb', line 8123

def mapped_identities
  @mapped_identities
end

#origin_idObject

The unique identifier of the origin of this entitlement (e.g., a Role or AccountGrant ID).



8125
8126
8127
# File 'lib/models/porcelain.rb', line 8125

def origin_id
  @origin_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8141
8142
8143
8144
8145
8146
8147
# File 'lib/models/porcelain.rb', line 8141

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