Class: SlackWebApi::ObjsTeamProfileField

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

Overview

ObjsTeamProfileField Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(hint:, id:, label:, ordering:, type:, field_name: SKIP, is_hidden: SKIP, options: SKIP, possible_values: SKIP, additional_properties: nil) ⇒ ObjsTeamProfileField

Returns a new instance of ObjsTeamProfileField.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 81

def initialize(hint:, id:, label:, ordering:, type:, field_name: SKIP,
               is_hidden: SKIP, options: SKIP, possible_values: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance

  additional_properties = {} if additional_properties.nil?

  @field_name = field_name unless field_name == SKIP
  @hint = hint
  @id = id
  @is_hidden = is_hidden unless is_hidden == SKIP
  @label = label
  @options = options unless options == SKIP
  @ordering = ordering
  @possible_values = possible_values unless possible_values == SKIP
  @type = type
  @additional_properties = additional_properties
end

Instance Attribute Details

#field_nameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 14

def field_name
  @field_name
end

#hintString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 18

def hint
  @hint
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 22

def id
  @id
end

#is_hiddenTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


26
27
28
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 26

def is_hidden
  @is_hidden
end

#labelString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 30

def label
  @label
end

#optionsObject

TODO: Write general description for this method

Returns:

  • (Object)


34
35
36
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 34

def options
  @options
end

#orderingFloat

TODO: Write general description for this method

Returns:

  • (Float)


38
39
40
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 38

def ordering
  @ordering
end

#possible_valuesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


42
43
44
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 42

def possible_values
  @possible_values
end

#typeType

TODO: Write general description for this method

Returns:



46
47
48
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 46

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 100

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  hint = hash.key?('hint') ? hash['hint'] : nil
  id = hash.key?('id') ? hash['id'] : nil
  label = hash.key?('label') ? hash['label'] : nil
  ordering = hash.key?('ordering') ? hash['ordering'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  field_name = hash.key?('field_name') ? hash['field_name'] : SKIP
  is_hidden = hash.key?('is_hidden') ? hash['is_hidden'] : SKIP
  options = hash.key?('options') ? hash['options'] : SKIP
  possible_values =
    hash.key?('possible_values') ? hash['possible_values'] : 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.

  ObjsTeamProfileField.new(hint: hint,
                           id: id,
                           label: label,
                           ordering: ordering,
                           type: type,
                           field_name: field_name,
                           is_hidden: is_hidden,
                           options: options,
                           possible_values: possible_values,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 49

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['field_name'] = 'field_name'
  @_hash['hint'] = 'hint'
  @_hash['id'] = 'id'
  @_hash['is_hidden'] = 'is_hidden'
  @_hash['label'] = 'label'
  @_hash['options'] = 'options'
  @_hash['ordering'] = 'ordering'
  @_hash['possible_values'] = 'possible_values'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



74
75
76
77
78
79
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 74

def self.nullables
  %w[
    field_name
    possible_values
  ]
end

.optionalsObject

An array for optional fields



64
65
66
67
68
69
70
71
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 64

def self.optionals
  %w[
    field_name
    is_hidden
    options
    possible_values
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



145
146
147
148
149
150
151
152
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 145

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} field_name: #{@field_name.inspect}, hint: #{@hint.inspect}, id:"\
  " #{@id.inspect}, is_hidden: #{@is_hidden.inspect}, label: #{@label.inspect}, options:"\
  " #{@options.inspect}, ordering: #{@ordering.inspect}, possible_values:"\
  " #{@possible_values.inspect}, type: #{@type.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



136
137
138
139
140
141
142
# File 'lib/slack_web_api/models/objs_team_profile_field.rb', line 136

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} field_name: #{@field_name}, hint: #{@hint}, id: #{@id}, is_hidden:"\
  " #{@is_hidden}, label: #{@label}, options: #{@options}, ordering: #{@ordering},"\
  " possible_values: #{@possible_values}, type: #{@type}, additional_properties:"\
  " #{@additional_properties}>"
end