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.



8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
# File 'lib/models/porcelain.rb', line 8101

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.



8091
8092
8093
# File 'lib/models/porcelain.rb', line 8091

def 
  @account_id
end

#group_idObject

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



8093
8094
8095
# File 'lib/models/porcelain.rb', line 8093

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.



8095
8096
8097
# File 'lib/models/porcelain.rb', line 8095

def last_accessed
  @last_accessed
end

#mapped_identitiesObject

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



8097
8098
8099
# File 'lib/models/porcelain.rb', line 8097

def mapped_identities
  @mapped_identities
end

#origin_idObject

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



8099
8100
8101
# File 'lib/models/porcelain.rb', line 8099

def origin_id
  @origin_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8115
8116
8117
8118
8119
8120
8121
# File 'lib/models/porcelain.rb', line 8115

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