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

Returns a new instance of AccountGrant.



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/models/porcelain.rb', line 382

def initialize(
  id: nil,
  resource_id: nil,
  account_id: nil,
  start_from: nil,
  valid_until: nil
)
  if id != nil
    @id = id
  end
  if resource_id != nil
    @resource_id = resource_id
  end
  if  != nil
    @account_id = 
  end
  if start_from != nil
    @start_from = start_from
  end
  if valid_until != nil
    @valid_until = valid_until
  end
end

Instance Attribute Details

#account_idObject

The id of the attached role of this AccountGrant.



374
375
376
# File 'lib/models/porcelain.rb', line 374

def 
  @account_id
end

#idObject

Unique identifier of the AccountGrant.



370
371
372
# File 'lib/models/porcelain.rb', line 370

def id
  @id
end

#resource_idObject

The id of the composite role of this AccountGrant.



372
373
374
# File 'lib/models/porcelain.rb', line 372

def resource_id
  @resource_id
end

#start_fromObject

The timestamp when the resource will be granted. Optional. Both start_at and end_at must be defined together, or not defined at all.



377
378
379
# File 'lib/models/porcelain.rb', line 377

def start_from
  @start_from
end

#valid_untilObject

The timestamp when the resource grant will expire. Optional. Both start_at and end_at must be defined together, or not defined at all.



380
381
382
# File 'lib/models/porcelain.rb', line 380

def valid_until
  @valid_until
end

Instance Method Details

#to_json(options = {}) ⇒ Object



406
407
408
409
410
411
412
# File 'lib/models/porcelain.rb', line 406

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