Class: OCI::LogAnalytics::Models::AssociableEntity

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

Overview

Entity details including whether or not it is eligible for association with the source.

Constant Summary collapse

ELIGIBILITY_STATUS_ENUM =
[
  ELIGIBILITY_STATUS_ELIGIBLE = 'ELIGIBLE'.freeze,
  ELIGIBILITY_STATUS_INELIGIBLE = 'INELIGIBLE'.freeze,
  ELIGIBILITY_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AssociableEntity

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :entity_id (String)

    The value to assign to the #entity_id property

  • :entity_name (String)

    The value to assign to the #entity_name property

  • :entity_type_name (String)

    The value to assign to the #entity_type_name property

  • :entity_type_display_name (String)

    The value to assign to the #entity_type_display_name property

  • :host (String)

    The value to assign to the #host property

  • :agent_id (String)

    The value to assign to the #agent_id property

  • :eligibility_status (String)

    The value to assign to the #eligibility_status property

  • :ineligibility_details (String)

    The value to assign to the #ineligibility_details property



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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/log_analytics/models/associable_entity.rb', line 96

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

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

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

  self.entity_name = attributes[:'entityName'] if attributes[:'entityName']

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

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

  self.entity_type_name = attributes[:'entityTypeName'] if attributes[:'entityTypeName']

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

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

  self.entity_type_display_name = attributes[:'entityTypeDisplayName'] if attributes[:'entityTypeDisplayName']

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

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

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

  self.agent_id = attributes[:'agentId'] if attributes[:'agentId']

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

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

  self.eligibility_status = attributes[:'eligibilityStatus'] if attributes[:'eligibilityStatus']

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

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

  self.ineligibility_details = attributes[:'ineligibilityDetails'] if attributes[:'ineligibilityDetails']

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

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

Instance Attribute Details

#agent_idString

The OCID of the Management Agent.

Returns:

  • (String)


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

def agent_id
  @agent_id
end

#eligibility_statusString

This field indicates whether the entity is (in)eligible to be associated with this source.

Returns:

  • (String)


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

def eligibility_status
  @eligibility_status
end

#entity_idString

The entity OCID.

Returns:

  • (String)


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

def entity_id
  @entity_id
end

#entity_nameString

The name of the entity.

Returns:

  • (String)


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

def entity_name
  @entity_name
end

#entity_type_display_nameString

The display name of the entity type.

Returns:

  • (String)


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

def entity_type_display_name
  @entity_type_display_name
end

#entity_type_nameString

The type name of the entity.

Returns:

  • (String)


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

def entity_type_name
  @entity_type_name
end

#hostString

The entity host.

Returns:

  • (String)


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

def host
  @host
end

#ineligibility_detailsString

The reason the entity is not eligible for association.

Returns:

  • (String)


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

def ineligibility_details
  @ineligibility_details
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'entity_id': :'entityId',
    'entity_name': :'entityName',
    'entity_type_name': :'entityTypeName',
    'entity_type_display_name': :'entityTypeDisplayName',
    'host': :'host',
    'agent_id': :'agentId',
    'eligibility_status': :'eligibilityStatus',
    'ineligibility_details': :'ineligibilityDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'entity_id': :'String',
    'entity_name': :'String',
    'entity_type_name': :'String',
    'entity_type_display_name': :'String',
    'host': :'String',
    'agent_id': :'String',
    'eligibility_status': :'String',
    'ineligibility_details': :'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



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

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

  self.class == other.class &&
    entity_id == other.entity_id &&
    entity_name == other.entity_name &&
    entity_type_name == other.entity_type_name &&
    entity_type_display_name == other.entity_type_display_name &&
    host == other.host &&
    agent_id == other.agent_id &&
    eligibility_status == other.eligibility_status &&
    ineligibility_details == other.ineligibility_details
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



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

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


184
185
186
# File 'lib/oci/log_analytics/models/associable_entity.rb', line 184

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



193
194
195
# File 'lib/oci/log_analytics/models/associable_entity.rb', line 193

def hash
  [entity_id, entity_name, entity_type_name, entity_type_display_name, host, agent_id, eligibility_status, ineligibility_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



231
232
233
# File 'lib/oci/log_analytics/models/associable_entity.rb', line 231

def to_s
  to_hash.to_s
end