Class: OCI::Jms::Models::LibraryUsage

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/jms/models/library_usage.rb

Overview

Library usage during a specified time period.

Constant Summary collapse

CONFIDENCE_LEVEL_ENUM =
[
  CONFIDENCE_LEVEL_HIGH = 'HIGH'.freeze,
  CONFIDENCE_LEVEL_MEDIUM = 'MEDIUM'.freeze,
  CONFIDENCE_LEVEL_LOW = 'LOW'.freeze,
  CONFIDENCE_LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LibraryUsage

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/oci/jms/models/library_usage.rb', line 199

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

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

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

  self.fleet_id = attributes[:'fleetId'] if attributes[:'fleetId']

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

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

  self.library_name = attributes[:'libraryName'] if attributes[:'libraryName']

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

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

  self.library_version = attributes[:'libraryVersion'] if attributes[:'libraryVersion']

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

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

  self.cve_id = attributes[:'cveId'] if attributes[:'cveId']

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

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

  self.cvss_score = attributes[:'cvssScore'] if attributes[:'cvssScore']

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

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

  self.is_dynamically_detected = attributes[:'isDynamicallyDetected'] unless attributes[:'isDynamicallyDetected'].nil?

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

  self.is_dynamically_detected = attributes[:'is_dynamically_detected'] unless attributes[:'is_dynamically_detected'].nil?

  self.highest_vulnerability_score = attributes[:'highestVulnerabilityScore'] if attributes[:'highestVulnerabilityScore']

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

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

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

  self.confidence_level = attributes[:'confidenceLevel'] if attributes[:'confidenceLevel']

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

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

  self.approximate_application_count = attributes[:'approximateApplicationCount'] if attributes[:'approximateApplicationCount']

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

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

  self.approximate_java_server_instance_count = attributes[:'approximateJavaServerInstanceCount'] if attributes[:'approximateJavaServerInstanceCount']

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

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

  self.approximate_deployed_application_count = attributes[:'approximateDeployedApplicationCount'] if attributes[:'approximateDeployedApplicationCount']

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

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

  self.approximate_managed_instance_count = attributes[:'approximateManagedInstanceCount'] if attributes[:'approximateManagedInstanceCount']

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

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

  self.time_start = attributes[:'timeStart'] if attributes[:'timeStart']

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

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

  self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd']

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

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

  self.time_first_seen = attributes[:'timeFirstSeen'] if attributes[:'timeFirstSeen']

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

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

  self.time_last_seen = attributes[:'timeLastSeen'] if attributes[:'timeLastSeen']

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

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

  self.time_last_cve_refreshed = attributes[:'timeLastCveRefreshed'] if attributes[:'timeLastCveRefreshed']

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

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

Instance Attribute Details

#approximate_application_countInteger

The approximate count of applications using the library.

Returns:

  • (Integer)


73
74
75
# File 'lib/oci/jms/models/library_usage.rb', line 73

def approximate_application_count
  @approximate_application_count
end

#approximate_deployed_application_countInteger

The approximate count of deployed applications using the library.

Returns:

  • (Integer)


83
84
85
# File 'lib/oci/jms/models/library_usage.rb', line 83

def approximate_deployed_application_count
  @approximate_deployed_application_count
end

#approximate_java_server_instance_countInteger

The approximate count of Java Server instances using the library.

Returns:

  • (Integer)


78
79
80
# File 'lib/oci/jms/models/library_usage.rb', line 78

def approximate_java_server_instance_count
  @approximate_java_server_instance_count
end

#approximate_managed_instance_countInteger

The approximate count of managed instances using the library.

Returns:

  • (Integer)


88
89
90
# File 'lib/oci/jms/models/library_usage.rb', line 88

def approximate_managed_instance_count
  @approximate_managed_instance_count
end

#confidence_levelString

Confidence level of the assessed library's vulnerabilities.

Returns:

  • (String)


68
69
70
# File 'lib/oci/jms/models/library_usage.rb', line 68

def confidence_level
  @confidence_level
end

#cve_idString

Deprecated, use vulnerabilities instead. The Common Vulnerabilities and Exposures (CVE) ID.

Returns:

  • (String)


44
45
46
# File 'lib/oci/jms/models/library_usage.rb', line 44

def cve_id
  @cve_id
end

#cvss_scoreFloat

Deprecated, use highestVulnerabilityScore instead. The Common Vulnerability Scoring System (CVSS) score. If cvssScore is not available, it will be set to -1.0. It is set to 0.0 when cveId is null.

Returns:

  • (Float)


50
51
52
# File 'lib/oci/jms/models/library_usage.rb', line 50

def cvss_score
  @cvss_score
end

#fleet_idString

[Required] The OCID of the related fleet.

Returns:

  • (String)


28
29
30
# File 'lib/oci/jms/models/library_usage.rb', line 28

def fleet_id
  @fleet_id
end

#highest_vulnerability_scoreFloat

Highest CVSS score among the all vulnerabilities. If highest CVSS score is not available, it will be set to -1.0. It is set to 0.0 when there is no associated vulnerabilities.

Returns:

  • (Float)


60
61
62
# File 'lib/oci/jms/models/library_usage.rb', line 60

def highest_vulnerability_score
  @highest_vulnerability_score
end

#is_dynamically_detectedBOOLEAN

[Required] Indicates whether the library was dynamically detected.

Returns:

  • (BOOLEAN)


55
56
57
# File 'lib/oci/jms/models/library_usage.rb', line 55

def is_dynamically_detected
  @is_dynamically_detected
end

#library_keyString

[Required] The internal identifier of the library.

Returns:

  • (String)


23
24
25
# File 'lib/oci/jms/models/library_usage.rb', line 23

def library_key
  @library_key
end

#library_nameString

[Required] The name of the library.

Returns:

  • (String)


33
34
35
# File 'lib/oci/jms/models/library_usage.rb', line 33

def library_name
  @library_name
end

#library_versionString

The version of the library.

Returns:

  • (String)


38
39
40
# File 'lib/oci/jms/models/library_usage.rb', line 38

def library_version
  @library_version
end

#time_endDateTime

Upper bound of the specified time period filter. JMS provides a view of the data that is per day. The query uses only the date element of the parameter.

Returns:

  • (DateTime)


96
97
98
# File 'lib/oci/jms/models/library_usage.rb', line 96

def time_end
  @time_end
end

#time_first_seenDateTime

The date and time the resource was first reported to JMS. This is potentially before the specified time period provided by the filters. For example, a resource can be first reported to JMS before the start of a specified time period, if it is also reported during the time period.

Returns:

  • (DateTime)


104
105
106
# File 'lib/oci/jms/models/library_usage.rb', line 104

def time_first_seen
  @time_first_seen
end

#time_last_cve_refreshedDateTime

Deprecated. The date and time of the last CVEs refresh was completed.

Returns:

  • (DateTime)


118
119
120
# File 'lib/oci/jms/models/library_usage.rb', line 118

def time_last_cve_refreshed
  @time_last_cve_refreshed
end

#time_last_seenDateTime

The date and time the resource was last reported to JMS. This is potentially after the specified time period provided by the filters. For example, a resource can be last reported to JMS before the start of a specified time period, if it is also reported during the time period.

Returns:

  • (DateTime)


112
113
114
# File 'lib/oci/jms/models/library_usage.rb', line 112

def time_last_seen
  @time_last_seen
end

#time_startDateTime

Lower bound of the specified time period filter. JMS provides a view of the data that is per day. The query uses only the date element of the parameter.

Returns:

  • (DateTime)


92
93
94
# File 'lib/oci/jms/models/library_usage.rb', line 92

def time_start
  @time_start
end

#vulnerabilitiesArray<OCI::Jms::Models::LibraryVulnerability>

The list of library vulnerabilities.



64
65
66
# File 'lib/oci/jms/models/library_usage.rb', line 64

def vulnerabilities
  @vulnerabilities
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/jms/models/library_usage.rb', line 121

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'library_key': :'libraryKey',
    'fleet_id': :'fleetId',
    'library_name': :'libraryName',
    'library_version': :'libraryVersion',
    'cve_id': :'cveId',
    'cvss_score': :'cvssScore',
    'is_dynamically_detected': :'isDynamicallyDetected',
    'highest_vulnerability_score': :'highestVulnerabilityScore',
    'vulnerabilities': :'vulnerabilities',
    'confidence_level': :'confidenceLevel',
    'approximate_application_count': :'approximateApplicationCount',
    'approximate_java_server_instance_count': :'approximateJavaServerInstanceCount',
    'approximate_deployed_application_count': :'approximateDeployedApplicationCount',
    'approximate_managed_instance_count': :'approximateManagedInstanceCount',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'time_first_seen': :'timeFirstSeen',
    'time_last_seen': :'timeLastSeen',
    'time_last_cve_refreshed': :'timeLastCveRefreshed'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/jms/models/library_usage.rb', line 148

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'library_key': :'String',
    'fleet_id': :'String',
    'library_name': :'String',
    'library_version': :'String',
    'cve_id': :'String',
    'cvss_score': :'Float',
    'is_dynamically_detected': :'BOOLEAN',
    'highest_vulnerability_score': :'Float',
    'vulnerabilities': :'Array<OCI::Jms::Models::LibraryVulnerability>',
    'confidence_level': :'String',
    'approximate_application_count': :'Integer',
    'approximate_java_server_instance_count': :'Integer',
    'approximate_deployed_application_count': :'Integer',
    'approximate_managed_instance_count': :'Integer',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'time_first_seen': :'DateTime',
    'time_last_seen': :'DateTime',
    'time_last_cve_refreshed': :'DateTime'
    # 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



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/oci/jms/models/library_usage.rb', line 336

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

  self.class == other.class &&
    library_key == other.library_key &&
    fleet_id == other.fleet_id &&
    library_name == other.library_name &&
    library_version == other.library_version &&
    cve_id == other.cve_id &&
    cvss_score == other.cvss_score &&
    is_dynamically_detected == other.is_dynamically_detected &&
    highest_vulnerability_score == other.highest_vulnerability_score &&
    vulnerabilities == other.vulnerabilities &&
    confidence_level == other.confidence_level &&
    approximate_application_count == other.approximate_application_count &&
    approximate_java_server_instance_count == other.approximate_java_server_instance_count &&
    approximate_deployed_application_count == other.approximate_deployed_application_count &&
    approximate_managed_instance_count == other.approximate_managed_instance_count &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    time_first_seen == other.time_first_seen &&
    time_last_seen == other.time_last_seen &&
    time_last_cve_refreshed == other.time_last_cve_refreshed
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



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/oci/jms/models/library_usage.rb', line 384

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


364
365
366
# File 'lib/oci/jms/models/library_usage.rb', line 364

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



373
374
375
# File 'lib/oci/jms/models/library_usage.rb', line 373

def hash
  [library_key, fleet_id, library_name, library_version, cve_id, cvss_score, is_dynamically_detected, highest_vulnerability_score, vulnerabilities, confidence_level, approximate_application_count, approximate_java_server_instance_count, approximate_deployed_application_count, approximate_managed_instance_count, time_start, time_end, time_first_seen, time_last_seen, time_last_cve_refreshed].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



417
418
419
420
421
422
423
424
425
426
# File 'lib/oci/jms/models/library_usage.rb', line 417

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



411
412
413
# File 'lib/oci/jms/models/library_usage.rb', line 411

def to_s
  to_hash.to_s
end