Class: SDM::AccountResource
- Inherits:
-
Object
- Object
- SDM::AccountResource
- Defined in:
- lib/models/porcelain.rb
Overview
AccountResource represents an individual access grant of a Account to a Resource.
Instance Attribute Summary collapse
-
#account_grant_id ⇒ Object
The unique identifier of the AccountGrant through which the Account was granted access to the Resource.
-
#account_id ⇒ Object
The unique identifier of the Account to which access is granted.
-
#created_at ⇒ Object
The time this grant was created, distinct from 'granted at' in the case where access is scheduled for the future.
-
#expires_at ⇒ Object
The time at which access will expire.
-
#granted_at ⇒ Object
The most recent time at which access was granted.
-
#resource_id ⇒ Object
The unique identifier of the Resource to which access is granted.
-
#role_id ⇒ Object
The unique identifier of the Role through which the Account was granted access to the Resource.
Instance Method Summary collapse
-
#initialize(account_grant_id: nil, account_id: nil, created_at: nil, expires_at: nil, granted_at: nil, resource_id: nil, role_id: nil) ⇒ AccountResource
constructor
A new instance of AccountResource.
- #to_json(options = {}) ⇒ Object
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.
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 |
# File 'lib/models/porcelain.rb', line 1370 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 = account_grant_id == nil ? "" : account_grant_id @account_id = account_id == nil ? "" : account_id @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_id ⇒ Object
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.
1353 1354 1355 |
# File 'lib/models/porcelain.rb', line 1353 def account_grant_id @account_grant_id end |
#account_id ⇒ Object
The unique identifier of the Account to which access is granted.
1355 1356 1357 |
# File 'lib/models/porcelain.rb', line 1355 def account_id @account_id end |
#created_at ⇒ Object
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.
1358 1359 1360 |
# File 'lib/models/porcelain.rb', line 1358 def created_at @created_at end |
#expires_at ⇒ Object
The time at which access will expire. If empty, this access has no expiration.
1360 1361 1362 |
# File 'lib/models/porcelain.rb', line 1360 def expires_at @expires_at end |
#granted_at ⇒ Object
The most recent time at which access was granted. If access was granted, revoked, and granted again, this will reflect the later time.
1363 1364 1365 |
# File 'lib/models/porcelain.rb', line 1363 def granted_at @granted_at end |
#resource_id ⇒ Object
The unique identifier of the Resource to which access is granted.
1365 1366 1367 |
# File 'lib/models/porcelain.rb', line 1365 def resource_id @resource_id end |
#role_id ⇒ Object
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.
1368 1369 1370 |
# File 'lib/models/porcelain.rb', line 1368 def role_id @role_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
1388 1389 1390 1391 1392 1393 1394 |
# File 'lib/models/porcelain.rb', line 1388 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |