Class: OCI::LogAnalytics::Models::LogAnalyticsSourceLabelCondition

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/log_analytics/models/log_analytics_source_label_condition.rb

Overview

LogAnalyticsSourceLabelCondition

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LogAnalyticsSourceLabelCondition

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 178

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.condition_string = attributes[:'conditionString'] if attributes[:'conditionString']

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

  self.condition_string = attributes[:'condition_string'] if attributes[:'condition_string']

  self.condition_block = attributes[:'conditionBlock'] if attributes[:'conditionBlock']

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

  self.condition_block = attributes[:'condition_block'] if attributes[:'condition_block']

  self.message = attributes[:'message'] if attributes[:'message']

  self.is_visible = attributes[:'isVisible'] unless attributes[:'isVisible'].nil?

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

  self.is_visible = attributes[:'is_visible'] unless attributes[:'is_visible'].nil?

  self.block_condition_field = attributes[:'blockConditionField'] if attributes[:'blockConditionField']

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

  self.block_condition_field = attributes[:'block_condition_field'] if attributes[:'block_condition_field']

  self.block_condition_operator = attributes[:'blockConditionOperator'] if attributes[:'blockConditionOperator']

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

  self.block_condition_operator = attributes[:'block_condition_operator'] if attributes[:'block_condition_operator']

  self.block_condition_value = attributes[:'blockConditionValue'] if attributes[:'blockConditionValue']

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

  self.block_condition_value = attributes[:'block_condition_value'] if attributes[:'block_condition_value']

  self.label_condition_value = attributes[:'labelConditionValue'] if attributes[:'labelConditionValue']

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

  self.label_condition_value = attributes[:'label_condition_value'] if attributes[:'label_condition_value']

  self.label_condition_values = attributes[:'labelConditionValues'] if attributes[:'labelConditionValues']

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

  self.label_condition_values = attributes[:'label_condition_values'] if attributes[:'label_condition_values']

  self.content_example = attributes[:'contentExample'] if attributes[:'contentExample']

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

  self.content_example = attributes[:'content_example'] if attributes[:'content_example']

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?

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

  self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?

  self.field_name = attributes[:'fieldName'] if attributes[:'fieldName']

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

  self.field_name = attributes[:'field_name'] if attributes[:'field_name']

  self.label_condition_id = attributes[:'labelConditionId'] if attributes[:'labelConditionId']

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

  self.label_condition_id = attributes[:'label_condition_id'] if attributes[:'label_condition_id']

  self.is_system = attributes[:'isSystem'] unless attributes[:'isSystem'].nil?

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

  self.is_system = attributes[:'is_system'] unless attributes[:'is_system'].nil?

  self.label_condition_operator = attributes[:'labelConditionOperator'] if attributes[:'labelConditionOperator']

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

  self.label_condition_operator = attributes[:'label_condition_operator'] if attributes[:'label_condition_operator']

  self.source_id = attributes[:'sourceId'] if attributes[:'sourceId']

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

  self.source_id = attributes[:'source_id'] if attributes[:'source_id']

  self.label_display_name = attributes[:'labelDisplayName'] if attributes[:'labelDisplayName']

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

  self.label_display_name = attributes[:'label_display_name'] if attributes[:'label_display_name']

  self.storage_field = attributes[:'storageField'] if attributes[:'storageField']

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

  self.storage_field = attributes[:'storage_field'] if attributes[:'storage_field']

  self.label_name = attributes[:'labelName'] if attributes[:'labelName']

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

  self.label_name = attributes[:'label_name'] if attributes[:'label_name']

  self.is_inline_label_existing_in_database = attributes[:'isInlineLabelExistingInDatabase'] unless attributes[:'isInlineLabelExistingInDatabase'].nil?

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

  self.is_inline_label_existing_in_database = attributes[:'is_inline_label_existing_in_database'] unless attributes[:'is_inline_label_existing_in_database'].nil?
end

Instance Attribute Details

#block_condition_fieldString

The block condition field.

Returns:

  • (String)


30
31
32
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 30

def block_condition_field
  @block_condition_field
end

#block_condition_operatorString

The block condition operator.

Returns:

  • (String)


34
35
36
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 34

def block_condition_operator
  @block_condition_operator
end

#block_condition_valueString

The block condition value.

Returns:

  • (String)


38
39
40
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 38

def block_condition_value
  @block_condition_value
end

#condition_blockOCI::LogAnalytics::Models::ConditionBlock



17
18
19
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 17

def condition_block
  @condition_block
end

#condition_stringString

String representation of the label condition. This supports specifying multiple condition blocks at various nested levels.

Returns:

  • (String)


14
15
16
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 14

def condition_string
  @condition_string
end

#content_exampleString

The content example.

Returns:

  • (String)


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

def content_example
  @content_example
end

#field_nameString

The internal field name.

Returns:

  • (String)


59
60
61
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 59

def field_name
  @field_name
end

#is_enabledBOOLEAN

A flag inidcating whether or not the condition is enabled.

Returns:

  • (BOOLEAN)


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

def is_enabled
  @is_enabled
end

