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_request_id: nil, access_rule: nil, account_id: nil, id: nil, resource_id: nil, start_from: nil, valid_until: nil) ⇒ AccountGrant

Returns a new instance of AccountGrant.



1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
# File 'lib/models/porcelain.rb', line 1733

def initialize(
  access_request_id: nil,
  access_rule: nil,
  account_id: nil,
  id: nil,
  resource_id: nil,
  start_from: nil,
  valid_until: nil
)
  @access_request_id = access_request_id == nil ? "" : access_request_id
  @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_request_idObject

The access request ID that created this AccountGrant, if any.



1719
1720
1721
# File 'lib/models/porcelain.rb', line 1719

def access_request_id
  @access_request_id
end

#access_ruleObject

The access rule associated with this AccountGrant.



1721
1722
1723
# File 'lib/models/porcelain.rb', line 1721

def access_rule
  @access_rule
end

#account_idObject

The account ID of this AccountGrant.



1723
1724
1725
# File 'lib/models/porcelain.rb', line 1723

def 
  @account_id
end

#idObject

Unique identifier of the AccountGrant.



1725
1726
1727
# File 'lib/models/porcelain.rb', line 1725

def id
  @id
end

#resource_idObject

The resource ID of this AccountGrant.



1727
1728
1729
# File 'lib/models/porcelain.rb', line 1727

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.



1729
1730
1731
# File 'lib/models/porcelain.rb', line 1729

def start_from
  @start_from
end

#valid_untilObject

The timestamp when the resource grant will expire.



1731
1732
1733
# File 'lib/models/porcelain.rb', line 1731

def valid_until
  @valid_until
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1751
1752
1753
1754
1755
1756
1757
# File 'lib/models/porcelain.rb', line 1751

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