Class: OCI::LogAnalytics::Models::LogAnalyticsParserField

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

Overview

LogAnalyticsParserField

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LogAnalyticsParserField

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



100
101
102
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
153
154
155
156
157
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 100

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

  self.parser_field_id = attributes[:'parserFieldId'] if attributes[:'parserFieldId']

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

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

  self.parser_field_expression = attributes[:'parserFieldExpression'] if attributes[:'parserFieldExpression']

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

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

  self.parser_field_name = attributes[:'parserFieldName'] if attributes[:'parserFieldName']

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

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

  self.storage_field_name = attributes[:'storageFieldName'] if attributes[:'storageFieldName']

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

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

  self.parser_field_integrator_name = attributes[:'parserFieldIntegratorName'] if attributes[:'parserFieldIntegratorName']

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

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

  self.parser_name = attributes[:'parserName'] if attributes[:'parserName']

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

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

  self.parser_field_sequence = attributes[:'parserFieldSequence'] if attributes[:'parserFieldSequence']

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

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

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

  self.structured_column_info = attributes[:'structuredColumnInfo'] if attributes[:'structuredColumnInfo']

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

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

Instance Attribute Details

#fieldOCI::LogAnalytics::Models::LogAnalyticsField



11
12
13
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 11

def field
  @field
end

#parserOCI::LogAnalytics::Models::LogAnalyticsParser



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

def parser
  @parser
end

#parser_field_expressionString

the parser field expression.

Returns:

  • (String)


19
20
21
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 19

def parser_field_expression
  @parser_field_expression
end

#parser_field_idInteger

The parser field unique identifier.

Returns:

  • (Integer)


15
16
17
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 15

def parser_field_id
  @parser_field_id
end

#parser_field_integrator_nameString

The integrator name.

Returns:

  • (String)


31
32
33
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 31

def parser_field_integrator_name
  @parser_field_integrator_name
end

#parser_field_nameString

The parser field internal name.

Returns:

  • (String)


23
24
25
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 23

def parser_field_name
  @parser_field_name
end

#parser_field_sequenceInteger

The parser field sequence.

Returns:

  • (Integer)


39
40
41
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 39

def parser_field_sequence
  @parser_field_sequence
end

#parser_nameString

The parser internal name.

Returns:

  • (String)


35
36
37
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 35

def parser_name
  @parser_name
end

#storage_field_nameString

The storage field name.

Returns:

  • (String)


27
28
29
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 27

def storage_field_name
  @storage_field_name
end

#structured_column_infoString

The structured column information.

Returns:

  • (String)


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

def structured_column_info
  @structured_column_info
end

Class Method Details

.attribute_mapObject

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



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 49

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'field': :'field',
    'parser_field_id': :'parserFieldId',
    'parser_field_expression': :'parserFieldExpression',
    'parser_field_name': :'parserFieldName',
    'storage_field_name': :'storageFieldName',
    'parser_field_integrator_name': :'parserFieldIntegratorName',
    'parser_name': :'parserName',
    'parser_field_sequence': :'parserFieldSequence',
    'parser': :'parser',
    'structured_column_info': :'structuredColumnInfo'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 67

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'field': :'OCI::LogAnalytics::Models::LogAnalyticsField',
    'parser_field_id': :'Integer',
    'parser_field_expression': :'String',
    'parser_field_name': :'String',
    'storage_field_name': :'String',
    'parser_field_integrator_name': :'String',
    'parser_name': :'String',
    'parser_field_sequence': :'Integer',
    'parser': :'OCI::LogAnalytics::Models::LogAnalyticsParser',
    'structured_column_info': :'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



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 166

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

  self.class == other.class &&
    field == other.field &&
    parser_field_id == other.parser_field_id &&
    parser_field_expression == other.parser_field_expression &&
    parser_field_name == other.parser_field_name &&
    storage_field_name == other.storage_field_name &&
    parser_field_integrator_name == other.parser_field_integrator_name &&
    parser_name == other.parser_name &&
    parser_field_sequence == other.parser_field_sequence &&
    parser == other.parser &&
    structured_column_info == other.structured_column_info
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



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 205

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


185
186
187
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 185

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



194
195
196
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 194

def hash
  [field, parser_field_id, parser_field_expression, parser_field_name, storage_field_name, parser_field_integrator_name, parser_name, parser_field_sequence, parser, structured_column_info].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



238
239
240
241
242
243
244
245
246
247
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 238

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



232
233
234
# File 'lib/oci/log_analytics/models/log_analytics_parser_field.rb', line 232

def to_s
  to_hash.to_s
end