Class: MistApi::AlarmSearchResult
- Defined in:
- lib/mist_api/models/alarm_search_result.rb
Overview
AlarmSearchResult Model.
Instance Attribute Summary collapse
-
#component ⇒ String
Component of the alarm.
-
#limit ⇒ Integer
Component of the alarm.
-
#mend ⇒ Integer
Component of the alarm.
-
#mnext ⇒ String
Component of the alarm.
-
#page ⇒ Integer
Component of the alarm.
-
#results ⇒ Array[Alarm]
Component of the alarm.
-
#start ⇒ Integer
Component of the alarm.
-
#total ⇒ Integer
Component 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(mend = nil, limit = nil, results = nil, start = nil, total = nil, component = SKIP, mnext = SKIP, page = SKIP) ⇒ AlarmSearchResult
constructor
A new instance of AlarmSearchResult.
-
#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(mend = nil, limit = nil, results = nil, start = nil, total = nil, component = SKIP, mnext = SKIP, page = SKIP) ⇒ AlarmSearchResult
Returns a new instance of AlarmSearchResult.
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 72 def initialize(mend = nil, limit = nil, results = nil, start = nil, total = nil, component = SKIP, mnext = SKIP, page = SKIP) @component = component unless component == SKIP @mend = mend @limit = limit @mnext = mnext unless mnext == SKIP @page = page unless page == SKIP @results = results @start = start @total = total end |
Instance Attribute Details
#component ⇒ String
Component of the alarm
14 15 16 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 14 def component @component end |
#limit ⇒ Integer
Component of the alarm
22 23 24 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 22 def limit @limit end |
#mend ⇒ Integer
Component of the alarm
18 19 20 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 18 def mend @mend end |
#mnext ⇒ String
Component of the alarm
26 27 28 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 26 def mnext @mnext end |
#page ⇒ Integer
Component of the alarm
30 31 32 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 30 def page @page end |
#results ⇒ Array[Alarm]
Component of the alarm
34 35 36 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 34 def results @results end |
#start ⇒ Integer
Component of the alarm
38 39 40 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 38 def start @start end |
#total ⇒ Integer
Component of the alarm
42 43 44 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 42 def total @total end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 85 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mend = hash.key?('end') ? hash['end'] : nil limit = hash.key?('limit') ? hash['limit'] : nil # Parameter is an array, so we need to iterate through it results = nil unless hash['results'].nil? results = [] hash['results'].each do |structure| results << (Alarm.from_hash(structure) if structure) end end results = nil unless hash.key?('results') start = hash.key?('start') ? hash['start'] : nil total = hash.key?('total') ? hash['total'] : nil component = hash.key?('component') ? hash['component'] : SKIP mnext = hash.key?('next') ? hash['next'] : SKIP page = hash.key?('page') ? hash['page'] : SKIP # Create object from extracted values. AlarmSearchResult.new(mend, limit, results, start, total, component, mnext, page) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['component'] = 'component' @_hash['mend'] = 'end' @_hash['limit'] = 'limit' @_hash['mnext'] = 'next' @_hash['page'] = 'page' @_hash['results'] = 'results' @_hash['start'] = 'start' @_hash['total'] = 'total' @_hash end |
.nullables ⇒ Object
An array for nullable fields
68 69 70 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 68 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 59 def self.optionals %w[ component mnext page ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
126 127 128 129 130 131 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 126 def inspect class_name = self.class.name.split('::').last "<#{class_name} component: #{@component.inspect}, mend: #{@mend.inspect}, limit:"\ " #{@limit.inspect}, mnext: #{@mnext.inspect}, page: #{@page.inspect}, results:"\ " #{@results.inspect}, start: #{@start.inspect}, total: #{@total.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
119 120 121 122 123 |
# File 'lib/mist_api/models/alarm_search_result.rb', line 119 def to_s class_name = self.class.name.split('::').last "<#{class_name} component: #{@component}, mend: #{@mend}, limit: #{@limit}, mnext:"\ " #{@mnext}, page: #{@page}, results: #{@results}, start: #{@start}, total: #{@total}>" end |