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 id of the attached role of this AccountGrant.
-
#id ⇒ Object
Unique identifier of the AccountGrant.
-
#resource_id ⇒ Object
The id of the composite role 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(id: nil, resource_id: nil, account_id: nil, start_from: nil, valid_until: nil) ⇒ AccountGrant
constructor
A new instance of AccountGrant.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id: nil, resource_id: nil, account_id: nil, start_from: nil, valid_until: nil) ⇒ AccountGrant
Returns a new instance of AccountGrant.
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/models/porcelain.rb', line 385 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 account_id != nil @account_id = 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_id ⇒ Object
The id of the attached role of this AccountGrant.
377 378 379 |
# File 'lib/models/porcelain.rb', line 377 def account_id @account_id end |
#id ⇒ Object
Unique identifier of the AccountGrant.
373 374 375 |
# File 'lib/models/porcelain.rb', line 373 def id @id end |
#resource_id ⇒ Object
The id of the composite role of this AccountGrant.
375 376 377 |
# File 'lib/models/porcelain.rb', line 375 def resource_id @resource_id end |
#start_from ⇒ Object
The timestamp when the resource will be granted. 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 start_from @start_from end |
#valid_until ⇒ Object
The timestamp when the resource grant will expire. Optional. Both start_at and end_at must be defined together, or not defined at all.
383 384 385 |
# File 'lib/models/porcelain.rb', line 383 def valid_until @valid_until end |
Instance Method Details
#to_json(options = {}) ⇒ Object
409 410 411 412 413 414 415 |
# File 'lib/models/porcelain.rb', line 409 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 |