Class: OCI::LogAnalytics::Models::EfdRegexResult

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

Overview

EfdRegexResult

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EfdRegexResult

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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
151
152
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 103

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

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

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

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

  self.match_result = attributes[:'matchResult'] if attributes[:'matchResult']

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

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

  self.parsed_field_count = attributes[:'parsedFieldCount'] if attributes[:'parsedFieldCount']

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

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

  self.parsed_fields = attributes[:'parsedFields'] if attributes[:'parsedFields']

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

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

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

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

  self.status_description = attributes[:'statusDescription'] if attributes[:'statusDescription']

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

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

  self.is_valid_regex_syntax = attributes[:'isValidRegexSyntax'] unless attributes[:'isValidRegexSyntax'].nil?

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

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

  self.violations = attributes[:'violations'] if attributes[:'violations']
end

Instance Attribute Details

#base_field_nameString

The base field name.

Returns:

  • (String)


13
14
15
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 13

def base_field_name
  @base_field_name
end

#idInteger

the unique identifier.

Returns:

  • (Integer)


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

def id
  @id
end

#is_valid_regex_syntaxBOOLEAN

A flag indicating whether or not the regular expression is valid.

Returns:

  • (BOOLEAN)


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

def is_valid_regex_syntax
  @is_valid_regex_syntax
end

#match_resultOCI::LogAnalytics::Models::RegexMatchResult



20
21
22
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 20

def match_result
  @match_result
end

#parsed_field_countInteger

The parsed field count.

Returns:

  • (Integer)


24
25
26
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 24

def parsed_field_count
  @parsed_field_count
end

#parsed_fieldsHash<String, String>

The parsed fields.

Returns:

  • (Hash<String, String>)


28
29
30
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 28

def parsed_fields
  @parsed_fields
end

#regexString

The regular expression.

Returns:

  • (String)


32
33
34
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 32

def regex
  @regex
end

#statusString

The status.

Returns:

  • (String)


36
37
38
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 36

def status
  @status
end

#status_descriptionString

The Status description.

Returns:

  • (String)


40
41
42
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 40

def status_description
  @status_description
end

#violationsArray<OCI::LogAnalytics::Models::Violation>

The list of violations (if any).



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

def violations
  @violations
end

Class Method Details

.attribute_mapObject

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



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 52

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'base_field_name': :'baseFieldName',
    'id': :'id',
    'match_result': :'matchResult',
    'parsed_field_count': :'parsedFieldCount',
    'parsed_fields': :'parsedFields',
    'regex': :'regex',
    'status': :'status',
    'status_description': :'statusDescription',
    'is_valid_regex_syntax': :'isValidRegexSyntax',
    'violations': :'violations'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 70

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'base_field_name': :'String',
    'id': :'Integer',
    'match_result': :'OCI::LogAnalytics::Models::RegexMatchResult',
    'parsed_field_count': :'Integer',
    'parsed_fields': :'Hash<String, String>',
    'regex': :'String',
    'status': :'String',
    'status_description': :'String',
    'is_valid_regex_syntax': :'BOOLEAN',
    'violations': :'Array<OCI::LogAnalytics::Models::Violation>'
    # 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



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

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

  self.class == other.class &&
    base_field_name == other.base_field_name &&
    id == other.id &&
    match_result == other.match_result &&
    parsed_field_count == other.parsed_field_count &&
    parsed_fields == other.parsed_fields &&
    regex == other.regex &&
    status == other.status &&
    status_description == other.status_description &&
    is_valid_regex_syntax == other.is_valid_regex_syntax &&
    violations == other.violations
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



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 200

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


180
181
182
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 180

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



189
190
191
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 189

def hash
  [base_field_name, id, match_result, parsed_field_count, parsed_fields, regex, status, status_description, is_valid_regex_syntax, violations].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



233
234
235
236
237
238
239
240
241
242
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 233

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



227
228
229
# File 'lib/oci/log_analytics/models/efd_regex_result.rb', line 227

def to_s
  to_hash.to_s
end