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.



10724
10725
10726
10727
10728
10729
10730
10731
10732
# File 'lib/models/porcelain.rb', line 10724

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.



10718
10719
10720
# File 'lib/models/porcelain.rb', line 10718

def enabled
  @enabled
end

#oktaObject

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



10720
10721
10722
# File 'lib/models/porcelain.rb', line 10720

def okta
  @okta
end

#providerObject

The MFA provider, one of the MFAProvider constants.



10722
10723
10724
# File 'lib/models/porcelain.rb', line 10722

def provider
  @provider
end

Instance Method Details

#to_json(options = {}) ⇒ Object



10734
10735
10736
10737
10738
10739
10740
# File 'lib/models/porcelain.rb', line 10734

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