Class: Verizon::DtoQueryMetricsResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::DtoQueryMetricsResponse
- Defined in:
- lib/verizon/models/dto_query_metrics_response.rb
Overview
DtoQueryMetricsResponse Model.
Instance Attribute Summary collapse
-
#critical ⇒ Integer
The number of critical alerts in the queried time period.
-
#deltacritical ⇒ Integer
The change in the number of critical alerts in the queried time period.
-
#deltamajor ⇒ Integer
The change in the number of major alerts in the queried time period.
-
#deltaminor ⇒ Integer
The change in the number of minor alerts in the queried time period.
-
#deltanoalert ⇒ Integer
The change in the number of sensor reports containing no alerts in the queried time period.
-
#major ⇒ Integer
The number of major alerts in the queried time period.
-
#minor ⇒ Integer
The number of minor alerts in the queried time period.
-
#noalert ⇒ Integer
The number of sensor reports containing no alerts in the queried time period.
-
#total ⇒ Integer
The total number of alerts in the queried time period.
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(critical: SKIP, major: SKIP, minor: SKIP, noalert: SKIP, total: SKIP, deltacritical: SKIP, deltamajor: SKIP, deltaminor: SKIP, deltanoalert: SKIP) ⇒ DtoQueryMetricsResponse
constructor
A new instance of DtoQueryMetricsResponse.
-
#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(critical: SKIP, major: SKIP, minor: SKIP, noalert: SKIP, total: SKIP, deltacritical: SKIP, deltamajor: SKIP, deltaminor: SKIP, deltanoalert: SKIP) ⇒ DtoQueryMetricsResponse
Returns a new instance of DtoQueryMetricsResponse.
85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 85 def initialize(critical: SKIP, major: SKIP, minor: SKIP, noalert: SKIP, total: SKIP, deltacritical: SKIP, deltamajor: SKIP, deltaminor: SKIP, deltanoalert: SKIP) @critical = critical unless critical == SKIP @major = major unless major == SKIP @minor = minor unless minor == SKIP @noalert = noalert unless noalert == SKIP @total = total unless total == SKIP @deltacritical = deltacritical unless deltacritical == SKIP @deltamajor = deltamajor unless deltamajor == SKIP @deltaminor = deltaminor unless deltaminor == SKIP @deltanoalert = deltanoalert unless deltanoalert == SKIP end |
Instance Attribute Details
#critical ⇒ Integer
The number of critical alerts in the queried time period
14 15 16 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 14 def critical @critical end |
#deltacritical ⇒ Integer
The change in the number of critical alerts in the queried time period
35 36 37 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 35 def deltacritical @deltacritical end |
#deltamajor ⇒ Integer
The change in the number of major alerts in the queried time period
39 40 41 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 39 def deltamajor @deltamajor end |
#deltaminor ⇒ Integer
The change in the number of minor alerts in the queried time period
43 44 45 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 43 def deltaminor @deltaminor end |
#deltanoalert ⇒ Integer
The change in the number of sensor reports containing no alerts in the queried time period
48 49 50 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 48 def deltanoalert @deltanoalert end |
#major ⇒ Integer
The number of major alerts in the queried time period
18 19 20 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 18 def major @major end |
#minor ⇒ Integer
The number of minor alerts in the queried time period
22 23 24 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 22 def minor @minor end |
#noalert ⇒ Integer
The number of sensor reports containing no alerts in the queried time period
27 28 29 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 27 def noalert @noalert end |
#total ⇒ Integer
The total number of alerts in the queried time period
31 32 33 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 31 def total @total 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 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 100 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. critical = hash.key?('critical') ? hash['critical'] : SKIP major = hash.key?('major') ? hash['major'] : SKIP minor = hash.key?('minor') ? hash['minor'] : SKIP noalert = hash.key?('noalert') ? hash['noalert'] : SKIP total = hash.key?('total') ? hash['total'] : SKIP deltacritical = hash.key?('deltacritical') ? hash['deltacritical'] : SKIP deltamajor = hash.key?('deltamajor') ? hash['deltamajor'] : SKIP deltaminor = hash.key?('deltaminor') ? hash['deltaminor'] : SKIP deltanoalert = hash.key?('deltanoalert') ? hash['deltanoalert'] : SKIP # Create object from extracted values. DtoQueryMetricsResponse.new(critical: critical, major: major, minor: minor, noalert: noalert, total: total, deltacritical: deltacritical, deltamajor: deltamajor, deltaminor: deltaminor, deltanoalert: deltanoalert) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['critical'] = 'critical' @_hash['major'] = 'major' @_hash['minor'] = 'minor' @_hash['noalert'] = 'noalert' @_hash['total'] = 'total' @_hash['deltacritical'] = 'deltacritical' @_hash['deltamajor'] = 'deltamajor' @_hash['deltaminor'] = 'deltaminor' @_hash['deltanoalert'] = 'deltanoalert' @_hash end |
.nullables ⇒ Object
An array for nullable fields
81 82 83 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 81 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 66 def self.optionals %w[ critical major minor noalert total deltacritical deltamajor deltaminor deltanoalert ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
135 136 137 138 139 140 141 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 135 def inspect class_name = self.class.name.split('::').last "<#{class_name} critical: #{@critical.inspect}, major: #{@major.inspect}, minor:"\ " #{@minor.inspect}, noalert: #{@noalert.inspect}, total: #{@total.inspect}, deltacritical:"\ " #{@deltacritical.inspect}, deltamajor: #{@deltamajor.inspect}, deltaminor:"\ " #{@deltaminor.inspect}, deltanoalert: #{@deltanoalert.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
127 128 129 130 131 132 |
# File 'lib/verizon/models/dto_query_metrics_response.rb', line 127 def to_s class_name = self.class.name.split('::').last "<#{class_name} critical: #{@critical}, major: #{@major}, minor: #{@minor}, noalert:"\ " #{@noalert}, total: #{@total}, deltacritical: #{@deltacritical}, deltamajor:"\ " #{@deltamajor}, deltaminor: #{@deltaminor}, deltanoalert: #{@deltanoalert}>" end |