Class: SDM::AccountResource

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

Overview

AccountResource represents an individual access grant of a Account to a Resource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_grant_id: nil, account_id: nil, created_at: nil, expires_at: nil, granted_at: nil, resource_id: nil, role_id: nil) ⇒ AccountResource

Returns a new instance of AccountResource.



1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
# File 'lib/models/porcelain.rb', line 1569

def initialize(
  account_grant_id: nil,
  account_id: nil,
  created_at: nil,
  expires_at: nil,
  granted_at: nil,
  resource_id: nil,
  role_id: nil
)
  @account_grant_id =  == nil ? "" : 
  @account_id =  == nil ? "" : 
  @created_at = created_at == nil ? nil : created_at
  @expires_at = expires_at == nil ? nil : expires_at
  @granted_at = granted_at == nil ? nil : granted_at
  @resource_id = resource_id == nil ? "" : resource_id
  @role_id = role_id == nil ? "" : role_id
end

Instance Attribute Details

#account_grant_idObject

The unique identifier of the AccountGrant through which the Account was granted access to the Resource. If empty, access was not granted through an AccountGrant.



1552
1553
1554
# File 'lib/models/porcelain.rb', line 1552

def 
  @account_grant_id
end

#account_idObject

The unique identifier of the Account to which access is granted.



1554
1555
1556
# File 'lib/models/porcelain.rb', line 1554

def 
  @account_id
end

#created_atObject

The time this grant was created, distinct from 'granted at' in the case where access is scheduled for the future. If access was granted, revoked, and granted again, this will reflect the later creation time.



1557
1558
1559
# File 'lib/models/porcelain.rb', line 1557

def created_at
  @created_at
end

#expires_atObject

The time at which access will expire. If empty, this access has no expiration.



1559
1560
1561
# File 'lib/models/porcelain.rb', line 1559

def expires_at
  @expires_at
end

#granted_atObject

The most recent time at which access was granted. If access was granted, revoked, and granted again, this will reflect the later time.



1562
1563
1564
# File 'lib/models/porcelain.rb', line 1562

def granted_at
  @granted_at
end

#resource_idObject

The unique identifier of the Resource to which access is granted.



1564
1565
1566
# File 'lib/models/porcelain.rb', line 1564

def resource_id
  @resource_id
end

#role_idObject

The unique identifier of the Role through which the Account was granted access to the Resource. If empty, access was not granted through an AccountAttachment to a Role.



1567
1568
1569
# File 'lib/models/porcelain.rb', line 1567

def role_id
  @role_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1587
1588
1589
1590
1591
1592
1593
# File 'lib/models/porcelain.rb', line 1587

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