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.



8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
# File 'lib/models/porcelain.rb', line 8747

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.



8739
8740
8741
# File 'lib/models/porcelain.rb', line 8739

def 
  @account_id
end

#idObject

Unique identifier of the IdentityAlias.



8741
8742
8743
# File 'lib/models/porcelain.rb', line 8741

def id
  @id
end

#identity_set_idObject

The identity set.



8743
8744
8745
# File 'lib/models/porcelain.rb', line 8743

def identity_set_id
  @identity_set_id
end

#usernameObject

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



8745
8746
8747
# File 'lib/models/porcelain.rb', line 8745

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8759
8760
8761
8762
8763
8764
8765
# File 'lib/models/porcelain.rb', line 8759

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