Class: DependencyTracker::VulnerableSoftware

Inherits:
Object
  • Object
show all
Defined in:
lib/dependency-tracker-client/models/vulnerable_software.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VulnerableSoftware

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 145

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DependencyTracker::VulnerableSoftware` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DependencyTracker::VulnerableSoftware`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'purl')
    self.purl = attributes[:'purl']
  end

  if attributes.key?(:'purl_type')
    self.purl_type = attributes[:'purl_type']
  end

  if attributes.key?(:'purl_namespace')
    self.purl_namespace = attributes[:'purl_namespace']
  end

  if attributes.key?(:'purl_name')
    self.purl_name = attributes[:'purl_name']
  end

  if attributes.key?(:'purl_version')
    self.purl_version = attributes[:'purl_version']
  end

  if attributes.key?(:'purl_qualifiers')
    self.purl_qualifiers = attributes[:'purl_qualifiers']
  end

  if attributes.key?(:'purl_subpath')
    self.purl_subpath = attributes[:'purl_subpath']
  end

  if attributes.key?(:'cpe22')
    self.cpe22 = attributes[:'cpe22']
  end

  if attributes.key?(:'cpe23')
    self.cpe23 = attributes[:'cpe23']
  end

  if attributes.key?(:'part')
    self.part = attributes[:'part']
  end

  if attributes.key?(:'vendor')
    self.vendor = attributes[:'vendor']
  end

  if attributes.key?(:'product')
    self.product = attributes[:'product']
  end

  if attributes.key?(:'version')
    self.version = attributes[:'version']
  end

  if attributes.key?(:'update')
    self.update = attributes[:'update']
  end

  if attributes.key?(:'edition')
    self.edition = attributes[:'edition']
  end

  if attributes.key?(:'language')
    self.language = attributes[:'language']
  end

  if attributes.key?(:'sw_edition')
    self.sw_edition = attributes[:'sw_edition']
  end

  if attributes.key?(:'target_sw')
    self.target_sw = attributes[:'target_sw']
  end

  if attributes.key?(:'target_hw')
    self.target_hw = attributes[:'target_hw']
  end

  if attributes.key?(:'other')
    self.other = attributes[:'other']
  end

  if attributes.key?(:'version_end_excluding')
    self.version_end_excluding = attributes[:'version_end_excluding']
  end

  if attributes.key?(:'version_end_including')
    self.version_end_including = attributes[:'version_end_including']
  end

  if attributes.key?(:'version_start_excluding')
    self.version_start_excluding = attributes[:'version_start_excluding']
  end

  if attributes.key?(:'version_start_including')
    self.version_start_including = attributes[:'version_start_including']
  end

  if attributes.key?(:'vulnerabilities')
    if (value = attributes[:'vulnerabilities']).is_a?(Array)
      self.vulnerabilities = value
    end
  end

  if attributes.key?(:'uuid')
    self.uuid = attributes[:'uuid']
  end

  if attributes.key?(:'is_vulnerable')
    self.is_vulnerable = attributes[:'is_vulnerable']
  end
end

Instance Attribute Details

#cpe22Object

Returns the value of attribute cpe22.



31
32
33
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 31

def cpe22
  @cpe22
end

#cpe23Object

Returns the value of attribute cpe23.



33
34
35
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 33

def cpe23
  @cpe23
end

#editionObject

Returns the value of attribute edition.



45
46
47
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 45

def edition
  @edition
end

#is_vulnerableObject

Returns the value of attribute is_vulnerable.



69
70
71
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 69

def is_vulnerable
  @is_vulnerable
end

#languageObject

Returns the value of attribute language.



47
48
49
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 47

def language
  @language
end

#otherObject

Returns the value of attribute other.



55
56
57
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 55

def other
  @other
end

#partObject

Returns the value of attribute part.



35
36
37
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 35

def part
  @part
end

#productObject

Returns the value of attribute product.



39
40
41
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 39

def product
  @product
end

#purlObject

Returns the value of attribute purl.



17
18
19
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 17

def purl
  @purl
end

#purl_nameObject

Returns the value of attribute purl_name.



23
24
25
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 23

def purl_name
  @purl_name
end

#purl_namespaceObject

Returns the value of attribute purl_namespace.



21
22
23
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 21

def purl_namespace
  @purl_namespace
end

#purl_qualifiersObject

Returns the value of attribute purl_qualifiers.



27
28
29
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 27

def purl_qualifiers
  @purl_qualifiers
end

#purl_subpathObject

Returns the value of attribute purl_subpath.



29
30
31
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 29

def purl_subpath
  @purl_subpath
end

#purl_typeObject

Returns the value of attribute purl_type.



19
20
21
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 19

def purl_type
  @purl_type
end

#purl_versionObject

Returns the value of attribute purl_version.



25
26
27
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 25

def purl_version
  @purl_version
end

#sw_editionObject

Returns the value of attribute sw_edition.



49
50
51
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 49

def sw_edition
  @sw_edition
end

#target_hwObject

Returns the value of attribute target_hw.



53
54
55
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 53

def target_hw
  @target_hw
end

#target_swObject

Returns the value of attribute target_sw.



51
52
53
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 51

def target_sw
  @target_sw
end

#updateObject

Returns the value of attribute update.



43
44
45
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 43

def update
  @update
end

#uuidObject

