Class: SDM::IdentityAlias

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

IdentityAliases define the username to be used for a specific account when connecting to a remote resource using that identity set.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id: nil, id: nil, identity_set_id: nil, username: nil) ⇒ IdentityAlias

Returns a new instance of IdentityAlias.



5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
# File 'lib/models/porcelain.rb', line 5667

def initialize(
  account_id: nil,
  id: nil,
  identity_set_id: nil,
  username: nil
)
  @account_id =  == nil ? "" : 
  @id = id == nil ? "" : id
  @identity_set_id = identity_set_id == nil ? "" : identity_set_id
  @username = username == nil ? "" : username
end

Instance Attribute Details

#account_idObject

The account for this identity alias.



5659
5660
5661
# File 'lib/models/porcelain.rb', line 5659

def 
  @account_id
end

#idObject

Unique identifier of the IdentityAlias.



5661
5662
5663
# File 'lib/models/porcelain.rb', line 5661

def id
  @id
end

#identity_set_idObject

The identity set.



5663
5664
5665
# File 'lib/models/porcelain.rb', line 5663

def identity_set_id
  @identity_set_id
end

#usernameObject

The username to be used as the identity alias for this account.



5665
5666
5667
# File 'lib/models/porcelain.rb', line 5665

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5679
5680
5681
5682
5683
5684
5685
# File 'lib/models/porcelain.rb', line 5679

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