#is_inline_label_existing_in_databaseBOOLEAN

A flag indicating whether or not the inline label exists in the database.

Returns:

  • (BOOLEAN)


94
95
96
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 94

def is_inline_label_existing_in_database
  @is_inline_label_existing_in_database
end

#is_systemBOOLEAN

The system flag. A value of false denotes a custom, or user defined object. A value of true denotes a built in object.

Returns:

  • (BOOLEAN)


69
70
71
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 69

def is_system
  @is_system
end

#is_visibleBOOLEAN

A flag indicating whether or not the label condition is visible.

Returns:

  • (BOOLEAN)


26
27
28
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 26

def is_visible
  @is_visible
end

#label_condition_idInteger

The unique identifier of the condition.

Returns:

  • (Integer)


63
64
65
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 63

def label_condition_id
  @label_condition_id
end

#label_condition_operatorString

The condition operator.

Returns:

  • (String)


73
74
75
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 73

def label_condition_operator
  @label_condition_operator
end

#label_condition_valueString

The condition value.

Returns:

  • (String)


42
43
44
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 42

def label_condition_value
  @label_condition_value
end

#label_condition_valuesArray<String>

A list of condition values.

Returns:

  • (Array<String>)


46
47
48
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 46

def label_condition_values
  @label_condition_values
end

#label_display_nameString

The label display name.

Returns:

  • (String)


81
82
83
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 81

def label_display_name
  @label_display_name
end

#label_nameString

The label name.

Returns:

  • (String)


89
90
91
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 89

def label_name
  @label_name
end

#messageString

The message.

Returns:

  • (String)


21
22
23
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 21

def message
  @message
end

#source_idInteger

The unique identifier of the source.

Returns:

  • (Integer)


77
78
79
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 77

def source_id
  @source_id
end

#storage_fieldString

The label storage field.

Returns:

  • (String)


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

def storage_field
  @storage_field
end

Class Method Details

.attribute_mapObject

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



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 97

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'condition_string': :'conditionString',
    'condition_block': :'conditionBlock',
    'message': :'message',
    'is_visible': :'isVisible',
    'block_condition_field': :'blockConditionField',
    'block_condition_operator': :'blockConditionOperator',
    'block_condition_value': :'blockConditionValue',
    'label_condition_value': :'labelConditionValue',
    'label_condition_values': :'labelConditionValues',
    'content_example': :'contentExample',
    'is_enabled': :'isEnabled',
    'field_name': :'fieldName',
    'label_condition_id': :'labelConditionId',
    'is_system': :'isSystem',
    'label_condition_operator': :'labelConditionOperator',
    'source_id': :'sourceId',
    'label_display_name': :'labelDisplayName',
    'storage_field': :'storageField',
    'label_name': :'labelName',
    'is_inline_label_existing_in_database': :'isInlineLabelExistingInDatabase'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 125

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'condition_string': :'String',
    'condition_block': :'OCI::LogAnalytics::Models::ConditionBlock',
    'message': :'String',
    'is_visible': :'BOOLEAN',
    'block_condition_field': :'String',
    'block_condition_operator': :'String',
    'block_condition_value': :'String',
    'label_condition_value': :'String',
    'label_condition_values': :'Array<String>',
    'content_example': :'String',
    'is_enabled': :'BOOLEAN',
    'field_name': :'String',
    'label_condition_id': :'Integer',
    'is_system': :'BOOLEAN',
    'label_condition_operator': :'String',
    'source_id': :'Integer',
    'label_display_name': :'String',
    'storage_field': :'String',
    'label_name': :'String',
    'is_inline_label_existing_in_database': :'BOOLEAN'
    # 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



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 308

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    condition_string == other.condition_string &&
    condition_block == other.condition_block &&
    message == other.message &&
    is_visible == other.is_visible &&
    block_condition_field == other.block_condition_field &&
    block_condition_operator == other.block_condition_operator &&
    block_condition_value == other.block_condition_value &&
    label_condition_value == other.label_condition_value &&
    label_condition_values == other.label_condition_values &&
    content_example == other.content_example &&
    is_enabled == other.is_enabled &&
    field_name == other.field_name &&
    label_condition_id == other.label_condition_id &&
    is_system == other.is_system &&
    label_condition_operator == other.label_condition_operator &&
    source_id == other.source_id &&
    label_display_name == other.label_display_name &&
    storage_field == other.storage_field &&
    label_name == other.label_name &&
    is_inline_label_existing_in_database == other.is_inline_label_existing_in_database
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



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 357

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


337
338
339
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 337

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



346
347
348
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 346

def hash
  [condition_string, condition_block, message, is_visible, block_condition_field, block_condition_operator, block_condition_value, label_condition_value, label_condition_values, content_example, is_enabled, field_name, label_condition_id, is_system, label_condition_operator, source_id, label_display_name, storage_field, label_name, is_inline_label_existing_in_database].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



390
391
392
393
394
395
396
397
398
399
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 390

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



384
385
386
# File 'lib/oci/log_analytics/models/log_analytics_source_label_condition.rb', line 384

def to_s
  to_hash.to_s
end