class OCI::Opsi::Models::MacsManagedExternalHostInsight

MACS-managed external host insight resource.

Constants

PLATFORM_TYPE_ENUM

Attributes

management_agent_id[RW]

[Required] The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent @return [String]

platform_name[RW]

Platform name. @return [String]

platform_type[R]

Platform type. @return [String]

platform_version[RW]

Platform version. @return [String]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 34
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'entity_source': :'entitySource',
    'id': :'id',
    'compartment_id': :'compartmentId',
    'host_name': :'hostName',
    'host_display_name': :'hostDisplayName',
    'host_type': :'hostType',
    'processor_count': :'processorCount',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags',
    'status': :'status',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'management_agent_id': :'managementAgentId',
    'platform_name': :'platformName',
    'platform_type': :'platformType',
    'platform_version': :'platformVersion'
    # rubocop:enable Style/SymbolLiteral
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :id The value to assign to the {OCI::Opsi::Models::HostInsight#id id} proprety @option attributes [String] :compartment_id The value to assign to the {OCI::Opsi::Models::HostInsight#compartment_id compartment_id} proprety @option attributes [String] :host_name The value to assign to the {OCI::Opsi::Models::HostInsight#host_name host_name} proprety @option attributes [String] :host_display_name The value to assign to the {OCI::Opsi::Models::HostInsight#host_display_name host_display_name} proprety @option attributes [String] :host_type The value to assign to the {OCI::Opsi::Models::HostInsight#host_type host_type} proprety @option attributes [Integer] :processor_count The value to assign to the {OCI::Opsi::Models::HostInsight#processor_count processor_count} proprety @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {OCI::Opsi::Models::HostInsight#freeform_tags freeform_tags} proprety @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {OCI::Opsi::Models::HostInsight#defined_tags defined_tags} proprety @option attributes [Hash<String, Hash<String, Object>>] :system_tags The value to assign to the {OCI::Opsi::Models::HostInsight#system_tags system_tags} proprety @option attributes [String] :status The value to assign to the {OCI::Opsi::Models::HostInsight#status status} proprety @option attributes [DateTime] :time_created The value to assign to the {OCI::Opsi::Models::HostInsight#time_created time_created} proprety @option attributes [DateTime] :time_updated The value to assign to the {OCI::Opsi::Models::HostInsight#time_updated time_updated} proprety @option attributes [String] :lifecycle_state The value to assign to the {OCI::Opsi::Models::HostInsight#lifecycle_state lifecycle_state} proprety @option attributes [String] :lifecycle_details The value to assign to the {OCI::Opsi::Models::HostInsight#lifecycle_details lifecycle_details} proprety @option attributes [String] :management_agent_id The value to assign to the {#management_agent_id} property @option attributes [String] :platform_name The value to assign to the {#platform_name} property @option attributes [String] :platform_type The value to assign to the {#platform_type} property @option attributes [String] :platform_version The value to assign to the {#platform_version} property

Calls superclass method OCI::Opsi::Models::HostInsight::new
# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 111
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['entitySource'] = 'MACS_MANAGED_EXTERNAL_HOST'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.management_agent_id = attributes[:'managementAgentId'] if attributes[:'managementAgentId']

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

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

  self.platform_name = attributes[:'platformName'] if attributes[:'platformName']

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

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

  self.platform_type = attributes[:'platformType'] if attributes[:'platformType']

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

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

  self.platform_version = attributes[:'platformVersion'] if attributes[:'platformVersion']

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

  self.platform_version = attributes[:'platform_version'] if attributes[:'platform_version']
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 61
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'entity_source': :'String',
    'id': :'String',
    'compartment_id': :'String',
    'host_name': :'String',
    'host_display_name': :'String',
    'host_type': :'String',
    'processor_count': :'Integer',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_tags': :'Hash<String, Hash<String, Object>>',
    'status': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'management_agent_id': :'String',
    'platform_name': :'String',
    'platform_type': :'String',
    'platform_version': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 166
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    entity_source == other.entity_source &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    host_name == other.host_name &&
    host_display_name == other.host_display_name &&
    host_type == other.host_type &&
    processor_count == other.processor_count &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags &&
    status == other.status &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    management_agent_id == other.management_agent_id &&
    platform_name == other.platform_name &&
    platform_type == other.platform_type &&
    platform_version == other.platform_version
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 214
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) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 194
def eql?(other)
  self == other
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 203
def hash
  [entity_source, id, compartment_id, host_name, host_display_name, host_type, processor_count, freeform_tags, defined_tags, system_tags, status, time_created, time_updated, lifecycle_state, lifecycle_details, management_agent_id, platform_name, platform_type, platform_version].hash
end
platform_type=(platform_type) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] platform_type Object to be assigned

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 150
def platform_type=(platform_type)
  # rubocop:disable Style/ConditionalAssignment
  if platform_type && !PLATFORM_TYPE_ENUM.include?(platform_type)
    OCI.logger.debug("Unknown value for 'platform_type' [" + platform_type + "]. Mapping to 'PLATFORM_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @platform_type = PLATFORM_TYPE_UNKNOWN_ENUM_VALUE
  else
    @platform_type = platform_type
  end
  # rubocop:enable Style/ConditionalAssignment
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 247
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_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 241
def to_s
  to_hash.to_s
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/opsi/models/macs_managed_external_host_insight.rb, line 264
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end