Class: AmzSpApi::EasyShipModel::Code

Inherits:
Object
  • Object
show all
Defined in:
lib/easy-ship-model/models/code.rb

Constant Summary collapse

INVALID_INPUT =
'InvalidInput'.freeze
INVALID_TIME_SLOT_ID =
'InvalidTimeSlotId'.freeze
SCHEDULED_PACKAGE_ALREADY_EXISTS =
'ScheduledPackageAlreadyExists'.freeze
SCHEDULE_WINDOW_EXPIRED =
'ScheduleWindowExpired'.freeze
RETRYABLE_AFTER_GETTING_NEW_SLOTS =
'RetryableAfterGettingNewSlots'.freeze
TIME_SLOT_NOT_AVAILABLE =
'TimeSlotNotAvailable'.freeze
RESOURCE_NOT_FOUND =
'ResourceNotFound'.freeze
INVALID_ORDER_STATE =
'InvalidOrderState'.freeze
REGION_NOT_SUPPORTED =
'RegionNotSupported'.freeze
ORDER_NOT_ELIGIBLE_FOR_RESCHEDULING =
'OrderNotEligibleForRescheduling'.freeze
INTERNAL_SERVER_ERROR =
'InternalServerError'.freeze

Instance Method Summary collapse

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:



31
32
33
34
35
# File 'lib/easy-ship-model/models/code.rb', line 31

def build_from_hash(value)
  constantValues = Code.constants.select { |c| Code::const_get(c) == value }
  raise "Invalid ENUM value #{value} for class #Code" if constantValues.empty?
  value
end