Class: OCI::FleetAppsManagement::Models::InventoryRecordSummary

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

Overview

Summary information about an inventory target.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ InventoryRecordSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 152

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

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

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

  self.target_name = attributes[:'targetName'] if attributes[:'targetName']

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

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

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

  self.target_resource_id = attributes[:'targetResourceId'] if attributes[:'targetResourceId']

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

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

  self.target_resource_name = attributes[:'targetResourceName'] if attributes[:'targetResourceName']

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

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

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

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

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

  self.target_product_name = attributes[:'targetProductName'] if attributes[:'targetProductName']

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

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

  self.os_type = attributes[:'osType'] if attributes[:'osType']

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

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

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

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

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

  self.installed_patches = attributes[:'installedPatches'] if attributes[:'installedPatches']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  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']
end

Instance Attribute Details

#architectureString

[Required] Architecture of the resource associated with the target

Returns:

  • (String)


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

def architecture
  @architecture
end

#compartment_idString

[Required] OCID of the compartment to which the resource belongs to.

Returns:

  • (String)


33
34
35
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 33

def compartment_id
  @compartment_id
end

#componentsArray<OCI::FleetAppsManagement::Models::InventoryRecordComponent>

[Required] List of target components



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

def components
  @components
end

#installed_patchesArray<OCI::FleetAppsManagement::Models::InventoryRecordPatchDetails>

[Required] List of details on the patches currently installed on the target



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

def installed_patches
  @installed_patches
end

#lifecycle_stateString

The current state of the Inventory target.

Returns:

  • (String)


73
74
75
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 73

def lifecycle_state
  @lifecycle_state
end

#os_typeString

[Required] OS installed on the resource associated with the target

Returns:

  • (String)


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

def os_type
  @os_type
end

#parent_target_nameString

Name of the parent target.

Returns:

  • (String)


77
78
79
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 77

def parent_target_name
  @parent_target_name
end

#propertiesArray<OCI::FleetAppsManagement::Models::InventoryRecordProperty>

[Required] List of target properties



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

def properties
  @properties
end

#target_idString

[Required] The id of the Inventory target.

Returns:

  • (String)


13
14
15
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 13

def target_id
  @target_id
end

#target_nameString

[Required] Name of the target

Returns:

  • (String)


17
18
19
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 17

def target_name
  @target_name
end

#target_product_idString

OCID of the product installed at the target path

Returns:

  • (String)


37
38
39
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 37

def target_product_id
  @target_product_id
end

#target_product_nameString

[Required] Name of the product installed at the target path

Returns:

  • (String)


41
42
43
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 41

def target_product_name
  @target_product_name
end

#target_resource_idString

[Required] OCID of the resource associated with the target

Returns:

  • (String)


25
26
27
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 25

def target_resource_id
  @target_resource_id
end

#target_resource_nameString

Name of the resource associated with the target

Returns:

  • (String)


29
30
31
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 29

def target_resource_name
  @target_resource_name
end

#time_createdDateTime

The time this resource was created. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

#time_updatedDateTime

The time this resource was last updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


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

def time_updated
  @time_updated
end

#versionString

[Required] Version of the product on the target

Returns:

  • (String)


21
22
23
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 21

def version
  @version
end

Class Method Details

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 80

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'target_id': :'targetId',
    'target_name': :'targetName',
    'version': :'version',
    'target_resource_id': :'targetResourceId',
    'target_resource_name': :'targetResourceName',
    'compartment_id': :'compartmentId',
    'target_product_id': :'targetProductId',
    'target_product_name': :'targetProductName',
    'os_type': :'osType',
    'architecture': :'architecture',
    'properties': :'properties',
    'components': :'components',
    'installed_patches': :'installedPatches',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'lifecycle_state': :'lifecycleState',
    'parent_target_name': :'parentTargetName'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 105

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'target_id': :'String',
    'target_name': :'String',
    'version': :'String',
    'target_resource_id': :'String',
    'target_resource_name': :'String',
    'compartment_id': :'String',
    'target_product_id': :'String',
    'target_product_name': :'String',
    'os_type': :'String',
    'architecture': :'String',
    'properties': :'Array<OCI::FleetAppsManagement::Models::InventoryRecordProperty>',
    'components': :'Array<OCI::FleetAppsManagement::Models::InventoryRecordComponent>',
    'installed_patches': :'Array<OCI::FleetAppsManagement::Models::InventoryRecordPatchDetails>',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'lifecycle_state': :'String',
    'parent_target_name': :'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



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 252

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

  self.class == other.class &&
    target_id == other.target_id &&
    target_name == other.target_name &&
    version == other.version &&
    target_resource_id == other.target_resource_id &&
    target_resource_name == other.target_resource_name &&
    compartment_id == other.compartment_id &&
    target_product_id == other.target_product_id &&
    target_product_name == other.target_product_name &&
    os_type == other.os_type &&
    architecture == other.architecture &&
    properties == other.properties &&
    components == other.components &&
    installed_patches == other.installed_patches &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    lifecycle_state == other.lifecycle_state &&
    parent_target_name == other.parent_target_name
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



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 298

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


278
279
280
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 278

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



287
288
289
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 287

def hash
  [target_id, target_name, version, target_resource_id, target_resource_name, compartment_id, target_product_id, target_product_name, os_type, architecture, properties, components, installed_patches, time_created, time_updated, lifecycle_state, parent_target_name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



331
332
333
334
335
336
337
338
339
340
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 331

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



325
326
327
# File 'lib/oci/fleet_apps_management/models/inventory_record_summary.rb', line 325

def to_s
  to_hash.to_s
end