Class: MistApi::ConstAppCategoryDefinition

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/const_app_category_definition.rb

Overview

ConstAppCategoryDefinition 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(display = nil, key = nil, filters = SKIP, includes = SKIP) ⇒ ConstAppCategoryDefinition

Returns a new instance of ConstAppCategoryDefinition.



51
52
53
54
55
56
# File 'lib/mist_api/models/const_app_category_definition.rb', line 51

def initialize(display = nil, key = nil, filters = SKIP, includes = SKIP)
  @display = display
  @filters = filters unless filters == SKIP
  @includes = includes unless includes == SKIP
  @key = key
end

Instance Attribute Details

#displayString

Description of the app category

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/const_app_category_definition.rb', line 14

def display
  @display
end

#filtersConstAppCategoryDefinitionFilters

Description of the app category



18
19
20
# File 'lib/mist_api/models/const_app_category_definition.rb', line 18

def filters
  @filters
end

#includesArray[String]

List of other App Categories contained by this one

Returns:

  • (Array[String])


22
23
24
# File 'lib/mist_api/models/const_app_category_definition.rb', line 22

def includes
  @includes
end

#keyString

Key name of the app category

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/const_app_category_definition.rb', line 26

def key
  @key
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/mist_api/models/const_app_category_definition.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  display = hash.key?('display') ? hash['display'] : nil
  key = hash.key?('key') ? hash['key'] : nil
  filters = ConstAppCategoryDefinitionFilters.from_hash(hash['filters']) if hash['filters']
  includes = hash.key?('includes') ? hash['includes'] : SKIP

  # Create object from extracted values.
  ConstAppCategoryDefinition.new(display,
                                 key,
                                 filters,
                                 includes)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/mist_api/models/const_app_category_definition.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['display'] = 'display'
  @_hash['filters'] = 'filters'
  @_hash['includes'] = 'includes'
  @_hash['key'] = 'key'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/mist_api/models/const_app_category_definition.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
# File 'lib/mist_api/models/const_app_category_definition.rb', line 39

def self.optionals
  %w[
    filters
    includes
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



83
84
85
86
87
# File 'lib/mist_api/models/const_app_category_definition.rb', line 83

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} display: #{@display.inspect}, filters: #{@filters.inspect}, includes:"\
  " #{@includes.inspect}, key: #{@key.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



76
77
78
79
80
# File 'lib/mist_api/models/const_app_category_definition.rb', line 76

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} display: #{@display}, filters: #{@filters}, includes: #{@includes}, key:"\
  " #{@key}>"
end