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.



8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
# File 'lib/models/porcelain.rb', line 8239

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_id ⇒ Object

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



8229
8230
8231
# File 'lib/models/porcelain.rb', line 8229

def 
  @account_id
end

#group_id ⇒ Object

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



8231
8232
8233
# File 'lib/models/porcelain.rb', line 8231

def group_id
  @group_id
end

#last_accessed ⇒ Object

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



8233
8234
8235
# File 'lib/models/porcelain.rb', line 8233

def last_accessed
  @last_accessed
end

#mapped_identities ⇒ Object

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



8235
8236
8237
# File 'lib/models/porcelain.rb', line 8235

def mapped_identities
  @mapped_identities
end

#origin_id ⇒ Object

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



8237
8238
8239
# File 'lib/models/porcelain.rb', line 8237

def origin_id
  @origin_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8253
8254
8255
8256
8257
8258
8259
# File 'lib/models/porcelain.rb', line 8253

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