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):



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
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 138

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

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

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

  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

#parent_target_nameString

Name of the parent target.

Returns:

  • (String)


69
70
71
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 69

def parent_target_name
  @parent_target_name
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>>)


75
76
77
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 75

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.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 78

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',
    'parent_target_name': :'parentTargetName',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 99

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',
    'parent_target_name': :'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



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 227

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 &&
    parent_target_name == other.parent_target_name &&
    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



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 269

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


249
250
251
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 249

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



258
259
260
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 258

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, parent_target_name, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



302
303
304
305
306
307
308
309
310
311
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 302

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



296
297
298
# File 'lib/oci/fleet_apps_management/models/fleet_target_summary.rb', line 296

def to_s
  to_hash.to_s
end