Class: OCI::FleetAppsManagement::Models::InstalledPatchSummary

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

Overview

Summary information about an installed patches.

Constant Summary collapse

SEVERITY_ENUM =
[
  SEVERITY_CRITICAL = 'CRITICAL'.freeze,
  SEVERITY_HIGH = 'HIGH'.freeze,
  SEVERITY_MEDIUM = 'MEDIUM'.freeze,
  SEVERITY_LOW = 'LOW'.freeze,
  SEVERITY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ InstalledPatchSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :patch_id (String)

    The value to assign to the #patch_id property

  • :patch_name (String)

    The value to assign to the #patch_name property

  • :patch_description (String)

    The value to assign to the #patch_description property

  • :time_applied (DateTime)

    The value to assign to the #time_applied property

  • :time_released (DateTime)

    The value to assign to the #time_released property

  • :patch_type (String)

    The value to assign to the #patch_type property

  • :patch_level (String)

    The value to assign to the #patch_level property

  • :severity (String)

    The value to assign to the #severity property



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 98

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

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

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

  self.patch_name = attributes[:'patchName'] if attributes[:'patchName']

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

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

  self.patch_description = attributes[:'patchDescription'] if attributes[:'patchDescription']

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

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

  self.time_applied = attributes[:'timeApplied'] if attributes[:'timeApplied']

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

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

  self.time_released = attributes[:'timeReleased'] if attributes[:'timeReleased']

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

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

  self.patch_type = attributes[:'patchType'] if attributes[:'patchType']

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

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

  self.patch_level = attributes[:'patchLevel'] if attributes[:'patchLevel']

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

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

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

Instance Attribute Details

#patch_descriptionString

[Required] Description of the patch

Returns:

  • (String)


30
31
32
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 30

def patch_description
  @patch_description
end

#patch_idString

[Required] The OCID of the patch.

Returns:

  • (String)


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

def patch_id
  @patch_id
end

#patch_levelString

Patch Name.

Returns:

  • (String)


46
47
48
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 46

def patch_level
  @patch_level
end

#patch_nameString

[Required] Name of the patch

Returns:

  • (String)


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

def patch_name
  @patch_name
end

#patch_typeString

Description of the patch

Returns:

  • (String)


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

def patch_type
  @patch_type
end

#severityString

Patch Severity.

Returns:

  • (String)


50
51
52
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 50

def severity
  @severity
end

#time_appliedDateTime

Date on which the patch was applied to the target

Returns:

  • (DateTime)


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

def time_applied
  @time_applied
end

#time_releasedDateTime

Date on which the patch was released

Returns:

  • (DateTime)


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

def time_released
  @time_released
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
63
64
65
66
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'patch_id': :'patchId',
    'patch_name': :'patchName',
    'patch_description': :'patchDescription',
    'time_applied': :'timeApplied',
    'time_released': :'timeReleased',
    'patch_type': :'patchType',
    'patch_level': :'patchLevel',
    'severity': :'severity'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 69

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'patch_id': :'String',
    'patch_name': :'String',
    'patch_description': :'String',
    'time_applied': :'DateTime',
    'time_released': :'DateTime',
    'patch_type': :'String',
    'patch_level': :'String',
    'severity': :'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



169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 169

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

  self.class == other.class &&
    patch_id == other.patch_id &&
    patch_name == other.patch_name &&
    patch_description == other.patch_description &&
    time_applied == other.time_applied &&
    time_released == other.time_released &&
    patch_type == other.patch_type &&
    patch_level == other.patch_level &&
    severity == other.severity
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



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 206

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


186
187
188
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 186

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



195
196
197
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 195

def hash
  [patch_id, patch_name, patch_description, time_applied, time_released, patch_type, patch_level, severity].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



239
240
241
242
243
244
245
246
247
248
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 239

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



233
234
235
# File 'lib/oci/fleet_apps_management/models/installed_patch_summary.rb', line 233

def to_s
  to_hash.to_s
end