Class: MistApi::ModuleStatItemErrorsItems

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

Overview

ModuleStatItemErrorsItems 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(since = nil, type = nil, feature = SKIP, minimum_version = SKIP, reason = SKIP) ⇒ ModuleStatItemErrorsItems

Returns a new instance of ModuleStatItemErrorsItems.



57
58
59
60
61
62
63
64
# File 'lib/mist_api/models/module_stat_item_errors_items.rb', line 57

def initialize(since = nil, type = nil, feature = SKIP,
               minimum_version = SKIP, reason = SKIP)
  @feature = feature unless feature == SKIP
  @minimum_version = minimum_version unless minimum_version == SKIP
  @reason = reason unless reason == SKIP
  @since = since
  @type = type
end

Instance Attribute Details

#featureString

TODO: Write general description for this method

Returns:

  • (String)


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

def feature
  @feature
end

#minimum_versionString

TODO: Write general description for this method

Returns:

  • (String)


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

def minimum_version
  @minimum_version
end

#reasonString

TODO: Write general description for this method

Returns:

  • (String)


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

def reason
  @reason
end

#sinceInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def since
  @since
end

#typeString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/mist_api/models/module_stat_item_errors_items.rb', line 30

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mist_api/models/module_stat_item_errors_items.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  since = hash.key?('since') ? hash['since'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  feature = hash.key?('feature') ? hash['feature'] : SKIP
  minimum_version =
    hash.key?('minimum_version') ? hash['minimum_version'] : SKIP
  reason = hash.key?('reason') ? hash['reason'] : SKIP

  # Create object from extracted values.
  ModuleStatItemErrorsItems.new(since,
                                type,
                                feature,
                                minimum_version,
                                reason)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/mist_api/models/module_stat_item_errors_items.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['feature'] = 'feature'
  @_hash['minimum_version'] = 'minimum_version'
  @_hash['reason'] = 'reason'
  @_hash['since'] = 'since'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



53
54
55
# File 'lib/mist_api/models/module_stat_item_errors_items.rb', line 53

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
# File 'lib/mist_api/models/module_stat_item_errors_items.rb', line 44

def self.optionals
  %w[
    feature
    minimum_version
    reason
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
# File 'lib/mist_api/models/module_stat_item_errors_items.rb', line 94

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} feature: #{@feature.inspect}, minimum_version: #{@minimum_version.inspect},"\
  " reason: #{@reason.inspect}, since: #{@since.inspect}, type: #{@type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



87
88
89
90
91
# File 'lib/mist_api/models/module_stat_item_errors_items.rb', line 87

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} feature: #{@feature}, minimum_version: #{@minimum_version}, reason:"\
  " #{@reason}, since: #{@since}, type: #{@type}>"
end