Class: DependencyTracker::Vulnerability

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Vulnerability

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 167

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DependencyTracker::Vulnerability` 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::Vulnerability`. 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?(:'vuln_id')
    self.vuln_id = attributes[:'vuln_id']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#affected_project_countObject

Returns the value of attribute affected_project_count.



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

def affected_project_count
  @affected_project_count
end

#componentsObject

Returns the value of attribute components.



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

def components
  @components
end

#createdObject

Returns the value of attribute created.



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

def created
  @created
end

#creditsObject

Returns the value of attribute credits.



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

def credits
  @credits
end

#cvss_v2_base_scoreObject

Returns the value of attribute cvss_v2_base_score.



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

def cvss_v2_base_score
  @cvss_v2_base_score
end

#cvss_v2_exploitability_sub_scoreObject

Returns the value of attribute cvss_v2_exploitability_sub_score.



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

def cvss_v2_exploitability_sub_score
  @cvss_v2_exploitability_sub_score
end

#cvss_v2_impact_sub_scoreObject

Returns the value of attribute cvss_v2_impact_sub_score.



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

def cvss_v2_impact_sub_score
  @cvss_v2_impact_sub_score
end

#cvss_v2_vectorObject

Returns the value of attribute cvss_v2_vector.



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

def cvss_v2_vector
  @cvss_v2_vector
end

#cvss_v3_base_scoreObject

Returns the value of attribute cvss_v3_base_score.



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

def cvss_v3_base_score
  @cvss_v3_base_score
end

#cvss_v3_exploitability_sub_scoreObject

Returns the value of attribute cvss_v3_exploitability_sub_score.



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

def cvss_v3_exploitability_sub_score
  @cvss_v3_exploitability_sub_score
end

#cvss_v3_impact_sub_scoreObject

Returns the value of attribute cvss_v3_impact_sub_score.



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

def cvss_v3_impact_sub_score
  @cvss_v3_impact_sub_score
end

#cvss_v3_vectorObject

Returns the value of attribute cvss_v3_vector.



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

def cvss_v3_vector
  @cvss_v3_vector
end

#cweObject

Returns the value of attribute cwe.



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

def cwe
  @cwe
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#patched_versionsObject

Returns the value of attribute patched_versions.



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

def patched_versions
  @patched_versions
end

#publishedObject

Returns the value of attribute published.



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

def published
  @published
end

#recommendationObject

Returns the value of attribute recommendation.



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

def recommendation
  @recommendation
end

#referencesObject

Returns the value of attribute references.



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

def references
  @references
end

#severityObject

Returns the value of attribute severity.



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

def severity
  @severity
end

#sourceObject

Returns the value of attribute source.



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

def source
  @source
end

#sub_titleObject

Returns the value of attribute sub_title.



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

def sub_title
  @sub_title
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#updatedObject

Returns the value of attribute updated.



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

def updated
  @updated
end

#uuidObject

Returns the value of attribute uuid.



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

def uuid
  @uuid
end

#vuln_idObject

Returns the value of attribute vuln_id.



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

def vuln_id
  @vuln_id
end

#vulnerable_softwareObject

Returns the value of attribute vulnerable_software.



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

def vulnerable_software
  @vulnerable_software
end

#vulnerable_versionsObject

Returns the value of attribute vulnerable_versions.



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

def vulnerable_versions
  @vulnerable_versions
end

Class Method Details

.attribute_mapObject

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



94
95
96
97
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
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 94

