Class: MistApi::ConstAlarmDefinition
- Defined in:
- lib/mist_api/models/const_alarm_definition.rb
Overview
ConstAlarmDefinition Model.
Instance Attribute Summary collapse
-
#display ⇒ String
Description of the alarm type.
-
#example ⇒ Object
Description of the alarm type.
-
#fields ⇒ Array[String]
List of fields available in an alarm details payload (in REST APIs & Webhooks); e.g.
-
#group ⇒ String
Group to which the alarm belongs.
-
#key ⇒ String
Key name of the alarm type.
-
#marvis_suggestion_category ⇒ String
Marvis defined category to which the alarm belongs.
-
#severity ⇒ String
Severity of the alarm.
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(display = nil, fields = nil, group = nil, key = nil, severity = nil, example = SKIP, marvis_suggestion_category = SKIP) ⇒ ConstAlarmDefinition
constructor
A new instance of ConstAlarmDefinition.
-
#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(display = nil, fields = nil, group = nil, key = nil, severity = nil, example = SKIP, marvis_suggestion_category = SKIP) ⇒ ConstAlarmDefinition
Returns a new instance of ConstAlarmDefinition.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 68 def initialize(display = nil, fields = nil, group = nil, key = nil, severity = nil, example = SKIP, marvis_suggestion_category = SKIP) @display = display @example = example unless example == SKIP @fields = fields @group = group @key = key unless marvis_suggestion_category == SKIP @marvis_suggestion_category = marvis_suggestion_category end @severity = severity end |
Instance Attribute Details
#display ⇒ String
Description of the alarm type
14 15 16 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 14 def display @display end |
#example ⇒ Object
Description of the alarm type
18 19 20 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 18 def example @example end |
#fields ⇒ Array[String]
List of fields available in an alarm details payload (in REST APIs & Webhooks); e.g. ‘aps`, `switches`, `gateways`, `hostnames`, `ssids`, `bssids`
24 25 26 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 24 def fields @fields end |
#group ⇒ String
Group to which the alarm belongs
28 29 30 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 28 def group @group end |
#key ⇒ String
Key name of the alarm type
32 33 34 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 32 def key @key end |
#marvis_suggestion_category ⇒ String
Marvis defined category to which the alarm belongs
36 37 38 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 36 def marvis_suggestion_category @marvis_suggestion_category end |
#severity ⇒ String
Severity of the alarm
40 41 42 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 40 def severity @severity end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. display = hash.key?('display') ? hash['display'] : nil fields = hash.key?('fields') ? hash['fields'] : nil group = hash.key?('group') ? hash['group'] : nil key = hash.key?('key') ? hash['key'] : nil severity = hash.key?('severity') ? hash['severity'] : nil example = hash.key?('example') ? hash['example'] : SKIP marvis_suggestion_category = hash.key?('marvis_suggestion_category') ? hash['marvis_suggestion_category'] : SKIP # Create object from extracted values. ConstAlarmDefinition.new(display, fields, group, key, severity, example, marvis_suggestion_category) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['display'] = 'display' @_hash['example'] = 'example' @_hash['fields'] = 'fields' @_hash['group'] = 'group' @_hash['key'] = 'key' @_hash['marvis_suggestion_category'] = 'marvis_suggestion_category' @_hash['severity'] = 'severity' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 59 60 61 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 56 def self.optionals %w[ example marvis_suggestion_category ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
116 117 118 119 120 121 122 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 116 def inspect class_name = self.class.name.split('::').last "<#{class_name} display: #{@display.inspect}, example: #{@example.inspect}, fields:"\ " #{@fields.inspect}, group: #{@group.inspect}, key: #{@key.inspect},"\ " marvis_suggestion_category: #{@marvis_suggestion_category.inspect}, severity:"\ " #{@severity.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
108 109 110 111 112 113 |
# File 'lib/mist_api/models/const_alarm_definition.rb', line 108 def to_s class_name = self.class.name.split('::').last "<#{class_name} display: #{@display}, example: #{@example}, fields: #{@fields}, group:"\ " #{@group}, key: #{@key}, marvis_suggestion_category: #{@marvis_suggestion_category},"\ " severity: #{@severity}>" end |