Class: OpenFga::AuthErrorCode

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

Constant Summary collapse

NO_AUTH_ERROR =
'no_auth_error'.freeze
AUTH_FAILED_INVALID_SUBJECT =
'auth_failed_invalid_subject'.freeze
AUTH_FAILED_INVALID_AUDIENCE =
'auth_failed_invalid_audience'.freeze
AUTH_FAILED_INVALID_ISSUER =
'auth_failed_invalid_issuer'.freeze
INVALID_CLAIMS =
'invalid_claims'.freeze
AUTH_FAILED_INVALID_BEARER_TOKEN =
'auth_failed_invalid_bearer_token'.freeze
BEARER_TOKEN_MISSING =
'bearer_token_missing'.freeze
UNAUTHENTICATED =
'unauthenticated'.freeze
FORBIDDEN =
'forbidden'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



29
30
31
# File 'lib/openfga/models/auth_error_code.rb', line 29

def self.all_vars
  @all_vars ||= [NO_AUTH_ERROR, AUTH_FAILED_INVALID_SUBJECT, AUTH_FAILED_INVALID_AUDIENCE, AUTH_FAILED_INVALID_ISSUER, INVALID_CLAIMS, AUTH_FAILED_INVALID_BEARER_TOKEN, BEARER_TOKEN_MISSING, UNAUTHENTICATED, FORBIDDEN].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:



36
37
38
# File 'lib/openfga/models/auth_error_code.rb', line 36

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:



43
44
45
46
# File 'lib/openfga/models/auth_error_code.rb', line 43

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