def self.attribute_map
  {
    :'vuln_id' => :'vulnId',
    :'source' => :'source',
    :'title' => :'title',
    :'sub_title' => :'subTitle',
    :'description' => :'description',
    :'recommendation' => :'recommendation',
    :'references' => :'references',
    :'credits' => :'credits',
    :'created' => :'created',
    :'published' => :'published',
    :'updated' => :'updated',
    :'cwe' => :'cwe',
    :'cvss_v2_base_score' => :'cvssV2BaseScore',
    :'cvss_v2_impact_sub_score' => :'cvssV2ImpactSubScore',
    :'cvss_v2_exploitability_sub_score' => :'cvssV2ExploitabilitySubScore',
    :'cvss_v2_vector' => :'cvssV2Vector',
    :'cvss_v3_base_score' => :'cvssV3BaseScore',
    :'cvss_v3_impact_sub_score' => :'cvssV3ImpactSubScore',
    :'cvss_v3_exploitability_sub_score' => :'cvssV3ExploitabilitySubScore',
    :'cvss_v3_vector' => :'cvssV3Vector',
    :'severity' => :'severity',
    :'vulnerable_versions' => :'vulnerableVersions',
    :'patched_versions' => :'patchedVersions',
    :'vulnerable_software' => :'vulnerableSoftware',
    :'components' => :'components',
    :'uuid' => :'uuid',
    :'affected_project_count' => :'affectedProjectCount'
  }
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



618
619
620
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 618

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

.openapi_nullableObject

List of attributes with nullable: true



160
161
162
163
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 160

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

.openapi_typesObject

Attribute type mapping.



127
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
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 127

