Class: OCI::LogAnalytics::Models::AbstractColumn

Inherits:
Object
  • Object
show all
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

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_STATS_COLUMN = 'TIME_STATS_COLUMN'.freeze,
  TYPE_TIME_STATS_DATA_COLUMN = 'TIME_STATS_DATA_COLUMN'.freeze,
  TYPE_TIME_CLUSTER_COLUMN = 'TIME_CLUSTER_COLUMN'.freeze,
  TYPE_TIME_CLUSTER_DATA_COLUMN = 'TIME_CLUSTER_DATA_COLUMN'.freeze,
  TYPE_TABLE_COLUMN = 'TABLE_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_TABLE = 'TABLE'.freeze,
  VALUE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AbstractColumn

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :type (String)

    The value to assign to the #type property

  • :display_name (String)

    The value to assign to the #display_name property

  • :sub_system (String)

    The value to assign to the #sub_system property

  • :values (Array<OCI::LogAnalytics::Models::FieldValue>)

    The value to assign to the #values property

  • :is_list_of_values (BOOLEAN)

    The value to assign to the #is_list_of_values property

  • :is_multi_valued (BOOLEAN)

    The value to assign to the #is_multi_valued property

  • :is_case_sensitive (BOOLEAN)

    The value to assign to the #is_case_sensitive property

  • :is_groupable (BOOLEAN)

    The value to assign to the #is_groupable property

  • :is_evaluable (BOOLEAN)

    The value to assign to the #is_evaluable property

  • :is_hidden (BOOLEAN)

    The value to assign to the #is_hidden property

  • :value_type (String)

    The value to assign to the #value_type property

  • :original_display_name (String)

    The value to assign to the #original_display_name property

  • :internal_name (String)

    The value to assign to the #internal_name property



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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 198

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_case_sensitive = attributes[:'isCaseSensitive'] unless attributes[:'isCaseSensitive'].nil?
  self.is_case_sensitive = false if is_case_sensitive.nil? && !attributes.key?(:'isCaseSensitive') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isCaseSensitive and :is_case_sensitive' if attributes.key?(:'isCaseSensitive') && attributes.key?(:'is_case_sensitive')

  self.is_case_sensitive = attributes[:'is_case_sensitive'] unless attributes[:'is_case_sensitive'].nil?
  self.is_case_sensitive = false if is_case_sensitive.nil? && !attributes.key?(:'isCaseSensitive') && !attributes.key?(:'is_case_sensitive') # rubocop:disable Style/StringLiterals

  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.is_hidden = attributes[:'isHidden'] unless attributes[:'isHidden'].nil?
  self.is_hidden = false if is_hidden.nil? && !attributes.key?(:'isHidden') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isHidden and :is_hidden' if attributes.key?(:'isHidden') && attributes.key?(:'is_hidden')

  self.is_hidden = attributes[:'is_hidden'] unless attributes[:'is_hidden'].nil?
  self.is_hidden = false if is_hidden.nil? && !attributes.key?(:'isHidden') && !attributes.key?(:'is_hidden') # rubocop:disable Style/StringLiterals

  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_nameString

Column display name - will be alias if column is renamed by queryStrng.

Returns:

  • (String)


55
56
57
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 55

def display_name
  @display_name
end

#internal_nameString

Internal identifier for the column.

Returns:

  • (String)


110
111
112
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 110

def internal_name
  @internal_name
end

#is_case_sensitiveBOOLEAN

A flag indicating whether or not the field is a case sensitive field. Only applies to string fields.

Returns:

  • (BOOLEAN)


80
81
82
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 80

def is_case_sensitive
  @is_case_sensitive
end

#is_evaluableBOOLEAN

Identifies if this column can be used as an expression parameter in any command that accepts querylanguage expressions.

Returns:

  • (BOOLEAN)


90
91
92
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 90

def is_evaluable
  @is_evaluable
end

#is_groupableBOOLEAN

Identifies if this column can be used as a grouping field in any grouping command.

Returns:

  • (BOOLEAN)


85
86
87
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 85

def is_groupable
  @is_groupable
end

#is_hiddenBOOLEAN

Identifies if this column should be hidden by default but can be displayed in the UI on demand.

Returns:

  • (BOOLEAN)


95
96
97
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 95

def is_hidden
  @is_hidden
end

#is_list_of_valuesBOOLEAN

Identifies if all values in this column come from a pre-defined list of values.

Returns:

  • (BOOLEAN)


70
71
72
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 70

def is_list_of_values
  @is_list_of_values
end

#is_multi_valuedBOOLEAN

Identifies if this column allows multiple values to exist in a single row.

Returns:

  • (BOOLEAN)


75
76
77
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 75

def is_multi_valued
  @is_multi_valued
end

#original_display_nameString

Same as displayName unless column renamed in which case this will hold the original display name for the column.

Returns:

  • (String)


105
106
107
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 105

def original_display_name
  @original_display_name
end

#sub_systemString

Subsystem column belongs to.

Returns:

  • (String)


60
61
62
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 60

def sub_system
  @sub_system
end

#typeString

[Required] Column classification when column requires special designation.

Returns:

  • (String)


50
51
52
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 50

def type
  @type
end

#value_typeString

Field denoting column data type.

Returns:

  • (String)


100
101
102
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 100

def value_type
  @value_type
end

#valuesArray<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.



65
66
67
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 65

def values
  @values
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



113
114
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 113

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_case_sensitive': :'isCaseSensitive',
    'is_groupable': :'isGroupable',
    'is_evaluable': :'isEvaluable',
    'is_hidden': :'isHidden',
    '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.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 159

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::TimeStatsColumn' if type == 'TIME_STATS_COLUMN'
  return 'OCI::LogAnalytics::Models::TimeClusterColumn' if type == 'TIME_CLUSTER_COLUMN'
  return 'OCI::LogAnalytics::Models::Column' if type == 'COLUMN'
  return 'OCI::LogAnalytics::Models::TimeClusterDataColumn' if type == 'TIME_CLUSTER_DATA_COLUMN'
  return 'OCI::LogAnalytics::Models::TimeStatsDataColumn' if type == 'TIME_STATS_DATA_COLUMN'
  return 'OCI::LogAnalytics::Models::TableColumn' if type == 'TABLE_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_typesObject

Attribute type mapping.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 134

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_case_sensitive': :'BOOLEAN',
    'is_groupable': :'BOOLEAN',
    'is_evaluable': :'BOOLEAN',
    'is_hidden': :'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.

Parameters:

  • other (Object)

    the other object to be compared



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 325

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_case_sensitive == other.is_case_sensitive &&
    is_groupable == other.is_groupable &&
    is_evaluable == other.is_evaluable &&
    is_hidden == other.is_hidden &&
    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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 367

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


347
348
349
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 347

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



356
357
358
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 356

def hash
  [type, display_name, sub_system, values, is_list_of_values, is_multi_valued, is_case_sensitive, is_groupable, is_evaluable, is_hidden, value_type, original_display_name, internal_name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



400
401
402
403
404
405
406
407
408
409
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 400

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



394
395
396
# File 'lib/oci/log_analytics/models/abstract_column.rb', line 394

def to_s
  to_hash.to_s
end