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.



1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
# File 'lib/models/porcelain.rb', line 1339

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.



1322
1323
1324
# File 'lib/models/porcelain.rb', line 1322

def 
  @account_grant_id
end

#account_idObject

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



1324
1325
1326
# File 'lib/models/porcelain.rb', line 1324

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.



1327
1328
1329
# File 'lib/models/porcelain.rb', line 1327

def created_at
  @created_at
end

#expires_atObject

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



1329
1330
1331
# File 'lib/models/porcelain.rb', line 1329

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.



1332
1333
1334
# File 'lib/models/porcelain.rb', line 1332

def granted_at
  @granted_at
end

#resource_idObject

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



1334
1335
1336
# File 'lib/models/porcelain.rb', line 1334

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.



1337
1338
1339
# File 'lib/models/porcelain.rb', line 1337

def role_id
  @role_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1357
1358
1359
1360
1361
1362
1363
# File 'lib/models/porcelain.rb', line 1357

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