def self.openapi_types
  {
    :'vuln_id' => :'String',
    :'source' => :'String',
    :'title' => :'String',
    :'sub_title' => :'String',
    :'description' => :'String',
    :'recommendation' => :'String',
    :'references' => :'String',
    :'credits' => :'String',
    :'created' => :'Integer',
    :'published' => :'Integer',
    :'updated' => :'Integer',
    :'cwe' => :'Cwe',
    :'cvss_v2_base_score' => :'Float',
    :'cvss_v2_impact_sub_score' => :'Float',
    :'cvss_v2_exploitability_sub_score' => :'Float',
    :'cvss_v2_vector' => :'String',
    :'cvss_v3_base_score' => :'Float',
    :'cvss_v3_impact_sub_score' => :'Float',
    :'cvss_v3_exploitability_sub_score' => :'Float',
    :'cvss_v3_vector' => :'String',
    :'severity' => :'String',
    :'vulnerable_versions' => :'String',
    :'patched_versions' => :'String',
    :'vulnerable_software' => :'Array<VulnerableSoftware>',
    :'components' => :'Array<Component>',
    :'uuid' => :'String',
    :'affected_project_count' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 571

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      vuln_id == o.vuln_id &&
      source == o.source &&
      title == o.title &&
      sub_title == o.sub_title &&
      description == o.description &&
      recommendation == o.recommendation &&
      references == o.references &&
      credits == o.credits &&
      created == o.created &&
      published == o.published &&
      updated == o.updated &&
      cwe == o.cwe &&
      cvss_v2_base_score == o.cvss_v2_base_score &&
      cvss_v2_impact_sub_score == o.cvss_v2_impact_sub_score &&
      cvss_v2_exploitability_sub_score == o.cvss_v2_exploitability_sub_score &&
      cvss_v2_vector == o.cvss_v2_vector &&
      cvss_v3_base_score == o.cvss_v3_base_score &&
      cvss_v3_impact_sub_score == o.cvss_v3_impact_sub_score &&
      cvss_v3_exploitability_sub_score == o.cvss_v3_exploitability_sub_score &&
      cvss_v3_vector == o.cvss_v3_vector &&
      severity == o.severity &&
      vulnerable_versions == o.vulnerable_versions &&
      patched_versions == o.patched_versions &&
      vulnerable_software == o.vulnerable_software &&
      components == o.components &&
      uuid == o.uuid &&
      affected_project_count == o.affected_project_count
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



646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 646

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



715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 715

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



625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 625

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


605
606
607
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 605

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



611
612
613
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 611

def hash
  [vuln_id, source, title, sub_title, description, recommendation, references, credits, created, published, updated, cwe, cvss_v2_base_score, cvss_v2_impact_sub_score, cvss_v2_exploitability_sub_score, cvss_v2_vector, cvss_v3_base_score, cvss_v3_impact_sub_score, cvss_v3_exploitability_sub_score, cvss_v3_vector, severity, vulnerable_versions, patched_versions, vulnerable_software, components, uuid, affected_project_count].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
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
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 295

def list_invalid_properties
  invalid_properties = Array.new
  if !@vuln_id.nil? && @vuln_id.to_s.length > 255
    invalid_properties.push('invalid value for "vuln_id", the character length must be smaller than or equal to 255.')
  end

  if !@vuln_id.nil? && @vuln_id.to_s.length < 1
    invalid_properties.push('invalid value for "vuln_id", the character length must be great than or equal to 1.')
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
  if !@vuln_id.nil? && @vuln_id !~ pattern
    invalid_properties.push("invalid value for \"vuln_id\", must conform to the pattern #{pattern}.")
  end

  if !@source.nil? && @source.to_s.length > 255
    invalid_properties.push('invalid value for "source", the character length must be smaller than or equal to 255.')
  end

  if !@source.nil? && @source.to_s.length < 1
    invalid_properties.push('invalid value for "source", the character length must be great than or equal to 1.')
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@source.nil? && @source !~ pattern
    invalid_properties.push("invalid value for \"source\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@title.nil? && @title !~ pattern
    invalid_properties.push("invalid value for \"title\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@sub_title.nil? && @sub_title !~ pattern
    invalid_properties.push("invalid value for \"sub_title\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@description.nil? && @description !~ pattern
    invalid_properties.push("invalid value for \"description\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@recommendation.nil? && @recommendation !~ pattern
    invalid_properties.push("invalid value for \"recommendation\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@references.nil? && @references !~ pattern
    invalid_properties.push("invalid value for \"references\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@credits.nil? && @credits !~ pattern
    invalid_properties.push("invalid value for \"credits\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@cvss_v2_vector.nil? && @cvss_v2_vector !~ pattern
    invalid_properties.push("invalid value for \"cvss_v2_vector\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@cvss_v3_vector.nil? && @cvss_v3_vector !~ pattern
    invalid_properties.push("invalid value for \"cvss_v3_vector\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
  if !@severity.nil? && @severity !~ pattern
    invalid_properties.push("invalid value for \"severity\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@vulnerable_versions.nil? && @vulnerable_versions !~ pattern
    invalid_properties.push("invalid value for \"vulnerable_versions\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  if !@patched_versions.nil? && @patched_versions !~ pattern
    invalid_properties.push("invalid value for \"patched_versions\", must conform to the pattern #{pattern}.")
  end

  if @uuid.nil?
    invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
  end

  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



691
692
693
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 691

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



697
698
699
700
701
702
703
704
705
706
707
708
709
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 697

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



685
686
687
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 685

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



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/dependency-tracker-client/models/vulnerability.rb', line 387

def valid?
  return false if !@vuln_id.nil? && @vuln_id.to_s.length > 255
  return false if !@vuln_id.nil? && @vuln_id.to_s.length < 1
  return false if !@vuln_id.nil? && @vuln_id !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
  return false if !@source.nil? && @source.to_s.length > 255
  return false if !@source.nil? && @source.to_s.length < 1
  return false if !@source.nil? && @source !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@title.nil? && @title !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@sub_title.nil? && @sub_title !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@description.nil? && @description !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@recommendation.nil? && @recommendation !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@references.nil? && @references !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@credits.nil? && @credits !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@cvss_v2_vector.nil? && @cvss_v2_vector !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@cvss_v3_vector.nil? && @cvss_v3_vector !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  severity_validator = EnumAttributeValidator.new('String', ["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO", "UNASSIGNED"])
  return false unless severity_validator.valid?(@severity)
  return false if !@severity.nil? && @severity !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
  return false if !@vulnerable_versions.nil? && @vulnerable_versions !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if !@patched_versions.nil? && @patched_versions !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
  return false if @uuid.nil?
  true
end