Class: MistApi::ResponseAutoZoneStatusEnum

Inherits:
Object
  • Object
show all
Defined in:
lib/mist_api/models/response_auto_zone_status_enum.rb

Overview

The status for the auto zones service for a given map. enum: * not_started: The auto zones service has not been run on this map or the results were cleared by the user * in_progress: The auto zones service is currently in progress * awaiting_review: The auto zones service has completed and suggested location zones to be added to the map * error: There was an error with the auto zones service

Constant Summary collapse

RESPONSE_AUTO_ZONE_STATUS_ENUM =
[
  # TODO: Write general description for IN_PROGRESS
  IN_PROGRESS = 'in_progress'.freeze,

  # TODO: Write general description for AWAITING_REVIEW
  AWAITING_REVIEW = 'awaiting_review'.freeze,

  # TODO: Write general description for NOT_STARTED
  NOT_STARTED = 'not_started'.freeze,

  # TODO: Write general description for ERROR
  ERROR = 'error'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = IN_PROGRESS) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/mist_api/models/response_auto_zone_status_enum.rb', line 34

def self.from_value(value, default_value = IN_PROGRESS)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'in_progress' then IN_PROGRESS
  when 'awaiting_review' then AWAITING_REVIEW
  when 'not_started' then NOT_STARTED
  when 'error' then ERROR
  else
    default_value
  end
end

.validate(value) ⇒ Object



28
29
30
31
32
# File 'lib/mist_api/models/response_auto_zone_status_enum.rb', line 28

def self.validate(value)
  return false if value.nil?

  RESPONSE_AUTO_ZONE_STATUS_ENUM.include?(value)
end