Class: SlackWebApi::ObjsUserProfileShort
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SlackWebApi::ObjsUserProfileShort
- Defined in:
- lib/slack_web_api/models/objs_user_profile_short.rb
Overview
ObjsUserProfileShort Model.
Instance Attribute Summary collapse
-
#avatar_hash ⇒ String
TODO: Write general description for this method.
-
#display_name ⇒ String
TODO: Write general description for this method.
-
#display_name_normalized ⇒ String
TODO: Write general description for this method.
-
#first_name ⇒ String
TODO: Write general description for this method.
-
#image_72 ⇒ String
TODO: Write general description for this method.
-
#is_restricted ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#is_ultra_restricted ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#real_name ⇒ String
TODO: Write general description for this method.
-
#real_name_normalized ⇒ String
TODO: Write general description for this method.
-
#team ⇒ 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(avatar_hash:, display_name:, first_name:, image_72:, is_restricted:, is_ultra_restricted:, name:, real_name:, team:, display_name_normalized: SKIP, real_name_normalized: SKIP, additional_properties: nil) ⇒ ObjsUserProfileShort
constructor
A new instance of ObjsUserProfileShort.
-
#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(avatar_hash:, display_name:, first_name:, image_72:, is_restricted:, is_ultra_restricted:, name:, real_name:, team:, display_name_normalized: SKIP, real_name_normalized: SKIP, additional_properties: nil) ⇒ ObjsUserProfileShort
Returns a new instance of ObjsUserProfileShort.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 88 def initialize(avatar_hash:, display_name:, first_name:, image_72:, is_restricted:, is_ultra_restricted:, name:, real_name:, team:, display_name_normalized: SKIP, real_name_normalized: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @avatar_hash = avatar_hash @display_name = display_name @display_name_normalized = display_name_normalized unless display_name_normalized == SKIP @first_name = first_name @image_72 = image_72 @is_restricted = is_restricted @is_ultra_restricted = is_ultra_restricted @name = name @real_name = real_name @real_name_normalized = real_name_normalized unless real_name_normalized == SKIP @team = team @additional_properties = additional_properties end |
Instance Attribute Details
#avatar_hash ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 14 def avatar_hash @avatar_hash end |
#display_name ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 18 def display_name @display_name end |
#display_name_normalized ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 22 def display_name_normalized @display_name_normalized end |
#first_name ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 26 def first_name @first_name end |
#image_72 ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 30 def image_72 @image_72 end |
#is_restricted ⇒ TrueClass | FalseClass
TODO: Write general description for this method
34 35 36 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 34 def is_restricted @is_restricted end |
#is_ultra_restricted ⇒ TrueClass | FalseClass
TODO: Write general description for this method
38 39 40 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 38 def is_ultra_restricted @is_ultra_restricted end |
#name ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 42 def name @name end |
#real_name ⇒ String
TODO: Write general description for this method
46 47 48 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 46 def real_name @real_name end |
#real_name_normalized ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 50 def real_name_normalized @real_name_normalized end |
#team ⇒ String
TODO: Write general description for this method
54 55 56 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 54 def team @team end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 110 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. avatar_hash = hash.key?('avatar_hash') ? hash['avatar_hash'] : nil display_name = hash.key?('display_name') ? hash['display_name'] : nil first_name = hash.key?('first_name') ? hash['first_name'] : nil image_72 = hash.key?('image_72') ? hash['image_72'] : nil is_restricted = hash.key?('is_restricted') ? hash['is_restricted'] : nil is_ultra_restricted = hash.key?('is_ultra_restricted') ? hash['is_ultra_restricted'] : nil name = hash.key?('name') ? hash['name'] : nil real_name = hash.key?('real_name') ? hash['real_name'] : nil team = hash.key?('team') ? hash['team'] : nil display_name_normalized = hash.key?('display_name_normalized') ? hash['display_name_normalized'] : SKIP real_name_normalized = hash.key?('real_name_normalized') ? hash['real_name_normalized'] : 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. ObjsUserProfileShort.new(avatar_hash: avatar_hash, display_name: display_name, first_name: first_name, image_72: image_72, is_restricted: is_restricted, is_ultra_restricted: is_ultra_restricted, name: name, real_name: real_name, team: team, display_name_normalized: display_name_normalized, real_name_normalized: real_name_normalized, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 57 def self.names @_hash = {} if @_hash.nil? @_hash['avatar_hash'] = 'avatar_hash' @_hash['display_name'] = 'display_name' @_hash['display_name_normalized'] = 'display_name_normalized' @_hash['first_name'] = 'first_name' @_hash['image_72'] = 'image_72' @_hash['is_restricted'] = 'is_restricted' @_hash['is_ultra_restricted'] = 'is_ultra_restricted' @_hash['name'] = 'name' @_hash['real_name'] = 'real_name' @_hash['real_name_normalized'] = 'real_name_normalized' @_hash['team'] = 'team' @_hash end |
.nullables ⇒ Object
An array for nullable fields
82 83 84 85 86 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 82 def self.nullables %w[ first_name ] end |
.optionals ⇒ Object
An array for optional fields
74 75 76 77 78 79 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 74 def self.optionals %w[ display_name_normalized real_name_normalized ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
163 164 165 166 167 168 169 170 171 172 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 163 def inspect class_name = self.class.name.split('::').last "<#{class_name} avatar_hash: #{@avatar_hash.inspect}, display_name:"\ " #{@display_name.inspect}, display_name_normalized: #{@display_name_normalized.inspect},"\ " first_name: #{@first_name.inspect}, image_72: #{@image_72.inspect}, is_restricted:"\ " #{@is_restricted.inspect}, is_ultra_restricted: #{@is_ultra_restricted.inspect}, name:"\ " #{@name.inspect}, real_name: #{@real_name.inspect}, real_name_normalized:"\ " #{@real_name_normalized.inspect}, team: #{@team.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
152 153 154 155 156 157 158 159 160 |
# File 'lib/slack_web_api/models/objs_user_profile_short.rb', line 152 def to_s class_name = self.class.name.split('::').last "<#{class_name} avatar_hash: #{@avatar_hash}, display_name: #{@display_name},"\ " display_name_normalized: #{@display_name_normalized}, first_name: #{@first_name},"\ " image_72: #{@image_72}, is_restricted: #{@is_restricted}, is_ultra_restricted:"\ " #{@is_ultra_restricted}, name: #{@name}, real_name: #{@real_name}, real_name_normalized:"\ " #{@real_name_normalized}, team: #{@team}, additional_properties:"\ " #{@additional_properties}>" end |