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
CAN_REQUEST =
"can_request".freeze
CAN_AGENT_SELF_SERVICE =
"can_agent_self_service".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



22
23
24
# File 'lib/authentik/api/models/capabilities_enum.rb', line 22

def self.all_vars
  @all_vars ||= [CAN_SAVE_MEDIA, CAN_SAVE_REPORTS, CAN_GEO_IP, CAN_ASN, CAN_IMPERSONATE, CAN_DEBUG, IS_ENTERPRISE, CAN_REQUEST, CAN_AGENT_SELF_SERVICE].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



29
30
31
# File 'lib/authentik/api/models/capabilities_enum.rb', line 29

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



36
37
38
39
# File 'lib/authentik/api/models/capabilities_enum.rb', line 36

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