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



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
146
# File 'lib/oci/log_analytics/models/associable_entity.rb', line 97

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)


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

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)


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

def eligibility_status
  @eligibility_status
end

#entity_idString

The entity OCID.

Returns:

  • (String)


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

def entity_id
  @entity_id
end

#entity_nameString

The name of the entity.

Returns:

  • (String)


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

def entity_name
  @entity_name
end

#entity_type_display_nameString

The display name of the entity type.

Returns:

  • (String)


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

def entity_type_display_name
  @entity_type_display_name
end

#entity_type_nameString

The type name of the entity.

Returns:

  • (String)


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

def entity_type_name
  @entity_type_name
end

#hostString

The entity host.

Returns:

  • (String)


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

def host
  @host
end

#ineligibility_detailsString

The reason the entity is not eligible for association.

Returns:

  • (String)


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

def ineligibility_details
  @ineligibility_details
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

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



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

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



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

def to_s
  to_hash.to_s
end