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.



8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
# File 'lib/models/porcelain.rb', line 8163

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.



8153
8154
8155
# File 'lib/models/porcelain.rb', line 8153

def 
  @account_id
end

#group_idObject

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



8155
8156
8157
# File 'lib/models/porcelain.rb', line 8155

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.



8157
8158
8159
# File 'lib/models/porcelain.rb', line 8157

def last_accessed
  @last_accessed
end

#mapped_identitiesObject

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



8159
8160
8161
# File 'lib/models/porcelain.rb', line 8159

def mapped_identities
  @mapped_identities
end

#origin_idObject

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



8161
8162
8163
# File 'lib/models/porcelain.rb', line 8161

def origin_id
  @origin_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8177
8178
8179
8180
8181
8182
8183
# File 'lib/models/porcelain.rb', line 8177

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