Class: SlackWebApi::Error4

Inherits:
Object
  • Object
show all
Defined in:
lib/slack_web_api/models/error4.rb

Overview

Error4.

Constant Summary collapse

ERROR4 =
[
  # TODO: Write general description for FEATURE_NOT_ENABLED

  FEATURE_NOT_ENABLED = 'feature_not_enabled'.freeze,

  # TODO: Write general description for NOT_AN_ADMIN

  NOT_AN_ADMIN = 'not_an_admin'.freeze,

  # TODO: Write general description for NOT_AN_ENTERPRISE

  NOT_AN_ENTERPRISE = 'not_an_enterprise'.freeze,

  # TODO: Write general description for CHANNEL_NOT_FOUND

  CHANNEL_NOT_FOUND = 'channel_not_found'.freeze,

  # TODO: Write general description for NOT_SUPPORTED

  NOT_SUPPORTED = 'not_supported'.freeze,

  # TODO: Write general description for TEAM_NOT_FOUND

  TEAM_NOT_FOUND = 'team_not_found'.freeze,

  # TODO: Write general description for RESTRICTED_ACTION

  RESTRICTED_ACTION = 'restricted_action'.freeze,

  # TODO: Write general description for MISSING_SCOPE

  MISSING_SCOPE = 'missing_scope'.freeze,

  # TODO: Write general description for LEAVING_TEAM_NOT_IN_CHANNEL

  LEAVING_TEAM_NOT_IN_CHANNEL = 'leaving_team_not_in_channel'.freeze,

  # TODO: Write general description for NO_TEAMS_TO_DISCONNECT

  NO_TEAMS_TO_DISCONNECT = 'no_teams_to_disconnect'.freeze,

  # TODO: Write general description for LEAVING_TEAM_REQUIRED

  LEAVING_TEAM_REQUIRED = 'leaving_team_required'.freeze,

  # TODO: Write general description for CANNOT_KICK_TEAM

  CANNOT_KICK_TEAM = 'cannot_kick_team'.freeze,

  # TODO: Write general description for CANNOT_KICK_HOME_TEAM

  CANNOT_KICK_HOME_TEAM = 'cannot_kick_home_team'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = FEATURE_NOT_ENABLED) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/slack_web_api/models/error4.rb', line 56

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

  str = value.to_s.strip

  case str.downcase
  when 'feature_not_enabled' then FEATURE_NOT_ENABLED
  when 'not_an_admin' then NOT_AN_ADMIN
  when 'not_an_enterprise' then NOT_AN_ENTERPRISE
  when 'channel_not_found' then CHANNEL_NOT_FOUND
  when 'not_supported' then NOT_SUPPORTED
  when 'team_not_found' then TEAM_NOT_FOUND
  when 'restricted_action' then RESTRICTED_ACTION
  when 'missing_scope' then MISSING_SCOPE
  when 'leaving_team_not_in_channel' then LEAVING_TEAM_NOT_IN_CHANNEL
  when 'no_teams_to_disconnect' then NO_TEAMS_TO_DISCONNECT
  when 'leaving_team_required' then LEAVING_TEAM_REQUIRED
  when 'cannot_kick_team' then CANNOT_KICK_TEAM
  when 'cannot_kick_home_team' then CANNOT_KICK_HOME_TEAM
  else
    default_value
  end
end

.validate(value) ⇒ Object



50
51
52
53
54
# File 'lib/slack_web_api/models/error4.rb', line 50

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

  ERROR4.include?(value)
end