Class: MistApi::SleThreshold
- Defined in:
- lib/mist_api/models/sle_threshold.rb
Overview
SleThreshold Model.
Instance Attribute Summary collapse
-
#default ⇒ Float
TODO: Write general description for this method.
-
#direction ⇒ String
TODO: Write general description for this method.
-
#maximum ⇒ Float
TODO: Write general description for this method.
-
#metric ⇒ String
TODO: Write general description for this method.
-
#minimum ⇒ Float
TODO: Write general description for this method.
-
#threshold ⇒ String
TODO: Write general description for this method.
-
#units ⇒ String
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.
Instance Method Summary collapse
-
#initialize(default = SKIP, direction = SKIP, maximum = SKIP, metric = SKIP, minimum = SKIP, threshold = SKIP, units = SKIP, additional_properties = nil) ⇒ SleThreshold
constructor
A new instance of SleThreshold.
-
#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(default = SKIP, direction = SKIP, maximum = SKIP, metric = SKIP, minimum = SKIP, threshold = SKIP, units = SKIP, additional_properties = nil) ⇒ SleThreshold
Returns a new instance of SleThreshold.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/mist_api/models/sle_threshold.rb', line 71 def initialize(default = SKIP, direction = SKIP, maximum = SKIP, metric = SKIP, minimum = SKIP, threshold = SKIP, units = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @default = default unless default == SKIP @direction = direction unless direction == SKIP @maximum = maximum unless maximum == SKIP @metric = metric unless metric == SKIP @minimum = minimum unless minimum == SKIP @threshold = threshold unless threshold == SKIP @units = units unless units == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#default ⇒ Float
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/sle_threshold.rb', line 14 def default @default end |
#direction ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/sle_threshold.rb', line 18 def direction @direction end |
#maximum ⇒ Float
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/sle_threshold.rb', line 22 def maximum @maximum end |
#metric ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/sle_threshold.rb', line 26 def metric @metric end |
#minimum ⇒ Float
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/sle_threshold.rb', line 30 def minimum @minimum end |
#threshold ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/mist_api/models/sle_threshold.rb', line 34 def threshold @threshold end |
#units ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/mist_api/models/sle_threshold.rb', line 38 def units @units end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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/sle_threshold.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. default = hash.key?('default') ? hash['default'] : SKIP direction = hash.key?('direction') ? hash['direction'] : SKIP maximum = hash.key?('maximum') ? hash['maximum'] : SKIP metric = hash.key?('metric') ? hash['metric'] : SKIP minimum = hash.key?('minimum') ? hash['minimum'] : SKIP threshold = hash.key?('threshold') ? hash['threshold'] : SKIP units = hash.key?('units') ? hash['units'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. SleThreshold.new(default, direction, maximum, metric, minimum, threshold, units, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mist_api/models/sle_threshold.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['default'] = 'default' @_hash['direction'] = 'direction' @_hash['maximum'] = 'maximum' @_hash['metric'] = 'metric' @_hash['minimum'] = 'minimum' @_hash['threshold'] = 'threshold' @_hash['units'] = 'units' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/mist_api/models/sle_threshold.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/mist_api/models/sle_threshold.rb', line 54 def self.optionals %w[ default direction maximum metric minimum threshold units ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
127 128 129 130 131 132 133 |
# File 'lib/mist_api/models/sle_threshold.rb', line 127 def inspect class_name = self.class.name.split('::').last "<#{class_name} default: #{@default.inspect}, direction: #{@direction.inspect}, maximum:"\ " #{@maximum.inspect}, metric: #{@metric.inspect}, minimum: #{@minimum.inspect}, threshold:"\ " #{@threshold.inspect}, units: #{@units.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
119 120 121 122 123 124 |
# File 'lib/mist_api/models/sle_threshold.rb', line 119 def to_s class_name = self.class.name.split('::').last "<#{class_name} default: #{@default}, direction: #{@direction}, maximum: #{@maximum},"\ " metric: #{@metric}, minimum: #{@minimum}, threshold: #{@threshold}, units: #{@units},"\ " additional_properties: #{@additional_properties}>" end |