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.
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/models/porcelain.rb', line 359 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.
351 352 353 |
# File 'lib/models/porcelain.rb', line 351 def account_id @account_id end |
#id ⇒ Object
Unique identifier of the AccountGrant.
347 348 349 |
# File 'lib/models/porcelain.rb', line 347 def id @id end |
#resource_id ⇒ Object
The id of the composite role of this AccountGrant.
349 350 351 |
# File 'lib/models/porcelain.rb', line 349 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.
354 355 356 |
# File 'lib/models/porcelain.rb', line 354 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.
357 358 359 |
# File 'lib/models/porcelain.rb', line 357 def valid_until @valid_until end |
Instance Method Details
#to_json(options = {}) ⇒ Object
383 384 385 386 387 388 389 |
# File 'lib/models/porcelain.rb', line 383 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 |