Module: EvoleapLicensing::ValidationStatus

Defined in:
lib/evoleap_licensing/types/validation_status.rb

Constant Summary collapse

REGISTRATION_REQUIRED =

Client-only statuses

-101
USER_TAMPERING_DETECTED =
-100
SERVICE_UNREACHABLE =
-99
FULL_LICENSE_ALREADY_CHECKED_OUT =

Server-provided statuses

-17
OFFLINE_CHECKOUT_NOT_SUPPORTED =
-16
INVALID_COMPONENT =
-15
INSUFFICIENT_TOKENS =
-14
ACTIVATION_PENDING =
-13
SESSION_REVOKED =
-12
NO_SEATS_AVAILABLE =
-11
INCONSISTENT_REGISTRATION =
-10
INCONSISTENT_USER =
-9
INSTANCE_NOT_REGISTERED =
-8
USER_NOT_REGISTERED =
-7
INVALID_LICENSE_KEY =
-6
INVALID_PRODUCT_ID =
-5
INSTANCE_DISABLED =
-4
USER_DISABLED =
-3
LICENSE_EXPIRED =
-2
GENERAL_ERROR =
-1
SUCCESS =
0
ALL =
{
  registration_required: REGISTRATION_REQUIRED,
  user_tampering_detected: USER_TAMPERING_DETECTED,
  service_unreachable: SERVICE_UNREACHABLE,
  full_license_already_checked_out: FULL_LICENSE_ALREADY_CHECKED_OUT,
  offline_checkout_not_supported: OFFLINE_CHECKOUT_NOT_SUPPORTED,
  invalid_component: INVALID_COMPONENT,
  insufficient_tokens: INSUFFICIENT_TOKENS,
  activation_pending: ACTIVATION_PENDING,
  session_revoked: SESSION_REVOKED,
  no_seats_available: NO_SEATS_AVAILABLE,
  inconsistent_registration: INCONSISTENT_REGISTRATION,
  inconsistent_user: INCONSISTENT_USER,
  instance_not_registered: INSTANCE_NOT_REGISTERED,
  user_not_registered: USER_NOT_REGISTERED,
  invalid_license_key: INVALID_LICENSE_KEY,
  invalid_product_id: INVALID_PRODUCT_ID,
  instance_disabled: INSTANCE_DISABLED,
  user_disabled: USER_DISABLED,
  license_expired: LICENSE_EXPIRED,
  general_error: GENERAL_ERROR,
  success: SUCCESS
}.freeze
BY_VALUE =
ALL.invert.freeze

Class Method Summary collapse

Class Method Details

.activation_pendingObject



64
# File 'lib/evoleap_licensing/types/validation_status.rb', line 64

def self.activation_pending; ACTIVATION_PENDING; end

.client_only?(value) ⇒ Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/evoleap_licensing/types/validation_status.rb', line 87

def self.client_only?(value)
  value <= SERVICE_UNREACHABLE
end

.full_license_already_checked_outObject



81
# File 'lib/evoleap_licensing/types/validation_status.rb', line 81

def self.full_license_already_checked_out; FULL_LICENSE_ALREADY_CHECKED_OUT; end

.general_errorObject



76
# File 'lib/evoleap_licensing/types/validation_status.rb', line 76

def self.general_error; GENERAL_ERROR; end

.inconsistent_registrationObject



67
# File 'lib/evoleap_licensing/types/validation_status.rb', line 67

def self.inconsistent_registration; INCONSISTENT_REGISTRATION; end

.inconsistent_userObject



68
# File 'lib/evoleap_licensing/types/validation_status.rb', line 68

def self.inconsistent_user; INCONSISTENT_USER; end

.instance_disabledObject



73
# File 'lib/evoleap_licensing/types/validation_status.rb', line 73

def self.instance_disabled; INSTANCE_DISABLED; end

.instance_not_registeredObject



69
# File 'lib/evoleap_licensing/types/validation_status.rb', line 69

def self.instance_not_registered; INSTANCE_NOT_REGISTERED; end

.insufficient_tokensObject



78
# File 'lib/evoleap_licensing/types/validation_status.rb', line 78

def self.insufficient_tokens; INSUFFICIENT_TOKENS; end

.invalid_componentObject



79
# File 'lib/evoleap_licensing/types/validation_status.rb', line 79

def self.invalid_component; INVALID_COMPONENT; end

.invalid_license_keyObject



71
# File 'lib/evoleap_licensing/types/validation_status.rb', line 71

def self.invalid_license_key; INVALID_LICENSE_KEY; end

.invalid_product_idObject



72
# File 'lib/evoleap_licensing/types/validation_status.rb', line 72

def self.invalid_product_id; INVALID_PRODUCT_ID; end

.license_expiredObject



75
# File 'lib/evoleap_licensing/types/validation_status.rb', line 75

def self.license_expired; LICENSE_EXPIRED; end

.name_for(value) ⇒ Object



56
57
58
# File 'lib/evoleap_licensing/types/validation_status.rb', line 56

def self.name_for(value)
  BY_VALUE[value]
end

.no_seats_availableObject



66
# File 'lib/evoleap_licensing/types/validation_status.rb', line 66

def self.no_seats_available; NO_SEATS_AVAILABLE; end

.offline_checkout_not_supportedObject



80
# File 'lib/evoleap_licensing/types/validation_status.rb', line 80

def self.offline_checkout_not_supported; OFFLINE_CHECKOUT_NOT_SUPPORTED; end

.registration_requiredObject

Convenience class methods matching old Enum API



61
# File 'lib/evoleap_licensing/types/validation_status.rb', line 61

def self.registration_required; REGISTRATION_REQUIRED; end

.service_unreachableObject



63
# File 'lib/evoleap_licensing/types/validation_status.rb', line 63

def self.service_unreachable; SERVICE_UNREACHABLE; end

.session_revokedObject



65
# File 'lib/evoleap_licensing/types/validation_status.rb', line 65

def self.session_revoked; SESSION_REVOKED; end

.successObject



77
# File 'lib/evoleap_licensing/types/validation_status.rb', line 77

def self.success; SUCCESS; end

.success?(value) ⇒ Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/evoleap_licensing/types/validation_status.rb', line 83

def self.success?(value)
  value == SUCCESS
end

.user_disabledObject



74
# File 'lib/evoleap_licensing/types/validation_status.rb', line 74

def self.user_disabled; USER_DISABLED; end

.user_not_registeredObject



70
# File 'lib/evoleap_licensing/types/validation_status.rb', line 70

def self.user_not_registered; USER_NOT_REGISTERED; end

.user_tampering_detectedObject



62
# File 'lib/evoleap_licensing/types/validation_status.rb', line 62

def self.user_tampering_detected; USER_TAMPERING_DETECTED; end