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



8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
# File 'lib/models/porcelain.rb', line 8093

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.



8083
8084
8085
# File 'lib/models/porcelain.rb', line 8083

def 
  @account_id
end

#group_idObject

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



8085
8086
8087
# File 'lib/models/porcelain.rb', line 8085

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.



8087
8088
8089
# File 'lib/models/porcelain.rb', line 8087

def last_accessed
  @last_accessed
end

#mapped_identitiesObject

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



8089
8090
8091
# File 'lib/models/porcelain.rb', line 8089

def mapped_identities
  @mapped_identities
end

#origin_idObject

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



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

def origin_id
  @origin_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8107
8108
8109
8110
8111
8112
8113
# File 'lib/models/porcelain.rb', line 8107

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