Class: OCI::AiAnomalyDetection::Models::RowReductionDetails
- Inherits:
-
Object
- Object
- OCI::AiAnomalyDetection::Models::RowReductionDetails
- Defined in:
- lib/oci/ai_anomaly_detection/models/row_reduction_details.rb
Overview
Information regarding how/what row reduction methods will be applied. If this property is not present or is null, then it means row reduction is not applied.
Constant Summary collapse
- REDUCTION_METHOD_ENUM =
[ REDUCTION_METHOD_DELETE_ROW = 'DELETE_ROW'.freeze, REDUCTION_METHOD_AVERAGE_ROW = 'AVERAGE_ROW'.freeze, REDUCTION_METHOD_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#is_reduction_enabled ⇒ BOOLEAN
[Required] A boolean value to indicate if row reduction is applied.
-
#reduction_method ⇒ String
[Required] Method for row reduction: * DELETE_ROW - delete rows with equal intervals * AVERAGE_ROW - average multiple rows to one row.
-
#reduction_percentage ⇒ Float
[Required] A percentage to reduce data size down to on top of original data.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ RowReductionDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ RowReductionDetails
Initializes the object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 64 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.is_reduction_enabled = attributes[:'isReductionEnabled'] unless attributes[:'isReductionEnabled'].nil? raise 'You cannot provide both :isReductionEnabled and :is_reduction_enabled' if attributes.key?(:'isReductionEnabled') && attributes.key?(:'is_reduction_enabled') self.is_reduction_enabled = attributes[:'is_reduction_enabled'] unless attributes[:'is_reduction_enabled'].nil? self.reduction_percentage = attributes[:'reductionPercentage'] if attributes[:'reductionPercentage'] raise 'You cannot provide both :reductionPercentage and :reduction_percentage' if attributes.key?(:'reductionPercentage') && attributes.key?(:'reduction_percentage') self.reduction_percentage = attributes[:'reduction_percentage'] if attributes[:'reduction_percentage'] self.reduction_method = attributes[:'reductionMethod'] if attributes[:'reductionMethod'] raise 'You cannot provide both :reductionMethod and :reduction_method' if attributes.key?(:'reductionMethod') && attributes.key?(:'reduction_method') self.reduction_method = attributes[:'reduction_method'] if attributes[:'reduction_method'] end |
Instance Attribute Details
#is_reduction_enabled ⇒ BOOLEAN
[Required] A boolean value to indicate if row reduction is applied
20 21 22 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 20 def is_reduction_enabled @is_reduction_enabled end |
#reduction_method ⇒ String
[Required] Method for row reduction: * DELETE_ROW - delete rows with equal intervals * AVERAGE_ROW - average multiple rows to one row
31 32 33 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 31 def reduction_method @reduction_method end |
#reduction_percentage ⇒ Float
[Required] A percentage to reduce data size down to on top of original data
24 25 26 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 24 def reduction_percentage @reduction_percentage end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
34 35 36 37 38 39 40 41 42 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 34 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'is_reduction_enabled': :'isReductionEnabled', 'reduction_percentage': :'reductionPercentage', 'reduction_method': :'reductionMethod' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
45 46 47 48 49 50 51 52 53 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 45 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'is_reduction_enabled': :'BOOLEAN', 'reduction_percentage': :'Float', 'reduction_method': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
109 110 111 112 113 114 115 116 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 109 def ==(other) return true if equal?(other) self.class == other.class && is_reduction_enabled == other.is_reduction_enabled && reduction_percentage == other.reduction_percentage && reduction_method == other.reduction_method end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 141 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
121 122 123 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 121 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
130 131 132 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 130 def hash [is_reduction_enabled, reduction_percentage, reduction_method].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
174 175 176 177 178 179 180 181 182 183 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 174 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
168 169 170 |
# File 'lib/oci/ai_anomaly_detection/models/row_reduction_details.rb', line 168 def to_s to_hash.to_s end |