Returns the value of attribute uuid.



67
68
69
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 67

def uuid
  @uuid
end

#vendorObject

Returns the value of attribute vendor.



37
38
39
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 37

def vendor
  @vendor
end

#versionObject

Returns the value of attribute version.



41
42
43
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 41

def version
  @version
end

#version_end_excludingObject

Returns the value of attribute version_end_excluding.



57
58
59
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 57

def version_end_excluding
  @version_end_excluding
end

#version_end_includingObject

Returns the value of attribute version_end_including.



59
60
61
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 59

def version_end_including
  @version_end_including
end

#version_start_excludingObject

Returns the value of attribute version_start_excluding.



61
62
63
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 61

def version_start_excluding
  @version_start_excluding
end

#version_start_includingObject

Returns the value of attribute version_start_including.



63
64
65
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 63

def version_start_including
  @version_start_including
end

#vulnerabilitiesObject

Returns the value of attribute vulnerabilities.



65
66
67
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 65

def vulnerabilities
  @vulnerabilities
end

Class Method Details

.attribute_mapObject

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



72
73
74
75
76
77
78
79
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/dependency-tracker-client/models/vulnerable_software.rb', line 72

def self.attribute_map
  {
    :'purl' => :'purl',
    :'purl_type' => :'purlType',
    :'purl_namespace' => :'purlNamespace',
    :'purl_name' => :'purlName',
    :'purl_version' => :'purlVersion',
    :'purl_qualifiers' => :'purlQualifiers',
    :'purl_subpath' => :'purlSubpath',
    :'cpe22' => :'cpe22',
    :'cpe23' => :'cpe23',
    :'part' => :'part',
    :'vendor' => :'vendor',
    :'product' => :'product',
    :'version' => :'version',
    :'update' => :'update',
    :'edition' => :'edition',
    :'language' => :'language',
    :'sw_edition' => :'swEdition',
    :'target_sw' => :'targetSw',
    :'target_hw' => :'targetHw',
    :'other' => :'other',
    :'version_end_excluding' => :'versionEndExcluding',
    :'version_end_including' => :'versionEndIncluding',
    :'version_start_excluding' => :'versionStartExcluding',
    :'version_start_including' => :'versionStartIncluding',
    :'vulnerabilities' => :'vulnerabilities',
    :'uuid' => :'uuid',
    :'is_vulnerable' => :'isVulnerable'
  }
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



331
332
333
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 331

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



138
139
140
141
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 138

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_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
128
129
130
131
132
133
134
135
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 105

def self.openapi_types
  {
    :'purl' => :'String',
    :'purl_type' => :'String',
    :'purl_namespace' => :'String',
    :'purl_name' => :'String',
    :'purl_version' => :'String',
    :'purl_qualifiers' => :'String',
    :'purl_subpath' => :'String',
    :'cpe22' => :'String',
    :'cpe23' => :'String',
    :'part' => :'String',
    :'vendor' => :'String',
    :'product' => :'String',
    :'version' => :'String',
    :'update' => :'String',
    :'edition' => :'String',
    :'language' => :'String',
    :'sw_edition' => :'String',
    :'target_sw' => :'String',
    :'target_hw' => :'String',
    :'other' => :'String',
    :'version_end_excluding' => :'String',
    :'version_end_including' => :'String',
    :'version_start_excluding' => :'String',
    :'version_start_including' => :'String',
    :'vulnerabilities' => :'Array<Vulnerability>',
    :'uuid' => :'String',
    :'is_vulnerable' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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/dependency-tracker-client/models/vulnerable_software.rb', line 284

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      purl == o.purl &&
      purl_type == o.purl_type &&
      purl_namespace == o.purl_namespace &&
      purl_name == o.purl_name &&
      purl_version == o.purl_version &&
      purl_qualifiers == o.purl_qualifiers &&
      purl_subpath == o.purl_subpath &&
      cpe22 == o.cpe22 &&
      cpe23 == o.cpe23 &&
      part == o.part &&
      vendor == o.vendor &&
      product == o.product &&
      version == o.version &&
      update == o.update &&
      edition == o.edition &&
      language == o.language &&
      sw_edition == o.sw_edition &&
      target_sw == o.target_sw &&
      target_hw == o.target_hw &&
      other == o.other &&
      version_end_excluding == o.version_end_excluding &&
      version_end_including == o.version_end_including &&
      version_start_excluding == o.version_start_excluding &&
      version_start_including == o.version_start_including &&
      vulnerabilities == o.vulnerabilities &&
      uuid == o.uuid &&
      is_vulnerable == o.is_vulnerable
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 359

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    DependencyTracker.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 428

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
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



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 338

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(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?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


318
319
320
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 318

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



324
325
326
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 324

def hash
  [purl, purl_type, purl_namespace, purl_name, purl_version, purl_qualifiers, purl_subpath, cpe22, cpe23, part, vendor, product, version, update, edition, language, sw_edition, target_sw, target_hw, other, version_end_excluding, version_end_including, version_start_excluding, version_start_including, vulnerabilities, uuid, is_vulnerable].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



271
272
273
274
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 271

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



404
405
406
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 404

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 410

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end
    
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



398
399
400
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 398

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



278
279
280
# File 'lib/dependency-tracker-client/models/vulnerable_software.rb', line 278

def valid?
  true
end