Class: OCI::LogAnalytics::Models::LogAnalyticsSourceFunction

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

Overview

LogAnalyticsSourceFunction

Constant Summary collapse

FUNCTION_NAME_ENUM =
[
  FUNCTION_NAME_GEOLOCATION = 'GEOLOCATION'.freeze,
  FUNCTION_NAME_LOOKUP = 'LOOKUP'.freeze,
  FUNCTION_NAME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LogAnalyticsSourceFunction

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 154

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

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

  self.function_name = attributes[:'functionName'] if attributes[:'functionName']
  self.function_name = "LOOKUP" if function_name.nil? && !attributes.key?(:'functionName') # rubocop:disable Style/StringLiterals

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

  self.function_name = attributes[:'function_name'] if attributes[:'function_name']
  self.function_name = "LOOKUP" if function_name.nil? && !attributes.key?(:'functionName') && !attributes.key?(:'function_name') # rubocop:disable Style/StringLiterals

  self.function_reference = attributes[:'functionReference'] if attributes[:'functionReference']

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

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

  self.source_reference = attributes[:'sourceReference'] if attributes[:'sourceReference']

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

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

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

  self.function_id = attributes[:'functionId'] if attributes[:'functionId']

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

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

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

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

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

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

  self.lookup_column_position = attributes[:'lookupColumnPosition'] if attributes[:'lookupColumnPosition']

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

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

  self.lookup_display_name = attributes[:'lookupDisplayName'] if attributes[:'lookupDisplayName']

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

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

  self.lookup_mode = attributes[:'lookupMode'] if attributes[:'lookupMode']

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

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

  self.lookup_table = attributes[:'lookupTable'] if attributes[:'lookupTable']

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

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

  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']
end

Instance Attribute Details

#argumentsArray<OCI::LogAnalytics::Models::LogAnalyticsMetaFunctionArgument>

The function argument.



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

def arguments
  @arguments
end

#featuresArray<String>

Features of the source function to use for enrichment.

Returns:

  • (Array<String>)


44
45
46
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 44

def features
  @features
end

#functionOCI::LogAnalytics::Models::LogAnalyticsMetaFunction



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

def function
  @function
end

#function_idInteger

The source function unique identifier.

Returns:

  • (Integer)


48
49
50
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 48

def function_id
  @function_id
end

#function_nameString

The source function name

Returns:

  • (String)


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

def function_name
  @function_name
end

#function_referenceString

The source function unique identifier as a string.

Returns:

  • (String)


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

def function_reference
  @function_reference
end

#is_enabledBOOLEAN

A flag inidcating whether or not the source function is enabled.

Returns:

  • (BOOLEAN)


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

def is_enabled
  @is_enabled
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)


58
59
60
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 58

def is_system
  @is_system
end

#lookup_columnString

The lookup column.

Returns:

  • (String)


62
63
64
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 62

def lookup_column
  @lookup_column
end

#lookup_column_positionInteger

The lookup column position.

Returns:

  • (Integer)


66
67
68
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 66

def lookup_column_position
  @lookup_column_position
end

#lookup_display_nameString

The lookup display name.

Returns:

  • (String)


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

def lookup_display_name
  @lookup_display_name
end

#lookup_modeInteger

The lookup mode.

Returns:

  • (Integer)


74
75
76
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 74

def lookup_mode
  @lookup_mode
end

#lookup_tableString

The lookup table.

Returns:

  • (String)


78
79
80
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 78

def lookup_table
  @lookup_table
end

#orderInteger

The source function order.

Returns:

  • (Integer)


52
53
54
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 52

def order
  @order
end

#source_idInteger

The source unique identifier.

Returns:

  • (Integer)


82
83
84
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 82

def source_id
  @source_id
end

#source_referenceString

The source unique identifier as a string.

Returns:

  • (String)


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

def source_reference
  @source_reference
end

Class Method Details

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 85

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'arguments': :'arguments',
    'is_enabled': :'isEnabled',
    'function': :'function',
    'function_name': :'functionName',
    'function_reference': :'functionReference',
    'source_reference': :'sourceReference',
    'features': :'features',
    'function_id': :'functionId',
    'order': :'order',
    'is_system': :'isSystem',
    'lookup_column': :'lookupColumn',
    'lookup_column_position': :'lookupColumnPosition',
    'lookup_display_name': :'lookupDisplayName',
    'lookup_mode': :'lookupMode',
    'lookup_table': :'lookupTable',
    'source_id': :'sourceId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 109

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'arguments': :'Array<OCI::LogAnalytics::Models::LogAnalyticsMetaFunctionArgument>',
    'is_enabled': :'BOOLEAN',
    'function': :'OCI::LogAnalytics::Models::LogAnalyticsMetaFunction',
    'function_name': :'String',
    'function_reference': :'String',
    'source_reference': :'String',
    'features': :'Array<String>',
    'function_id': :'Integer',
    'order': :'Integer',
    'is_system': :'BOOLEAN',
    'lookup_column': :'String',
    'lookup_column_position': :'Integer',
    'lookup_display_name': :'String',
    'lookup_mode': :'Integer',
    'lookup_table': :'String',
    'source_id': :'Integer'
    # 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



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 263

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

  self.class == other.class &&
    arguments == other.arguments &&
    is_enabled == other.is_enabled &&
    function == other.function &&
    function_name == other.function_name &&
    function_reference == other.function_reference &&
    source_reference == other.source_reference &&
    features == other.features &&
    function_id == other.function_id &&
    order == other.order &&
    is_system == other.is_system &&
    lookup_column == other.lookup_column &&
    lookup_column_position == other.lookup_column_position &&
    lookup_display_name == other.lookup_display_name &&
    lookup_mode == other.lookup_mode &&
    lookup_table == other.lookup_table &&
    source_id == other.source_id
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



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

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


288
289
290
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 288

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



297
298
299
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 297

def hash
  [arguments, is_enabled, function, function_name, function_reference, source_reference, features, function_id, order, is_system, lookup_column, lookup_column_position, lookup_display_name, lookup_mode, lookup_table, source_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



341
342
343
344
345
346
347
348
349
350
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 341

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



335
336
337
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 335

def to_s
  to_hash.to_s
end