Class: MistApi::SleSummarySleSamples
- Defined in:
- lib/mist_api/models/sle_summary_sle_samples.rb
Overview
SleSummarySleSamples Model.
Instance Attribute Summary collapse
-
#degraded ⇒ Array[Float]
TODO: Write general description for this method.
-
#total ⇒ Array[Float]
TODO: Write general description for this method.
-
#value ⇒ Array[Float]
TODO: Write general description for this method.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(degraded = nil, total = nil, value = nil) ⇒ SleSummarySleSamples
constructor
A new instance of SleSummarySleSamples.
-
#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(degraded = nil, total = nil, value = nil) ⇒ SleSummarySleSamples
Returns a new instance of SleSummarySleSamples.
43 44 45 46 47 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 43 def initialize(degraded = nil, total = nil, value = nil) @degraded = degraded @total = total @value = value end |
Instance Attribute Details
#degraded ⇒ Array[Float]
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 14 def degraded @degraded end |
#total ⇒ Array[Float]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 18 def total @total end |
#value ⇒ Array[Float]
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 22 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 50 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. degraded = hash.key?('degraded') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:NumberOrNull), hash['degraded'] ) : nil total = hash.key?('total') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:NumberOrNull), hash['total'] ) : nil value = hash.key?('value') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:NumberOrNull), hash['value'] ) : nil # Create object from extracted values. SleSummarySleSamples.new(degraded, total, value) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['degraded'] = 'degraded' @_hash['total'] = 'total' @_hash['value'] = 'value' @_hash end |
.nullables ⇒ Object
An array for nullable fields
39 40 41 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 39 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 34 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 72 def self.validate(value) if value.instance_of? self return ( UnionTypeLookUp.get(:NumberOrNull) .validate(value.degraded) and UnionTypeLookUp.get(:NumberOrNull) .validate(value.total) and UnionTypeLookUp.get(:NumberOrNull) .validate(value.value) ) end return false unless value.instance_of? Hash ( UnionTypeLookUp.get(:NumberOrNull) .validate(value['degraded']) and UnionTypeLookUp.get(:NumberOrNull) .validate(value['total']) and UnionTypeLookUp.get(:NumberOrNull) .validate(value['value']) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
103 104 105 106 107 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 103 def inspect class_name = self.class.name.split('::').last "<#{class_name} degraded: #{@degraded.inspect}, total: #{@total.inspect}, value:"\ " #{@value.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 |
# File 'lib/mist_api/models/sle_summary_sle_samples.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} degraded: #{@degraded}, total: #{@total}, value: #{@value}>" end |