Class: SDM::AccountGrant
- Inherits:
-
Object
- Object
- SDM::AccountGrant
- Defined in:
- lib/models/porcelain.rb
Overview
AccountGrants connect a resource directly to an account, giving the account the permission to connect to that resource.
Instance Attribute Summary collapse
-
#access_rule ⇒ Object
The access rule associated with this AccountGrant.
-
#account_id ⇒ Object
The account ID of this AccountGrant.
-
#id ⇒ Object
Unique identifier of the AccountGrant.
-
#resource_id ⇒ Object
The resource ID of this AccountGrant.
-
#start_from ⇒ Object
The timestamp when the resource will be granted.
-
#valid_until ⇒ Object
The timestamp when the resource grant will expire.
Instance Method Summary collapse
-
#initialize(access_rule: nil, account_id: nil, id: nil, resource_id: nil, start_from: nil, valid_until: nil) ⇒ AccountGrant
constructor
A new instance of AccountGrant.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(access_rule: nil, account_id: nil, id: nil, resource_id: nil, start_from: nil, valid_until: nil) ⇒ AccountGrant
Returns a new instance of AccountGrant.
1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 |
# File 'lib/models/porcelain.rb', line 1413 def initialize( access_rule: nil, account_id: nil, id: nil, resource_id: nil, start_from: nil, valid_until: nil ) @access_rule = access_rule == nil ? SDM::_porcelain_zero_value_access_rule() : access_rule @account_id = account_id == nil ? "" : account_id @id = id == nil ? "" : id @resource_id = resource_id == nil ? "" : resource_id @start_from = start_from == nil ? nil : start_from @valid_until = valid_until == nil ? nil : valid_until end |
Instance Attribute Details
#access_rule ⇒ Object
The access rule associated with this AccountGrant.
1401 1402 1403 |
# File 'lib/models/porcelain.rb', line 1401 def access_rule @access_rule end |
#account_id ⇒ Object
The account ID of this AccountGrant.
1403 1404 1405 |
# File 'lib/models/porcelain.rb', line 1403 def account_id @account_id end |
#id ⇒ Object
Unique identifier of the AccountGrant.
1405 1406 1407 |
# File 'lib/models/porcelain.rb', line 1405 def id @id end |
#resource_id ⇒ Object
The resource ID of this AccountGrant.
1407 1408 1409 |
# File 'lib/models/porcelain.rb', line 1407 def resource_id @resource_id end |
#start_from ⇒ Object
The timestamp when the resource will be granted. When creating an AccountGrant, if this field is not specified, it will default to the current time.
1409 1410 1411 |
# File 'lib/models/porcelain.rb', line 1409 def start_from @start_from end |
#valid_until ⇒ Object
The timestamp when the resource grant will expire.
1411 1412 1413 |
# File 'lib/models/porcelain.rb', line 1411 def valid_until @valid_until end |
Instance Method Details
#to_json(options = {}) ⇒ Object
1429 1430 1431 1432 1433 1434 1435 |
# File 'lib/models/porcelain.rb', line 1429 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 |