Class: OCI::FleetAppsManagement::Models::FleetTargetSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/fleet_apps_management/models/fleet_target_summary.rb

Overview

Summary of a confirmed target within a fleet.

Constant Summary collapse

COMPLIANCE_STATE_ENUM =
[
  COMPLIANCE_STATE_UNKNOWN = 'UNKNOWN'.freeze,
  COMPLIANCE_STATE_COMPLIANT = 'COMPLIANT'.freeze,
  COMPLIANCE_STATE_NON_COMPLIANT = 'NON_COMPLIANT'.freeze,
  COMPLIANCE_STATE_WARNING = 'WARNING'.freeze,
  COMPLIANCE_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 = {}) ⇒ FleetTargetSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 131

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

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

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

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

  self.compliance_state = attributes[:'complianceState'] if attributes[:'complianceState']

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

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

  self.time_of_last_successful_discovery = attributes[:'timeOfLastSuccessfulDiscovery'] if attributes[:'timeOfLastSuccessfulDiscovery']

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

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

  self.time_of_last_discovery_attempt = attributes[:'timeOfLastDiscoveryAttempt'] if attributes[:'timeOfLastDiscoveryAttempt']

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

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

  self.is_last_discovery_attempt_successful = attributes[:'isLastDiscoveryAttemptSuccessful'] unless attributes[:'isLastDiscoveryAttemptSuccessful'].nil?

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

  self.is_last_discovery_attempt_successful = attributes[:'is_last_discovery_attempt_successful'] unless attributes[:'is_last_discovery_attempt_successful'].nil?

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

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

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

Instance Attribute Details

#compartment_idString

compartment OCID

Returns:

  • (String)


26
27
28
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 26

def compartment_id
  @compartment_id
end

#compliance_stateString

The last known compliance state of the target.

Returns:

  • (String)


49
50
51
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 49

def compliance_state
  @compliance_state
end

#display_nameString

[Required] A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Example: My new resource

Returns:

  • (String)


34
35
36
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 34

def display_name
  @display_name
end

#idString

[Required] The OCID of the resource.

Returns:

  • (String)


22
23
24
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 22

def id
  @id
end

#is_last_discovery_attempt_successfulBOOLEAN

A boolean flag that represents whether the last discovery attempt was successful.

Returns:

  • (BOOLEAN)


61
62
63
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 61

def is_last_discovery_attempt_successful
  @is_last_discovery_attempt_successful
end

#lifecycle_stateString

The current state of the FleetTarget.

Returns:

  • (String)


65
66
67
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 65

def lifecycle_state
  @lifecycle_state
end

#productString

Product to which the target belongs to.

Returns:

  • (String)


42
43
44
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 42

def product
  @product
end

#resourceOCI::FleetAppsManagement::Models::TargetResource



45
46
47
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 45

def resource
  @resource
end

#system_tagsHash<String, Hash<String, Object>>

System tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


71
72
73
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 71

def system_tags
  @system_tags
end

#time_of_last_discovery_attemptDateTime

The time when last discovery was attempted.

Returns:

  • (DateTime)


57
58
59
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 57

def time_of_last_discovery_attempt
  @time_of_last_discovery_attempt
end

#time_of_last_successful_discoveryDateTime

The time when the last successful discovery was made.

Returns:

  • (DateTime)


53
54
55
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 53

def time_of_last_successful_discovery
  @time_of_last_successful_discovery
end

#versionString

Current version of target.

Returns:

  • (String)


38
39
40
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 38

def version
  @version
end

Class Method Details

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 74

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'display_name': :'displayName',
    'version': :'version',
    'product': :'product',
    'resource': :'resource',
    'compliance_state': :'complianceState',
    'time_of_last_successful_discovery': :'timeOfLastSuccessfulDiscovery',
    'time_of_last_discovery_attempt': :'timeOfLastDiscoveryAttempt',
    'is_last_discovery_attempt_successful': :'isLastDiscoveryAttemptSuccessful',
    'lifecycle_state': :'lifecycleState',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 94

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'display_name': :'String',
    'version': :'String',
    'product': :'String',
    'resource': :'OCI::FleetAppsManagement::Models::TargetResource',
    'compliance_state': :'String',
    'time_of_last_successful_discovery': :'DateTime',
    'time_of_last_discovery_attempt': :'DateTime',
    'is_last_discovery_attempt_successful': :'BOOLEAN',
    'lifecycle_state': :'String',
    'system_tags': :'Hash<String, Hash<String, Object>>'
    # 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



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 214

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

  self.class == other.class &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    display_name == other.display_name &&
    version == other.version &&
    product == other.product &&
    resource == other.resource &&
    compliance_state == other.compliance_state &&
    time_of_last_successful_discovery == other.time_of_last_successful_discovery &&
    time_of_last_discovery_attempt == other.time_of_last_discovery_attempt &&
    is_last_discovery_attempt_successful == other.is_last_discovery_attempt_successful &&
    lifecycle_state == other.lifecycle_state &&
    system_tags == other.system_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



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 255

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


235
236
237
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 235

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



244
245
246
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 244

def hash
  [id, compartment_id, display_name, version, product, resource, compliance_state, time_of_last_successful_discovery, time_of_last_discovery_attempt, is_last_discovery_attempt_successful, lifecycle_state, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



288
289
290
291
292
293
294
295
296
297
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 288

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



282
283
284
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 282

def to_s
  to_hash.to_s
end