Class: OCI::LogAnalytics::Models::LogAnalyticsSourceDataFilter

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

Overview

LogAnalyticsSourceDataFilter

Constant Summary collapse

FILTER_TYPE_ENUM =
[
  FILTER_TYPE_MASK = 'MASK'.freeze,
  FILTER_TYPE_HASH_MASK = 'HASH_MASK'.freeze,
  FILTER_TYPE_DROP_LOG_ENTRY = 'DROP_LOG_ENTRY'.freeze,
  FILTER_TYPE_DROP_STRING = 'DROP_STRING'.freeze,
  FILTER_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 = {}) ⇒ LogAnalyticsSourceDataFilter

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :description (String)

    The value to assign to the #description property

  • :display_name (String)

    The value to assign to the #display_name property

  • :edit_version (Integer)

    The value to assign to the #edit_version property

  • :is_enabled (BOOLEAN)

    The value to assign to the #is_enabled property

  • :field_name (String)

    The value to assign to the #field_name property

  • :hash_type (Integer)

    The value to assign to the #hash_type property

  • :data_filter_id (Integer)

    The value to assign to the #data_filter_id property

  • :is_system (BOOLEAN)

    The value to assign to the #is_system property

  • :match_regular_expression (String)

    The value to assign to the #match_regular_expression property

  • :order (Integer)

    The value to assign to the #order property

  • :path (String)

    The value to assign to the #path property

  • :replacement_string (String)

    The value to assign to the #replacement_string property

  • :source_id (Integer)

    The value to assign to the #source_id property

  • :filter_type (String)

    The value to assign to the #filter_type property



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
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
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 139

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

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

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

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

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

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

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

  self.data_filter_id = attributes[:'dataFilterId'] if attributes[:'dataFilterId']

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

  self.data_filter_id = attributes[:'data_filter_id'] if attributes[:'data_filter_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.match_regular_expression = attributes[:'matchRegularExpression'] if attributes[:'matchRegularExpression']

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

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

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

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

  self.replacement_string = attributes[:'replacementString'] if attributes[:'replacementString']

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

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

  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.filter_type = attributes[:'filterType'] if attributes[:'filterType']
  self.filter_type = "MASK" if filter_type.nil? && !attributes.key?(:'filterType') # rubocop:disable Style/StringLiterals

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

  self.filter_type = attributes[:'filter_type'] if attributes[:'filter_type']
  self.filter_type = "MASK" if filter_type.nil? && !attributes.key?(:'filterType') && !attributes.key?(:'filter_type') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#data_filter_idInteger

filter Id

Returns:

  • (Integer)


45
46
47
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 45

def data_filter_id
  @data_filter_id
end

#descriptionString

description

Returns:

  • (String)


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

def description
  @description
end

#display_nameString

display name

Returns:

  • (String)


25
26
27
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 25

def display_name
  @display_name
end

#edit_versionInteger

edit version

Returns:

  • (Integer)


29
30
31
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 29

def edit_version
  @edit_version
end

#field_nameString

field internal name

Returns:

  • (String)


37
38
39
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 37

def field_name
  @field_name
end

#filter_typeString

filterType

Returns:

  • (String)


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

def filter_type
  @filter_type
end

#hash_typeInteger

hash type

Returns:

  • (Integer)


41
42
43
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 41

def hash_type
  @hash_type
end

#is_enabledBOOLEAN

enabled

Returns:

  • (BOOLEAN)


33
34
35
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 33

def is_enabled
  @is_enabled
end

#is_systemBOOLEAN

is system flag

Returns:

  • (BOOLEAN)


49
50
51
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 49

def is_system
  @is_system
end

#match_regular_expressionString

regular expression match

Returns:

  • (String)


53
54
55
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 53

def match_regular_expression
  @match_regular_expression
end

#orderInteger

order

Returns:

  • (Integer)


57
58
59
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 57

def order
  @order
end

#pathString

path

Returns:

  • (String)


61
62
63
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 61

def path
  @path
end

#replacement_stringString

replacement string

Returns:

  • (String)


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

def replacement_string
  @replacement_string
end

#source_idInteger

source Id

Returns:

  • (Integer)


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

def source_id
  @source_id
end

Class Method Details

.attribute_mapObject

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



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 76

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'description': :'description',
    'display_name': :'displayName',
    'edit_version': :'editVersion',
    'is_enabled': :'isEnabled',
    'field_name': :'fieldName',
    'hash_type': :'hashType',
    'data_filter_id': :'dataFilterId',
    'is_system': :'isSystem',
    'match_regular_expression': :'matchRegularExpression',
    'order': :'order',
    'path': :'path',
    'replacement_string': :'replacementString',
    'source_id': :'sourceId',
    'filter_type': :'filterType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'description': :'String',
    'display_name': :'String',
    'edit_version': :'Integer',
    'is_enabled': :'BOOLEAN',
    'field_name': :'String',
    'hash_type': :'Integer',
    'data_filter_id': :'Integer',
    'is_system': :'BOOLEAN',
    'match_regular_expression': :'String',
    'order': :'Integer',
    'path': :'String',
    'replacement_string': :'String',
    'source_id': :'Integer',
    'filter_type': :'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



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 240

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

  self.class == other.class &&
    description == other.description &&
    display_name == other.display_name &&
    edit_version == other.edit_version &&
    is_enabled == other.is_enabled &&
    field_name == other.field_name &&
    hash_type == other.hash_type &&
    data_filter_id == other.data_filter_id &&
    is_system == other.is_system &&
    match_regular_expression == other.match_regular_expression &&
    order == other.order &&
    path == other.path &&
    replacement_string == other.replacement_string &&
    source_id == other.source_id &&
    filter_type == other.filter_type
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



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 283

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


263
264
265
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 263

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



272
273
274
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 272

def hash
  [description, display_name, edit_version, is_enabled, field_name, hash_type, data_filter_id, is_system, match_regular_expression, order, path, replacement_string, source_id, filter_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



316
317
318
319
320
321
322
323
324
325
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 316

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



310
311
312
# File 'lib/oci/log_analytics/models/log_analytics_source_data_filter.rb', line 310

def to_s
  to_hash.to_s
end