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.



365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/models/porcelain.rb', line 365

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.



358
359
360
# File 'lib/models/porcelain.rb', line 358

def 
  @account_id
end

#idObject

Unique identifier of the AccountGrant.



354
355
356
# File 'lib/models/porcelain.rb', line 354

def id
  @id
end

#resource_idObject

The id of the composite role of this AccountGrant.



356
357
358
# File 'lib/models/porcelain.rb', line 356

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.



361
362
363
# File 'lib/models/porcelain.rb', line 361

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.



364
365
366
# File 'lib/models/porcelain.rb', line 364

def valid_until
  @valid_until
end

Instance Method Details

#to_json(options = {}) ⇒ Object



392
393
394
395
396
397
398
# File 'lib/models/porcelain.rb', line 392

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