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
-
#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(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(account_id: nil, id: nil, resource_id: nil, start_from: nil, valid_until: nil) ⇒ AccountGrant
Returns a new instance of AccountGrant.
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 |
# File 'lib/models/porcelain.rb', line 1061 def initialize( account_id: nil, id: nil, resource_id: nil, start_from: nil, valid_until: nil ) @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
#account_id ⇒ Object
The account ID of this AccountGrant.
1051 1052 1053 |
# File 'lib/models/porcelain.rb', line 1051 def account_id @account_id end |
#id ⇒ Object
Unique identifier of the AccountGrant.
1053 1054 1055 |
# File 'lib/models/porcelain.rb', line 1053 def id @id end |
#resource_id ⇒ Object
The resource ID of this AccountGrant.
1055 1056 1057 |
# File 'lib/models/porcelain.rb', line 1055 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.
1057 1058 1059 |
# File 'lib/models/porcelain.rb', line 1057 def start_from @start_from end |
#valid_until ⇒ Object
The timestamp when the resource grant will expire.
1059 1060 1061 |
# File 'lib/models/porcelain.rb', line 1059 def valid_until @valid_until end |
Instance Method Details
#to_json(options = {}) ⇒ Object
1075 1076 1077 1078 1079 1080 1081 |
# File 'lib/models/porcelain.rb', line 1075 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 |