Class: OpenFga::InternalErrorCode

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

Constant Summary collapse

NO_INTERNAL_ERROR =
'no_internal_error'.freeze
INTERNAL_ERROR =
'internal_error'.freeze
DEADLINE_EXCEEDED =
'deadline_exceeded'.freeze
ALREADY_EXISTS =
'already_exists'.freeze
RESOURCE_EXHAUSTED =
'resource_exhausted'.freeze
FAILED_PRECONDITION =
'failed_precondition'.freeze
ABORTED =
'aborted'.freeze
OUT_OF_RANGE =
'out_of_range'.freeze
UNAVAILABLE =
'unavailable'.freeze
DATA_LOSS =
'data_loss'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



30
31
32
# File 'lib/openfga/models/internal_error_code.rb', line 30

def self.all_vars
  @all_vars ||= [NO_INTERNAL_ERROR, INTERNAL_ERROR, DEADLINE_EXCEEDED, ALREADY_EXISTS, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNAVAILABLE, DATA_LOSS].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:



37
38
39
# File 'lib/openfga/models/internal_error_code.rb', line 37

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:



44
45
46
47
# File 'lib/openfga/models/internal_error_code.rb', line 44

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