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.



789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
# File 'lib/models/porcelain.rb', line 789

def initialize(
  account_id: nil,
  id: nil,
  resource_id: nil,
  start_from: nil,
  valid_until: nil
)
  if  != nil
    @account_id = 
  end
  if id != nil
    @id = id
  end
  if resource_id != nil
    @resource_id = resource_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.



777
778
779
# File 'lib/models/porcelain.rb', line 777

def 
  @account_id
end

#idObject

Unique identifier of the AccountGrant.



779
780
781
# File 'lib/models/porcelain.rb', line 779

def id
  @id
end

#resource_idObject

The id of the composite role of this AccountGrant.



781
782
783
# File 'lib/models/porcelain.rb', line 781

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.



784
785
786
# File 'lib/models/porcelain.rb', line 784

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.



787
788
789
# File 'lib/models/porcelain.rb', line 787

def valid_until
  @valid_until
end

Instance Method Details

#to_json(options = {}) ⇒ Object



813
814
815
816
817
818
819
# File 'lib/models/porcelain.rb', line 813

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