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

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

Overview

LogAnalyticsSourceFunction

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



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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 115

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

argument



12
13
14
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 12

def arguments
  @arguments
end

#functionOCI::LogAnalytics::Models::LogAnalyticsMetaFunction



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

def function
  @function
end

#function_idInteger

source function Id

Returns:

  • (Integer)


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

def function_id
  @function_id
end

#is_enabledBOOLEAN

enabled flag

Returns:

  • (BOOLEAN)


16
17
18
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 16

def is_enabled
  @is_enabled
end

#is_systemBOOLEAN

is system flag

Returns:

  • (BOOLEAN)


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

def is_system
  @is_system
end

#lookup_columnString

column

Returns:

  • (String)


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

def lookup_column
  @lookup_column
end

#lookup_column_positionInteger

column position

Returns:

  • (Integer)


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

def lookup_column_position
  @lookup_column_position
end

#lookup_display_nameString

lookup display name

Returns:

  • (String)


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

def lookup_display_name
  @lookup_display_name
end

#lookup_modeInteger

lookup mode

Returns:

  • (Integer)


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

def lookup_mode
  @lookup_mode
end

#lookup_tableString

lookup table

Returns:

  • (String)


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

def lookup_table
  @lookup_table
end

#orderInteger

source function order

Returns:

  • (Integer)


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

def order
  @order
end

#source_idInteger

source Id

Returns:

  • (Integer)


55
56
57
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 55

def source_id
  @source_id
end

Class Method Details

.attribute_mapObject

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



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 58

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



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_function.rb', line 78

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'arguments': :'Array<OCI::LogAnalytics::Models::LogAnalyticsMetaFunctionArgument>',
    'is_enabled': :'BOOLEAN',
    'function': :'OCI::LogAnalytics::Models::LogAnalyticsMetaFunction',
    '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



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 189

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

  self.class == other.class &&
    arguments == other.arguments &&
    is_enabled == other.is_enabled &&
    function == other.function &&
    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



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 230

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


210
211
212
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 210

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



219
220
221
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 219

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



263
264
265
266
267
268
269
270
271
272
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 263

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



257
258
259
# File 'lib/oci/log_analytics/models/log_analytics_source_function.rb', line 257

def to_s
  to_hash.to_s
end