Class: SDM::AccountGrant

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(access_rule: nil, account_id: nil, id: nil, resource_id: nil, start_from: nil, valid_until: nil) ⇒ AccountGrant



1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
# File 'lib/models/porcelain.rb', line 1474

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 =  == nil ? "" : 
  @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_ruleObject

The access rule associated with this AccountGrant.



1462
1463
1464
# File 'lib/models/porcelain.rb', line 1462

def access_rule
  @access_rule
end

#account_idObject

The account ID of this AccountGrant.



1464
1465
1466
# File 'lib/models/porcelain.rb', line 1464

def 
  @account_id
end

#idObject

Unique identifier of the AccountGrant.



1466
1467
1468
# File 'lib/models/porcelain.rb', line 1466

def id
  @id
end

#resource_idObject

The resource ID of this AccountGrant.



1468
1469
1470
# File 'lib/models/porcelain.rb', line 1468

def resource_id
  @resource_id
end

#start_fromObject

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.



1470
1471
1472
# File 'lib/models/porcelain.rb', line 1470

def start_from
  @start_from
end

#valid_untilObject

The timestamp when the resource grant will expire.



1472
1473
1474
# File 'lib/models/porcelain.rb', line 1472

def valid_until
  @valid_until
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1490
1491
1492
1493
1494
1495
1496
# File 'lib/models/porcelain.rb', line 1490

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