Class: SlackWebApi::ApiMethodUsersGetPresence
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SlackWebApi::ApiMethodUsersGetPresence
- Defined in:
- lib/slack_web_api/models/api_method_users_get_presence.rb
Overview
Generated from users.getPresence with shasum e7251aec575d8863f9e0eb38663ae9dc26655f65
Instance Attribute Summary collapse
-
#auto_away ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#connection_count ⇒ Integer
TODO: Write general description for this method.
-
#last_activity ⇒ Integer
TODO: Write general description for this method.
-
#manual_away ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#ok ⇒ String
readonly
TODO: Write general description for this method.
-
#online ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#presence ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(presence:, auto_away: SKIP, connection_count: SKIP, last_activity: SKIP, manual_away: SKIP, online: SKIP, additional_properties: nil) ⇒ ApiMethodUsersGetPresence
constructor
A new instance of ApiMethodUsersGetPresence.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(presence:, auto_away: SKIP, connection_count: SKIP, last_activity: SKIP, manual_away: SKIP, online: SKIP, additional_properties: nil) ⇒ ApiMethodUsersGetPresence
Returns a new instance of ApiMethodUsersGetPresence.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 70 def initialize(presence:, auto_away: SKIP, connection_count: SKIP, last_activity: SKIP, manual_away: SKIP, online: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @auto_away = auto_away unless auto_away == SKIP @connection_count = connection_count unless connection_count == SKIP @last_activity = last_activity unless last_activity == SKIP @manual_away = manual_away unless manual_away == SKIP @ok = 'True' @online = online unless online == SKIP @presence = presence @additional_properties = additional_properties end |
Instance Attribute Details
#auto_away ⇒ TrueClass | FalseClass
TODO: Write general description for this method
15 16 17 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 15 def auto_away @auto_away end |
#connection_count ⇒ Integer
TODO: Write general description for this method
19 20 21 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 19 def connection_count @connection_count end |
#last_activity ⇒ Integer
TODO: Write general description for this method
23 24 25 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 23 def last_activity @last_activity end |
#manual_away ⇒ TrueClass | FalseClass
TODO: Write general description for this method
27 28 29 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 27 def manual_away @manual_away end |
#ok ⇒ String (readonly)
TODO: Write general description for this method
31 32 33 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 31 def ok @ok end |
#online ⇒ TrueClass | FalseClass
TODO: Write general description for this method
35 36 37 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 35 def online @online end |
#presence ⇒ String
TODO: Write general description for this method
39 40 41 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 39 def presence @presence end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 87 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. presence = hash.key?('presence') ? hash['presence'] : nil auto_away = hash.key?('auto_away') ? hash['auto_away'] : SKIP connection_count = hash.key?('connection_count') ? hash['connection_count'] : SKIP last_activity = hash.key?('last_activity') ? hash['last_activity'] : SKIP manual_away = hash.key?('manual_away') ? hash['manual_away'] : SKIP online = hash.key?('online') ? hash['online'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ApiMethodUsersGetPresence.new(presence: presence, auto_away: auto_away, connection_count: connection_count, last_activity: last_activity, manual_away: manual_away, online: online, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['auto_away'] = 'auto_away' @_hash['connection_count'] = 'connection_count' @_hash['last_activity'] = 'last_activity' @_hash['manual_away'] = 'manual_away' @_hash['ok'] = 'ok' @_hash['online'] = 'online' @_hash['presence'] = 'presence' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 66 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
55 56 57 58 59 60 61 62 63 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 55 def self.optionals %w[ auto_away connection_count last_activity manual_away online ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
125 126 127 128 129 130 131 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 125 def inspect class_name = self.class.name.split('::').last "<#{class_name} auto_away: #{@auto_away.inspect}, connection_count:"\ " #{@connection_count.inspect}, last_activity: #{@last_activity.inspect}, manual_away:"\ " #{@manual_away.inspect}, ok: #{@ok.inspect}, online: #{@online.inspect}, presence:"\ " #{@presence.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
117 118 119 120 121 122 |
# File 'lib/slack_web_api/models/api_method_users_get_presence.rb', line 117 def to_s class_name = self.class.name.split('::').last "<#{class_name} auto_away: #{@auto_away}, connection_count: #{@connection_count},"\ " last_activity: #{@last_activity}, manual_away: #{@manual_away}, ok: #{@ok}, online:"\ " #{@online}, presence: #{@presence}, additional_properties: #{@additional_properties}>" end |