Class: OCI::FleetAppsManagement::Models::InventoryRecord

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

Overview

Information about an inventory target.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_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 = {}) ⇒ InventoryRecord

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
# File 'lib/oci/fleet_apps_management/models/inventory_record.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']
end

Instance Attribute Details

#architectureString

[Required] Architecture of the resource associated with the target

Returns:

  • (String)


56
57
58
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 56

def architecture
  @architecture
end

#compartment_idString

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

Returns:

  • (String)


40
41
42
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 40

def compartment_id
  @compartment_id
end

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

[Required] List of target components



64
65
66
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 64

def components
  @components
end

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

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



68
69
70
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 68

def installed_patches
  @installed_patches
end

#lifecycle_stateString

The current state of the Inventory target.

Returns:

  • (String)


80
81
82
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 80

def lifecycle_state
  @lifecycle_state
end

#os_typeString

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

Returns:

  • (String)


52
53
54
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 52

def os_type
  @os_type
end

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

[Required] List of target properties



60
61
62
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 60

def properties
  @properties
end

#target_idString

[Required] The OCID of the Inventory target.

Returns:

  • (String)


20
21
22
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 20

def target_id
  @target_id
end

#target_nameString

[Required] Name of the target

Returns:

  • (String)


24
25
26
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 24

def target_name
  @target_name
end

#target_product_idString

OCID of the product installed at the target path

Returns:

  • (String)


44
45
46
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 44

def target_product_id
  @target_product_id
end

#target_product_nameString

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

Returns:

  • (String)


48
49
50
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 48

def target_product_name
  @target_product_name
end

#target_resource_idString

[Required] OCID of the resource associated with the target

Returns:

  • (String)


32
33
34
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 32

def target_resource_id
  @target_resource_id
end

#target_resource_nameString

Name of the resource associated with the target

Returns:

  • (String)


36
37
38
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 36

def target_resource_name
  @target_resource_name
end

#time_createdDateTime

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

Returns:

  • (DateTime)


72
73
74
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 72

def time_created
  @time_created
end

#time_updatedDateTime

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

Returns:

  • (DateTime)


76
77
78
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 76

def time_updated
  @time_updated
end

#versionString

[Required] Version of the product on the target

Returns:

  • (String)


28
29
30
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 28

def version
  @version
end

Class Method Details

.attribute_mapObject

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



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

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'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

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'
    # 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



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 259

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



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 304

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


284
285
286
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 284

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



293
294
295
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 293

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



337
338
339
340
341
342
343
344
345
346
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 337

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



331
332
333
# File 'lib/oci/fleet_apps_management/models/inventory_record.rb', line 331

def to_s
  to_hash.to_s
end