Class: OCI::StackMonitoring::Models::DiscoveryDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/stack_monitoring/models/discovery_details.rb

Overview

The request of DiscoveryJob Resource details.

Constant Summary collapse

RESOURCE_TYPE_ENUM =
[
  RESOURCE_TYPE_WEBLOGIC_DOMAIN = 'WEBLOGIC_DOMAIN'.freeze,
  RESOURCE_TYPE_EBS_INSTANCE = 'EBS_INSTANCE'.freeze,
  RESOURCE_TYPE_ORACLE_DATABASE = 'ORACLE_DATABASE'.freeze,
  RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DiscoveryDetails

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
# File 'lib/oci/stack_monitoring/models/discovery_details.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.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.resource_type = attributes[:'resourceType'] if attributes[:'resourceType']

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

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

  self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName']

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

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

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

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

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

Instance Attribute Details

#agent_idString

**[Required]** The OCID of Management Agent

Returns:

  • (String)


20
21
22
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 20

def agent_id
  @agent_id
end

#credentialsOCI::StackMonitoring::Models::CredentialCollection



35
36
37
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 35

def credentials
  @credentials
end

#propertiesOCI::StackMonitoring::Models::PropertyDetails

This attribute is required.



32
33
34
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 32

def properties
  @properties
end

#resource_nameString

**[Required]** The Name of resource type

Returns:

  • (String)


28
29
30
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 28

def resource_name
  @resource_name
end

#resource_typeString

**[Required]** Resource Type.

Returns:

  • (String)


24
25
26
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 24

def resource_type
  @resource_type
end

#tagsOCI::StackMonitoring::Models::PropertyDetails



38
39
40
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 38

def tags
  @tags
end

Class Method Details

.attribute_mapObject

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



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 41

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'agent_id': :'agentId',
    'resource_type': :'resourceType',
    'resource_name': :'resourceName',
    'properties': :'properties',
    'credentials': :'credentials',
    'tags': :'tags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 55

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'agent_id': :'String',
    'resource_type': :'String',
    'resource_name': :'String',
    'properties': :'OCI::StackMonitoring::Models::PropertyDetails',
    'credentials': :'OCI::StackMonitoring::Models::CredentialCollection',
    'tags': :'OCI::StackMonitoring::Models::PropertyDetails'
    # 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



131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 131

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

  self.class == other.class &&
    agent_id == other.agent_id &&
    resource_type == other.resource_type &&
    resource_name == other.resource_name &&
    properties == other.properties &&
    credentials == other.credentials &&
    tags == other.tags
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



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

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


146
147
148
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 146

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



155
156
157
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 155

def hash
  [agent_id, resource_type, resource_name, properties, credentials, tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 199

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



193
194
195
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 193

def to_s
  to_hash.to_s
end