Class: OCI::Adm::Models::VulnerabilityDetails
- Inherits:
-
Object
- Object
- OCI::Adm::Models::VulnerabilityDetails
- Defined in:
- lib/oci/adm/models/vulnerability_details.rb
Overview
A vulnerability details contains details for a vulnerability as reported by the source.
Constant Summary collapse
- SEVERITY_ENUM =
[ SEVERITY_NONE = 'NONE'.freeze, SEVERITY_LOW = 'LOW'.freeze, SEVERITY_MEDIUM = 'MEDIUM'.freeze, SEVERITY_HIGH = 'HIGH'.freeze, SEVERITY_CRITICAL = 'CRITICAL'.freeze, SEVERITY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#is_direct_vulnerability ⇒ BOOLEAN
Indicates if the vulnerability is immediately affecting any artifact in an audit.
-
#metrics ⇒ Array<OCI::Adm::Models::VulnerabilityMetric>
List of reported metrics by the source.
-
#references ⇒ Array<String>
References of the vulnerability at source.
-
#related_vulnerabilities ⇒ Array<OCI::Adm::Models::RelatedVulnerabilityReference>
List of related vulnerabilities, as reported by the source, along with aliases, where aliases are the same vulnerability reported by different sources.
-
#severity ⇒ String
ADM qualitative severity score.
-
#source ⇒ String
[Required] Source that published the vulnerability.
-
#status ⇒ String
The status of the vulnerability, may be one of Analyzed, Rejected, Modified, Awaiting Analysis, Undergoing Analysis, Published, Withdrawn, Received as reported by the source.
-
#time_created ⇒ DateTime
Date when the vulnerability was published, at the source.
-
#time_updated ⇒ DateTime
Date when the vulnerability was last modified, at the source.
-
#vulnerability_description ⇒ String
Detailed description of the vulnerability.
-
#vulnerability_id ⇒ String
[Required] Vulnerability identifier from source, e.g., CVE-1999-0067, GHSA-9vjp-v76f-g363.
-
#vulnerability_summary ⇒ String
Summary of the vulnerability.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ VulnerabilityDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ VulnerabilityDetails
Initializes the object
128 129 130 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 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 128 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.vulnerability_id = attributes[:'vulnerabilityId'] if attributes[:'vulnerabilityId'] raise 'You cannot provide both :vulnerabilityId and :vulnerability_id' if attributes.key?(:'vulnerabilityId') && attributes.key?(:'vulnerability_id') self.vulnerability_id = attributes[:'vulnerability_id'] if attributes[:'vulnerability_id'] self.source = attributes[:'source'] if attributes[:'source'] self.is_direct_vulnerability = attributes[:'isDirectVulnerability'] unless attributes[:'isDirectVulnerability'].nil? raise 'You cannot provide both :isDirectVulnerability and :is_direct_vulnerability' if attributes.key?(:'isDirectVulnerability') && attributes.key?(:'is_direct_vulnerability') self.is_direct_vulnerability = attributes[:'is_direct_vulnerability'] unless attributes[:'is_direct_vulnerability'].nil? self. = attributes[:'relatedVulnerabilities'] if attributes[:'relatedVulnerabilities'] raise 'You cannot provide both :relatedVulnerabilities and :related_vulnerabilities' if attributes.key?(:'relatedVulnerabilities') && attributes.key?(:'related_vulnerabilities') self. = attributes[:'related_vulnerabilities'] if attributes[:'related_vulnerabilities'] 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.severity = attributes[:'severity'] if attributes[:'severity'] self.metrics = attributes[:'metrics'] if attributes[:'metrics'] self.status = attributes[:'status'] if attributes[:'status'] self.references = attributes[:'references'] if attributes[:'references'] self.vulnerability_summary = attributes[:'vulnerabilitySummary'] if attributes[:'vulnerabilitySummary'] raise 'You cannot provide both :vulnerabilitySummary and :vulnerability_summary' if attributes.key?(:'vulnerabilitySummary') && attributes.key?(:'vulnerability_summary') self.vulnerability_summary = attributes[:'vulnerability_summary'] if attributes[:'vulnerability_summary'] self.vulnerability_description = attributes[:'vulnerabilityDescription'] if attributes[:'vulnerabilityDescription'] raise 'You cannot provide both :vulnerabilityDescription and :vulnerability_description' if attributes.key?(:'vulnerabilityDescription') && attributes.key?(:'vulnerability_description') self.vulnerability_description = attributes[:'vulnerability_description'] if attributes[:'vulnerability_description'] end |
Instance Attribute Details
#is_direct_vulnerability ⇒ BOOLEAN
Indicates if the vulnerability is immediately affecting any artifact in an audit.
32 33 34 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 32 def is_direct_vulnerability @is_direct_vulnerability end |
#metrics ⇒ Array<OCI::Adm::Models::VulnerabilityMetric>
List of reported metrics by the source.
52 53 54 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 52 def metrics @metrics end |
#references ⇒ Array<String>
References of the vulnerability at source.
60 61 62 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 60 def references @references end |
#related_vulnerabilities ⇒ Array<OCI::Adm::Models::RelatedVulnerabilityReference>
List of related vulnerabilities, as reported by the source, along with aliases, where aliases are the same vulnerability reported by different sources.
36 37 38 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 36 def @related_vulnerabilities end |
#severity ⇒ String
ADM qualitative severity score. Can be either NONE, LOW, MEDIUM, HIGH or CRITICAL.
48 49 50 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 48 def severity @severity end |
#source ⇒ String
[Required] Source that published the vulnerability.
28 29 30 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 28 def source @source end |
#status ⇒ String
The status of the vulnerability, may be one of Analyzed, Rejected, Modified, Awaiting Analysis, Undergoing Analysis, Published, Withdrawn, Received as reported by the source.
56 57 58 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 56 def status @status end |
#time_created ⇒ DateTime
Date when the vulnerability was published, at the source.
40 41 42 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 40 def time_created @time_created end |
#time_updated ⇒ DateTime
Date when the vulnerability was last modified, at the source.
44 45 46 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 44 def time_updated @time_updated end |
#vulnerability_description ⇒ String
Detailed description of the vulnerability.
68 69 70 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 68 def vulnerability_description @vulnerability_description end |
#vulnerability_id ⇒ String
[Required] Vulnerability identifier from source, e.g., CVE-1999-0067, GHSA-9vjp-v76f-g363.
24 25 26 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 24 def vulnerability_id @vulnerability_id end |
#vulnerability_summary ⇒ String
Summary of the vulnerability.
64 65 66 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 64 def vulnerability_summary @vulnerability_summary end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 71 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'vulnerability_id': :'vulnerabilityId', 'source': :'source', 'is_direct_vulnerability': :'isDirectVulnerability', 'related_vulnerabilities': :'relatedVulnerabilities', 'time_created': :'timeCreated', 'time_updated': :'timeUpdated', 'severity': :'severity', 'metrics': :'metrics', 'status': :'status', 'references': :'references', 'vulnerability_summary': :'vulnerabilitySummary', 'vulnerability_description': :'vulnerabilityDescription' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 91 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'vulnerability_id': :'String', 'source': :'String', 'is_direct_vulnerability': :'BOOLEAN', 'related_vulnerabilities': :'Array<OCI::Adm::Models::RelatedVulnerabilityReference>', 'time_created': :'DateTime', 'time_updated': :'DateTime', 'severity': :'String', 'metrics': :'Array<OCI::Adm::Models::VulnerabilityMetric>', 'status': :'String', 'references': :'Array<String>', 'vulnerability_summary': :'String', 'vulnerability_description': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 207 def ==(other) return true if equal?(other) self.class == other.class && vulnerability_id == other.vulnerability_id && source == other.source && is_direct_vulnerability == other.is_direct_vulnerability && == other. && time_created == other.time_created && time_updated == other.time_updated && severity == other.severity && metrics == other.metrics && status == other.status && references == other.references && vulnerability_summary == other.vulnerability_summary && vulnerability_description == other.vulnerability_description end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 248 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
228 229 230 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 228 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
237 238 239 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 237 def hash [vulnerability_id, source, is_direct_vulnerability, , time_created, time_updated, severity, metrics, status, references, vulnerability_summary, vulnerability_description].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
281 282 283 284 285 286 287 288 289 290 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 281 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_s ⇒ String
Returns the string representation of the object
275 276 277 |
# File 'lib/oci/adm/models/vulnerability_details.rb', line 275 def to_s to_hash.to_s end |