Class: OCI::LogAnalytics::Models::LogAnalyticsExtendedField

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

Overview

LogAnalyticsExtendedField

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LogAnalyticsExtendedField

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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_extended_field.rb', line 80

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

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

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

  self.extended_field_definition_id = attributes[:'extendedFieldDefinitionId'] if attributes[:'extendedFieldDefinitionId']

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

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

  self.field_name = attributes[:'fieldName'] if attributes[:'fieldName']

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

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

  self.field_display_name = attributes[:'fieldDisplayName'] if attributes[:'fieldDisplayName']

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

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

  self.saved_regular_expression_name = attributes[:'savedRegularExpressionName'] if attributes[:'savedRegularExpressionName']

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

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

  self.extended_field_id = attributes[:'extendedFieldId'] if attributes[:'extendedFieldId']

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

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

Instance Attribute Details

#extended_field_definitionOCI::LogAnalytics::Models::LogAnalyticsSourceExtendedFieldDefinition



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

def extended_field_definition
  @extended_field_definition
end

#extended_field_definition_idInteger

The extended field unique identifier.

Returns:

  • (Integer)


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

def extended_field_definition_id
  @extended_field_definition_id
end

#extended_field_idInteger

The extended field unique identifier.

Returns:

  • (Integer)


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

def extended_field_id
  @extended_field_id
end

#fieldOCI::LogAnalytics::Models::LogAnalyticsField



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

def field
  @field
end

#field_display_nameString

The field internal display name.

Returns:

  • (String)


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

def field_display_name
  @field_display_name
end

#field_nameString

The field internal name

Returns:

  • (String)


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

def field_name
  @field_name
end

#saved_regular_expression_nameString

The saved regular expression name.

Returns:

  • (String)


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

def saved_regular_expression_name
  @saved_regular_expression_name
end

Class Method Details

.attribute_mapObject

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



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/oci/log_analytics/models/log_analytics_extended_field.rb', line 38

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'field': :'field',
    'extended_field_definition': :'extendedFieldDefinition',
    'extended_field_definition_id': :'extendedFieldDefinitionId',
    'field_name': :'fieldName',
    'field_display_name': :'fieldDisplayName',
    'saved_regular_expression_name': :'savedRegularExpressionName',
    'extended_field_id': :'extendedFieldId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'field': :'OCI::LogAnalytics::Models::LogAnalyticsField',
    'extended_field_definition': :'OCI::LogAnalytics::Models::LogAnalyticsSourceExtendedFieldDefinition',
    'extended_field_definition_id': :'Integer',
    'field_name': :'String',
    'field_display_name': :'String',
    'saved_regular_expression_name': :'String',
    'extended_field_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



132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/oci/log_analytics/models/log_analytics_extended_field.rb', line 132

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

  self.class == other.class &&
    field == other.field &&
    extended_field_definition == other.extended_field_definition &&
    extended_field_definition_id == other.extended_field_definition_id &&
    field_name == other.field_name &&
    field_display_name == other.field_display_name &&
    saved_regular_expression_name == other.saved_regular_expression_name &&
    extended_field_id == other.extended_field_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



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/log_analytics/models/log_analytics_extended_field.rb', line 168

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


148
149
150
# File 'lib/oci/log_analytics/models/log_analytics_extended_field.rb', line 148

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



157
158
159
# File 'lib/oci/log_analytics/models/log_analytics_extended_field.rb', line 157

def hash
  [field, extended_field_definition, extended_field_definition_id, field_name, field_display_name, saved_regular_expression_name, extended_field_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



201
202
203
204
205
206
207
208
209
210
# File 'lib/oci/log_analytics/models/log_analytics_extended_field.rb', line 201

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



195
196
197
# File 'lib/oci/log_analytics/models/log_analytics_extended_field.rb', line 195

def to_s
  to_hash.to_s
end