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

Returns a new instance of AccountGrant.



1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
# File 'lib/models/porcelain.rb', line 1324

def initialize(
  account_id: nil,
  id: nil,
  resource_id: nil,
  start_from: nil,
  valid_until: nil
)
  @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

#account_idObject

The account ID of this AccountGrant.



1314
1315
1316
# File 'lib/models/porcelain.rb', line 1314

def 
  @account_id
end

#idObject

Unique identifier of the AccountGrant.



1316
1317
1318
# File 'lib/models/porcelain.rb', line 1316

def id
  @id
end

#resource_idObject

The resource ID of this AccountGrant.



1318
1319
1320
# File 'lib/models/porcelain.rb', line 1318

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.



1320
1321
1322
# File 'lib/models/porcelain.rb', line 1320

def start_from
  @start_from
end

#valid_untilObject

The timestamp when the resource grant will expire.



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

def valid_until
  @valid_until
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1338
1339
1340
1341
1342
1343
1344
# File 'lib/models/porcelain.rb', line 1338

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