Class: OCI::LogAnalytics::Models::AbstractColumn
- Inherits:
-
Object
- Object
- OCI::LogAnalytics::Models::AbstractColumn
- Defined in:
- lib/oci/log_analytics/models/abstract_column.rb
Overview
Generic column defining all attributes common to all querylanguage columns.
This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
Direct Known Subclasses
ChartColumn, ChartDataColumn, ClassifyColumn, Column, TimeColumn, TrendColumn
Constant Summary collapse
- TYPE_ENUM =
[ TYPE_COLUMN = 'COLUMN'.freeze, TYPE_CHART_COLUMN = 'CHART_COLUMN'.freeze, TYPE_CHART_DATA_COLUMN = 'CHART_DATA_COLUMN'.freeze, TYPE_TIME_COLUMN = 'TIME_COLUMN'.freeze, TYPE_TREND_COLUMN = 'TREND_COLUMN'.freeze, TYPE_CLASSIFY_COLUMN = 'CLASSIFY_COLUMN'.freeze, TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- SUB_SYSTEM_ENUM =
[ SUB_SYSTEM_LOG = 'LOG'.freeze, SUB_SYSTEM_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- VALUE_TYPE_ENUM =
[ VALUE_TYPE_BOOLEAN = 'BOOLEAN'.freeze, VALUE_TYPE_STRING = 'STRING'.freeze, VALUE_TYPE_DOUBLE = 'DOUBLE'.freeze, VALUE_TYPE_FLOAT = 'FLOAT'.freeze, VALUE_TYPE_LONG = 'LONG'.freeze, VALUE_TYPE_INTEGER = 'INTEGER'.freeze, VALUE_TYPE_TIMESTAMP = 'TIMESTAMP'.freeze, VALUE_TYPE_FACET = 'FACET'.freeze, VALUE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#display_name ⇒ String
Column display name - will be alias if column is renamed by queryStrng.
-
#internal_name ⇒ String
Internal identifier for the column.
-
#is_evaluable ⇒ BOOLEAN
Identifies if this column can be used as an expression parameter in any command that accepts querylanguage expressions.
-
#is_groupable ⇒ BOOLEAN
Identifies if this column can be used as a grouping field in any grouping command.
-
#is_list_of_values ⇒ BOOLEAN
Identifies if all values in this column come from a pre-defined list of values.
-
#is_multi_valued ⇒ BOOLEAN
Identifies if this column allows multiple values to exist in a single row.
-
#original_display_name ⇒ String
Same as displayName unless column renamed in which case this will hold the original display name for the column.
-
#sub_system ⇒ String
Subsystem column belongs to.
-
#type ⇒ String
[Required] Column classification when column requires special designation.
-
#value_type ⇒ String
Field denoting column data type.
-
#values ⇒ Array<OCI::LogAnalytics::Models::FieldValue>
If the column is a ‘List of Values’ column, this array contains the field values that are applicable to query results or all if no filters applied.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
-
.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 = {}) ⇒ AbstractColumn
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 = {}) ⇒ AbstractColumn
Initializes the object
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 170 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.type = attributes[:'type'] if attributes[:'type'] self.display_name = attributes[:'displayName'] if attributes[:'displayName'] raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name') self.display_name = attributes[:'display_name'] if attributes[:'display_name'] self.sub_system = attributes[:'subSystem'] if attributes[:'subSystem'] raise 'You cannot provide both :subSystem and :sub_system' if attributes.key?(:'subSystem') && attributes.key?(:'sub_system') self.sub_system = attributes[:'sub_system'] if attributes[:'sub_system'] self.values = attributes[:'values'] if attributes[:'values'] self.is_list_of_values = attributes[:'isListOfValues'] unless attributes[:'isListOfValues'].nil? raise 'You cannot provide both :isListOfValues and :is_list_of_values' if attributes.key?(:'isListOfValues') && attributes.key?(:'is_list_of_values') self.is_list_of_values = attributes[:'is_list_of_values'] unless attributes[:'is_list_of_values'].nil? self.is_multi_valued = attributes[:'isMultiValued'] unless attributes[:'isMultiValued'].nil? raise 'You cannot provide both :isMultiValued and :is_multi_valued' if attributes.key?(:'isMultiValued') && attributes.key?(:'is_multi_valued') self.is_multi_valued = attributes[:'is_multi_valued'] unless attributes[:'is_multi_valued'].nil? self.is_groupable = attributes[:'isGroupable'] unless attributes[:'isGroupable'].nil? raise 'You cannot provide both :isGroupable and :is_groupable' if attributes.key?(:'isGroupable') && attributes.key?(:'is_groupable') self.is_groupable = attributes[:'is_groupable'] unless attributes[:'is_groupable'].nil? self.is_evaluable = attributes[:'isEvaluable'] unless attributes[:'isEvaluable'].nil? raise 'You cannot provide both :isEvaluable and :is_evaluable' if attributes.key?(:'isEvaluable') && attributes.key?(:'is_evaluable') self.is_evaluable = attributes[:'is_evaluable'] unless attributes[:'is_evaluable'].nil? self.value_type = attributes[:'valueType'] if attributes[:'valueType'] raise 'You cannot provide both :valueType and :value_type' if attributes.key?(:'valueType') && attributes.key?(:'value_type') self.value_type = attributes[:'value_type'] if attributes[:'value_type'] self.original_display_name = attributes[:'originalDisplayName'] if attributes[:'originalDisplayName'] raise 'You cannot provide both :originalDisplayName and :original_display_name' if attributes.key?(:'originalDisplayName') && attributes.key?(:'original_display_name') self.original_display_name = attributes[:'original_display_name'] if attributes[:'original_display_name'] self.internal_name = attributes[:'internalName'] if attributes[:'internalName'] raise 'You cannot provide both :internalName and :internal_name' if attributes.key?(:'internalName') && attributes.key?(:'internal_name') self.internal_name = attributes[:'internal_name'] if attributes[:'internal_name'] end |
Instance Attribute Details
#display_name ⇒ String
Column display name - will be alias if column is renamed by queryStrng.
48 49 50 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 48 def display_name @display_name end |
#internal_name ⇒ String
Internal identifier for the column.
93 94 95 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 93 def internal_name @internal_name end |
#is_evaluable ⇒ BOOLEAN
Identifies if this column can be used as an expression parameter in any command that accepts querylanguage expressions.
78 79 80 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 78 def is_evaluable @is_evaluable end |
#is_groupable ⇒ BOOLEAN
Identifies if this column can be used as a grouping field in any grouping command.
73 74 75 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 73 def is_groupable @is_groupable end |
#is_list_of_values ⇒ BOOLEAN
Identifies if all values in this column come from a pre-defined list of values.
63 64 65 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 63 def is_list_of_values @is_list_of_values end |
#is_multi_valued ⇒ BOOLEAN
Identifies if this column allows multiple values to exist in a single row.
68 69 70 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 68 def is_multi_valued @is_multi_valued end |
#original_display_name ⇒ String
Same as displayName unless column renamed in which case this will hold the original display name for the column.
88 89 90 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 88 def original_display_name @original_display_name end |
#sub_system ⇒ String
Subsystem column belongs to.
53 54 55 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 53 def sub_system @sub_system end |
#type ⇒ String
[Required] Column classification when column requires special designation.
43 44 45 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 43 def type @type end |
#value_type ⇒ String
Field denoting column data type.
83 84 85 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 83 def value_type @value_type end |
#values ⇒ Array<OCI::LogAnalytics::Models::FieldValue>
If the column is a ‘List of Values’ column, this array contains the field values that are applicable to query results or all if no filters applied.
58 59 60 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 58 def values @values end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 96 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'type': :'type', 'display_name': :'displayName', 'sub_system': :'subSystem', 'values': :'values', 'is_list_of_values': :'isListOfValues', 'is_multi_valued': :'isMultiValued', 'is_groupable': :'isGroupable', 'is_evaluable': :'isEvaluable', 'value_type': :'valueType', 'original_display_name': :'originalDisplayName', 'internal_name': :'internalName' # rubocop:enable Style/SymbolLiteral } end |
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 138 def self.get_subtype(object_hash) type = object_hash[:'type'] # rubocop:disable Style/SymbolLiteral return 'OCI::LogAnalytics::Models::TimeColumn' if type == 'TIME_COLUMN' return 'OCI::LogAnalytics::Models::ClassifyColumn' if type == 'CLASSIFY_COLUMN' return 'OCI::LogAnalytics::Models::TrendColumn' if type == 'TREND_COLUMN' return 'OCI::LogAnalytics::Models::Column' if type == 'COLUMN' return 'OCI::LogAnalytics::Models::ChartColumn' if type == 'CHART_COLUMN' return 'OCI::LogAnalytics::Models::ChartDataColumn' if type == 'CHART_DATA_COLUMN' # TODO: Log a warning when the subtype is not found. 'OCI::LogAnalytics::Models::AbstractColumn' end |
.swagger_types ⇒ Object
Attribute type mapping.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 115 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'type': :'String', 'display_name': :'String', 'sub_system': :'String', 'values': :'Array<OCI::LogAnalytics::Models::FieldValue>', 'is_list_of_values': :'BOOLEAN', 'is_multi_valued': :'BOOLEAN', 'is_groupable': :'BOOLEAN', 'is_evaluable': :'BOOLEAN', 'value_type': :'String', 'original_display_name': :'String', 'internal_name': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 281 def ==(other) return true if equal?(other) self.class == other.class && type == other.type && display_name == other.display_name && sub_system == other.sub_system && values == other.values && is_list_of_values == other.is_list_of_values && is_multi_valued == other.is_multi_valued && is_groupable == other.is_groupable && is_evaluable == other.is_evaluable && value_type == other.value_type && original_display_name == other.original_display_name && internal_name == other.internal_name end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 321 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
301 302 303 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 301 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
310 311 312 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 310 def hash [type, display_name, sub_system, values, is_list_of_values, is_multi_valued, is_groupable, is_evaluable, value_type, original_display_name, internal_name].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
354 355 356 357 358 359 360 361 362 363 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 354 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
348 349 350 |
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 348 def to_s to_hash.to_s end |