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):



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
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 146

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.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.



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

def arguments
  @arguments
end

#functionOCI::LogAnalytics::Models::LogAnalyticsMetaFunction



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

def function
  @function
end

#function_idInteger

The source function unique identifier.

Returns:

  • (Integer)


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

def function_id
  @function_id
end

#function_nameString

The source function name

Returns:

  • (String)


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

def function_name
  @function_name
end

#function_referenceString

The source function unique identifier as a string.

Returns:

  • (String)


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

def function_reference
  @function_reference
end

#is_enabledBOOLEAN

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

Returns:

  • (BOOLEAN)


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

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)


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

def is_system
  @is_system
end

#lookup_columnString

The lookup column.

Returns:

  • (String)


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

def lookup_column
  @lookup_column
end

#lookup_column_positionInteger

The lookup column position.

Returns:

  • (Integer)


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

def lookup_column_position
  @lookup_column_position
end

#lookup_display_nameString

The lookup display name.

Returns:

  • (String)


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

def lookup_display_name
  @lookup_display_name
end

#lookup_modeInteger

The lookup mode.

Returns:

  • (Integer)


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

def lookup_mode
  @lookup_mode
end

#lookup_tableString

The lookup table.

Returns:

  • (String)


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

def lookup_table
  @lookup_table
end

#orderInteger

The source function order.

Returns:

  • (Integer)


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

def order
  @order
end

#source_idInteger

The source unique identifier.

Returns:

  • (Integer)


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

def source_id
  @source_id
end

#source_referenceString

The source unique identifier as a string.

Returns:

  • (String)


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

def source_reference
  @source_reference
end

Class Method Details

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 80

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'arguments': :'arguments',
    'is_enabled': :'isEnabled',
    'function': :'function',
    'function_name': :'functionName',
    'function_reference': :'functionReference',
    'source_reference': :'sourceReference',
    '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.



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 103

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',
    '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



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 253

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 &&
    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



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 297

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


277
278
279
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 277

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



286
287
288
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 286

def hash
  [arguments, is_enabled, function, function_name, function_reference, source_reference, 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



330
331
332
333
334
335
336
337
338
339
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 330

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



324
325
326
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 324

def to_s
  to_hash.to_s
end