Class: Authentik::Api::CapabilitiesEnum

Inherits:
Object
  • Object
show all
Defined in:
lib/authentik/api/models/capabilities_enum.rb

Constant Summary collapse

CAN_SAVE_MEDIA =
"can_save_media".freeze
CAN_SAVE_REPORTS =
"can_save_reports".freeze
CAN_GEO_IP =
"can_geo_ip".freeze
CAN_ASN =
"can_asn".freeze
CAN_IMPERSONATE =
"can_impersonate".freeze
CAN_DEBUG =
"can_debug".freeze
IS_ENTERPRISE =
"is_enterprise".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



20
21
22
# File 'lib/authentik/api/models/capabilities_enum.rb', line 20

def self.all_vars
  @all_vars ||= [CAN_SAVE_MEDIA, CAN_SAVE_REPORTS, CAN_GEO_IP, CAN_ASN, CAN_IMPERSONATE, CAN_DEBUG, IS_ENTERPRISE].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



27
28
29
# File 'lib/authentik/api/models/capabilities_enum.rb', line 27

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



34
35
36
37
# File 'lib/authentik/api/models/capabilities_enum.rb', line 34

def build_from_hash(value)
  return value if CapabilitiesEnum.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #CapabilitiesEnum"
end