Class: SDM::MFAConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: nil, okta: nil, provider: nil) ⇒ MFAConfig

Returns a new instance of MFAConfig.



10840
10841
10842
10843
10844
10845
10846
10847
10848
# File 'lib/models/porcelain.rb', line 10840

def initialize(
  enabled: nil,
  okta: nil,
  provider: nil
)
  @enabled = enabled == nil ? false : enabled
  @okta = okta == nil ? nil : okta
  @provider = provider == nil ? "" : provider
end

Instance Attribute Details

#enabledObject

Indicates if MFA is enabled for the organization.



10834
10835
10836
# File 'lib/models/porcelain.rb', line 10834

def enabled
  @enabled
end

#oktaObject

Okta MFA configuration. Future providers will be added to this wrapper.



10836
10837
10838
# File 'lib/models/porcelain.rb', line 10836

def okta
  @okta
end

#providerObject

The MFA provider, one of the MFAProvider constants.



10838
10839
10840
# File 'lib/models/porcelain.rb', line 10838

def provider
  @provider
end

Instance Method Details

#to_json(options = {}) ⇒ Object



10850
10851
10852
10853
10854
10855
10856
# File 'lib/models/porcelain.rb', line 10850

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