Class: OCI::Jms::Models::FleetDiagnosisSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/jms/models/fleet_diagnosis_summary.rb

Overview

Diagnosis of a resource needed by the fleet.

Constant Summary collapse

RESOURCE_TYPE_ENUM =
[
  RESOURCE_TYPE_INVENTORY_LOG = 'INVENTORY_LOG'.freeze,
  RESOURCE_TYPE_OPERATION_LOG = 'OPERATION_LOG'.freeze,
  RESOURCE_TYPE_CRYPTO_SUMMARIZED_LOG = 'CRYPTO_SUMMARIZED_LOG'.freeze,
  RESOURCE_TYPE_ANALYSIS_OSS_BUCKET = 'ANALYSIS_OSS_BUCKET'.freeze,
  RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RESOURCE_STATE_ENUM =
[
  RESOURCE_STATE_ACTIVE = 'ACTIVE'.freeze,
  RESOURCE_STATE_INACTIVE = 'INACTIVE'.freeze,
  RESOURCE_STATE_NOT_FOUND = 'NOT_FOUND'.freeze,
  RESOURCE_STATE_OTHER = 'OTHER'.freeze,
  RESOURCE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ FleetDiagnosisSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :resource_type (String)

    The value to assign to the #resource_type property

  • :resource_id (String)

    The value to assign to the #resource_id property

  • :resource_state (String)

    The value to assign to the #resource_state property

  • :resource_diagnosis (String)

    The value to assign to the #resource_diagnosis property



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
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 86

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

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

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

  self.resource_state = attributes[:'resourceState'] if attributes[:'resourceState']

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

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

  self.resource_diagnosis = attributes[:'resourceDiagnosis'] if attributes[:'resourceDiagnosis']

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

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

Instance Attribute Details

#resource_diagnosisString

The diagnosis message.

Returns:

  • (String)


50
51
52
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 50

def resource_diagnosis
  @resource_diagnosis
end

#resource_idString

The OCID of the external resouce needed by the fleet.

Returns:

  • (String)


37
38
39
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 37

def resource_id
  @resource_id
end

#resource_stateString

The state of the resource. The resource state is ACTIVE when it works properly for the fleet. In case it would cause an issue for the fleet function, the state is INACTIVE. When JMS can't locate the resource, the state is NOT_FOUND. OTHER covers other cases, such as a temporarily network issue that prevents JMS from detecting the resource. Check the resourceDiagnosis for details.

Returns:

  • (String)


46
47
48
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 46

def resource_state
  @resource_state
end

#resource_typeString

[Required] The type of the resource needed by the fleet. This is the role of a resource in the fleet. Use the OCID to determine the actual OCI resource type such as log group or log.

Returns:

  • (String)


33
34
35
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 33

def resource_type
  @resource_type
end

Class Method Details

.attribute_mapObject

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



53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'resource_type': :'resourceType',
    'resource_id': :'resourceId',
    'resource_state': :'resourceState',
    'resource_diagnosis': :'resourceDiagnosis'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 65

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'resource_type': :'String',
    'resource_id': :'String',
    'resource_state': :'String',
    'resource_diagnosis': :'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



150
151
152
153
154
155
156
157
158
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 150

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

  self.class == other.class &&
    resource_type == other.resource_type &&
    resource_id == other.resource_id &&
    resource_state == other.resource_state &&
    resource_diagnosis == other.resource_diagnosis
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



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 183

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


163
164
165
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 163

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



172
173
174
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 172

def hash
  [resource_type, resource_id, resource_state, resource_diagnosis].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



216
217
218
219
220
221
222
223
224
225
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 216

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



210
211
212
# File 'lib/oci/jms/models/fleet_diagnosis_summary.rb', line 210

def to_s
  to_hash.to_s
end