dependency-tracker-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +201 -0
  4. data/README.md +276 -0
  5. data/Rakefile +10 -0
  6. data/dependency-tracker-client.gemspec +39 -0
  7. data/docs/About.md +25 -0
  8. data/docs/Analysis.md +21 -0
  9. data/docs/AnalysisApi.md +177 -0
  10. data/docs/AnalysisComment.md +21 -0
  11. data/docs/AnalysisRequest.md +27 -0
  12. data/docs/ApiKey.md +17 -0
  13. data/docs/BadgeApi.md +102 -0
  14. data/docs/BodyPart.md +31 -0
  15. data/docs/BomApi.md +335 -0
  16. data/docs/BomSubmitRequest.md +25 -0
  17. data/docs/CalculatorApi.md +61 -0
  18. data/docs/CloneProjectRequest.md +19 -0
  19. data/docs/Component.md +69 -0
  20. data/docs/ComponentApi.md +373 -0
  21. data/docs/ComponentMetrics.md +43 -0
  22. data/docs/ConfigProperty.md +25 -0
  23. data/docs/ConfigPropertyApi.md +167 -0
  24. data/docs/ContentDisposition.md +29 -0
  25. data/docs/Cwe.md +19 -0
  26. data/docs/CweApi.md +110 -0
  27. data/docs/DefaultApi.md +434 -0
  28. data/docs/Dependency.md +27 -0
  29. data/docs/DependencyApi.md +222 -0
  30. data/docs/DependencyMetrics.md +45 -0
  31. data/docs/DependencyRequest.md +21 -0
  32. data/docs/Finding.md +23 -0
  33. data/docs/FindingApi.md +113 -0
  34. data/docs/FormDataBodyPart.md +39 -0
  35. data/docs/FormDataContentDisposition.md +31 -0
  36. data/docs/FormDataMultiPart.md +35 -0
  37. data/docs/Framework.md +23 -0
  38. data/docs/IdentifiableObject.md +17 -0
  39. data/docs/LdapApi.md +220 -0
  40. data/docs/LdapUser.md +25 -0
  41. data/docs/License.md +37 -0
  42. data/docs/LicenseApi.md +159 -0
  43. data/docs/ManagedUser.md +37 -0
  44. data/docs/MappedLdapGroup.md +19 -0
  45. data/docs/MappedLdapGroupRequest.md +19 -0
  46. data/docs/MediaType.md +25 -0
  47. data/docs/MetricsApi.md +922 -0
  48. data/docs/MultiPart.md +33 -0
  49. data/docs/NotificationPublisher.md +29 -0
  50. data/docs/NotificationRule.md +35 -0
  51. data/docs/PackageURL.md +29 -0
  52. data/docs/ParameterizedHeader.md +19 -0
  53. data/docs/Permission.md +19 -0
  54. data/docs/PermissionApi.md +279 -0
  55. data/docs/PortfolioMetrics.md +53 -0
  56. data/docs/Project.md +43 -0
  57. data/docs/ProjectApi.md +445 -0
  58. data/docs/ProjectMetrics.md +47 -0
  59. data/docs/ProjectProperty.md +27 -0
  60. data/docs/ProjectPropertyApi.md +232 -0
  61. data/docs/Repository.md +29 -0
  62. data/docs/RepositoryApi.md +325 -0
  63. data/docs/RepositoryMetaComponent.md +27 -0
  64. data/docs/Score.md +23 -0
  65. data/docs/SearchApi.md +120 -0
  66. data/docs/SearchResult.md +17 -0
  67. data/docs/Tag.md +19 -0
  68. data/docs/Team.md +29 -0
  69. data/docs/TeamApi.md +432 -0
  70. data/docs/UserApi.md +715 -0
  71. data/docs/UserPrincipal.md +27 -0
  72. data/docs/VersionApi.md +52 -0
  73. data/docs/Vulnerability.md +69 -0
  74. data/docs/VulnerabilityApi.md +666 -0
  75. data/docs/VulnerabilityMetrics.md +23 -0
  76. data/docs/VulnerableSoftware.md +69 -0
  77. data/lib/dependency-tracker-client/api/analysis_api.rb +209 -0
  78. data/lib/dependency-tracker-client/api/badge_api.rb +148 -0
  79. data/lib/dependency-tracker-client/api/bom_api.rb +382 -0
  80. data/lib/dependency-tracker-client/api/calculator_api.rb +83 -0
  81. data/lib/dependency-tracker-client/api/component_api.rb +422 -0
  82. data/lib/dependency-tracker-client/api/config_property_api.rb +192 -0
  83. data/lib/dependency-tracker-client/api/cwe_api.rb +136 -0
  84. data/lib/dependency-tracker-client/api/default_api.rb +491 -0
  85. data/lib/dependency-tracker-client/api/dependency_api.rb +254 -0
  86. data/lib/dependency-tracker-client/api/finding_api.rb +140 -0
  87. data/lib/dependency-tracker-client/api/ldap_api.rb +254 -0
  88. data/lib/dependency-tracker-client/api/license_api.rb +190 -0
  89. data/lib/dependency-tracker-client/api/metrics_api.rb +1086 -0
  90. data/lib/dependency-tracker-client/api/permission_api.rb +342 -0
  91. data/lib/dependency-tracker-client/api/project_api.rb +504 -0
  92. data/lib/dependency-tracker-client/api/project_property_api.rb +274 -0
  93. data/lib/dependency-tracker-client/api/repository_api.rb +376 -0
  94. data/lib/dependency-tracker-client/api/search_api.rb +143 -0
  95. data/lib/dependency-tracker-client/api/team_api.rb +486 -0
  96. data/lib/dependency-tracker-client/api/user_api.rb +796 -0
  97. data/lib/dependency-tracker-client/api/version_api.rb +78 -0
  98. data/lib/dependency-tracker-client/api/vulnerability_api.rb +780 -0
  99. data/lib/dependency-tracker-client/api_client.rb +388 -0
  100. data/lib/dependency-tracker-client/api_error.rb +57 -0
  101. data/lib/dependency-tracker-client/configuration.rb +261 -0
  102. data/lib/dependency-tracker-client/models/about.rb +242 -0
  103. data/lib/dependency-tracker-client/models/analysis.rb +265 -0
  104. data/lib/dependency-tracker-client/models/analysis_comment.rb +234 -0
  105. data/lib/dependency-tracker-client/models/analysis_request.rb +371 -0
  106. data/lib/dependency-tracker-client/models/api_key.rb +250 -0
  107. data/lib/dependency-tracker-client/models/body_part.rb +273 -0
  108. data/lib/dependency-tracker-client/models/bom_submit_request.rb +328 -0
  109. data/lib/dependency-tracker-client/models/clone_project_request.rb +267 -0
  110. data/lib/dependency-tracker-client/models/component.rb +900 -0
  111. data/lib/dependency-tracker-client/models/component_metrics.rb +338 -0
  112. data/lib/dependency-tracker-client/models/config_property.rb +421 -0
  113. data/lib/dependency-tracker-client/models/content_disposition.rb +262 -0
  114. data/lib/dependency-tracker-client/models/cwe.rb +259 -0
  115. data/lib/dependency-tracker-client/models/dependency.rb +266 -0
  116. data/lib/dependency-tracker-client/models/dependency_metrics.rb +352 -0
  117. data/lib/dependency-tracker-client/models/dependency_request.rb +257 -0
  118. data/lib/dependency-tracker-client/models/finding.rb +239 -0
  119. data/lib/dependency-tracker-client/models/form_data_body_part.rb +309 -0
  120. data/lib/dependency-tracker-client/models/form_data_content_disposition.rb +271 -0
  121. data/lib/dependency-tracker-client/models/form_data_multi_part.rb +295 -0
  122. data/lib/dependency-tracker-client/models/framework.rb +233 -0
  123. data/lib/dependency-tracker-client/models/identifiable_object.rb +206 -0
  124. data/lib/dependency-tracker-client/models/ldap_user.rb +351 -0
  125. data/lib/dependency-tracker-client/models/license.rb +373 -0
  126. data/lib/dependency-tracker-client/models/managed_user.rb +480 -0
  127. data/lib/dependency-tracker-client/models/mapped_ldap_group.rb +255 -0
  128. data/lib/dependency-tracker-client/models/mapped_ldap_group_request.rb +267 -0
  129. data/lib/dependency-tracker-client/models/media_type.rb +244 -0
  130. data/lib/dependency-tracker-client/models/multi_part.rb +284 -0
  131. data/lib/dependency-tracker-client/models/notification_publisher.rb +388 -0
  132. data/lib/dependency-tracker-client/models/notification_rule.rb +426 -0
  133. data/lib/dependency-tracker-client/models/package_url.rb +262 -0
  134. data/lib/dependency-tracker-client/models/parameterized_header.rb +217 -0
  135. data/lib/dependency-tracker-client/models/permission.rb +250 -0
  136. data/lib/dependency-tracker-client/models/portfolio_metrics.rb +378 -0
  137. data/lib/dependency-tracker-client/models/project.rb +420 -0
  138. data/lib/dependency-tracker-client/models/project_metrics.rb +356 -0
  139. data/lib/dependency-tracker-client/models/project_property.rb +430 -0
  140. data/lib/dependency-tracker-client/models/repository.rb +319 -0
  141. data/lib/dependency-tracker-client/models/repository_meta_component.rb +305 -0
  142. data/lib/dependency-tracker-client/models/score.rb +233 -0
  143. data/lib/dependency-tracker-client/models/search_result.rb +208 -0
  144. data/lib/dependency-tracker-client/models/tag.rb +252 -0
  145. data/lib/dependency-tracker-client/models/team.rb +310 -0
  146. data/lib/dependency-tracker-client/models/user_principal.rb +255 -0
  147. data/lib/dependency-tracker-client/models/vulnerability.rb +729 -0
  148. data/lib/dependency-tracker-client/models/vulnerability_metrics.rb +238 -0
  149. data/lib/dependency-tracker-client/models/vulnerable_software.rb +442 -0
  150. data/lib/dependency-tracker-client/version.rb +15 -0
  151. data/lib/dependency-tracker-client.rb +109 -0
  152. data/pkg/dependency-tracker-client-1.0.0.gem +0 -0
  153. data/spec/api/analysis_api_spec.rb +70 -0
  154. data/spec/api/badge_api_spec.rb +58 -0
  155. data/spec/api/bom_api_spec.rb +106 -0
  156. data/spec/api/calculator_api_spec.rb +46 -0
  157. data/spec/api/component_api_spec.rb +110 -0
  158. data/spec/api/config_property_api_spec.rb +67 -0
  159. data/spec/api/cwe_api_spec.rb +56 -0
  160. data/spec/api/default_api_spec.rb +123 -0
  161. data/spec/api/dependency_api_spec.rb +79 -0
  162. data/spec/api/finding_api_spec.rb +57 -0
  163. data/spec/api/ldap_api_spec.rb +79 -0
  164. data/spec/api/license_api_spec.rb +66 -0
  165. data/spec/api/metrics_api_spec.rb +233 -0
  166. data/spec/api/permission_api_spec.rb +94 -0
  167. data/spec/api/project_api_spec.rb +126 -0
  168. data/spec/api/project_property_api_spec.rb +82 -0
  169. data/spec/api/repository_api_spec.rb +100 -0
  170. data/spec/api/search_api_spec.rb +59 -0
  171. data/spec/api/team_api_spec.rb +122 -0
  172. data/spec/api/user_api_spec.rb +183 -0
  173. data/spec/api/version_api_spec.rb +46 -0
  174. data/spec/api/vulnerability_api_spec.rb +177 -0
  175. data/spec/api_client_spec.rb +226 -0
  176. data/spec/configuration_spec.rb +42 -0
  177. data/spec/models/about_spec.rb +65 -0
  178. data/spec/models/analysis_comment_spec.rb +53 -0
  179. data/spec/models/analysis_request_spec.rb +75 -0
  180. data/spec/models/analysis_spec.rb +57 -0
  181. data/spec/models/api_key_spec.rb +41 -0
  182. data/spec/models/body_part_spec.rb +83 -0
  183. data/spec/models/bom_submit_request_spec.rb +65 -0
  184. data/spec/models/clone_project_request_spec.rb +47 -0
  185. data/spec/models/component_metrics_spec.rb +119 -0
  186. data/spec/models/component_spec.rb +201 -0
  187. data/spec/models/config_property_spec.rb +69 -0
  188. data/spec/models/content_disposition_spec.rb +77 -0
  189. data/spec/models/cwe_spec.rb +47 -0
  190. data/spec/models/dependency_metrics_spec.rb +125 -0
  191. data/spec/models/dependency_request_spec.rb +53 -0
  192. data/spec/models/dependency_spec.rb +71 -0
  193. data/spec/models/finding_spec.rb +59 -0
  194. data/spec/models/form_data_body_part_spec.rb +107 -0
  195. data/spec/models/form_data_content_disposition_spec.rb +83 -0
  196. data/spec/models/form_data_multi_part_spec.rb +95 -0
  197. data/spec/models/framework_spec.rb +59 -0
  198. data/spec/models/identifiable_object_spec.rb +41 -0
  199. data/spec/models/ldap_user_spec.rb +65 -0
  200. data/spec/models/license_spec.rb +101 -0
  201. data/spec/models/managed_user_spec.rb +101 -0
  202. data/spec/models/mapped_ldap_group_request_spec.rb +47 -0
  203. data/spec/models/mapped_ldap_group_spec.rb +47 -0
  204. data/spec/models/media_type_spec.rb +65 -0
  205. data/spec/models/multi_part_spec.rb +89 -0
  206. data/spec/models/notification_publisher_spec.rb +77 -0
  207. data/spec/models/notification_rule_spec.rb +107 -0
  208. data/spec/models/package_url_spec.rb +77 -0
  209. data/spec/models/parameterized_header_spec.rb +47 -0
  210. data/spec/models/permission_spec.rb +47 -0
  211. data/spec/models/portfolio_metrics_spec.rb +149 -0
  212. data/spec/models/project_metrics_spec.rb +131 -0
  213. data/spec/models/project_property_spec.rb +75 -0
  214. data/spec/models/project_spec.rb +119 -0
  215. data/spec/models/repository_meta_component_spec.rb +75 -0
  216. data/spec/models/repository_spec.rb +81 -0
  217. data/spec/models/score_spec.rb +59 -0
  218. data/spec/models/search_result_spec.rb +41 -0
  219. data/spec/models/tag_spec.rb +47 -0
  220. data/spec/models/team_spec.rb +77 -0
  221. data/spec/models/user_principal_spec.rb +71 -0
  222. data/spec/models/vulnerability_metrics_spec.rb +59 -0
  223. data/spec/models/vulnerability_spec.rb +201 -0
  224. data/spec/models/vulnerable_software_spec.rb +197 -0
  225. data/spec/spec_helper.rb +111 -0
  226. data/tmp/tmp.rb +11 -0
  227. metadata +402 -0
@@ -0,0 +1,729 @@
1
+ =begin
2
+ #Dependency-Track API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 3.8.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module DependencyTracker
16
+ class Vulnerability
17
+ attr_accessor :vuln_id
18
+
19
+ attr_accessor :source
20
+
21
+ attr_accessor :title
22
+
23
+ attr_accessor :sub_title
24
+
25
+ attr_accessor :description
26
+
27
+ attr_accessor :recommendation
28
+
29
+ attr_accessor :references
30
+
31
+ attr_accessor :credits
32
+
33
+ attr_accessor :created
34
+
35
+ attr_accessor :published
36
+
37
+ attr_accessor :updated
38
+
39
+ attr_accessor :cwe
40
+
41
+ attr_accessor :cvss_v2_base_score
42
+
43
+ attr_accessor :cvss_v2_impact_sub_score
44
+
45
+ attr_accessor :cvss_v2_exploitability_sub_score
46
+
47
+ attr_accessor :cvss_v2_vector
48
+
49
+ attr_accessor :cvss_v3_base_score
50
+
51
+ attr_accessor :cvss_v3_impact_sub_score
52
+
53
+ attr_accessor :cvss_v3_exploitability_sub_score
54
+
55
+ attr_accessor :cvss_v3_vector
56
+
57
+ attr_accessor :severity
58
+
59
+ attr_accessor :vulnerable_versions
60
+
61
+ attr_accessor :patched_versions
62
+
63
+ attr_accessor :vulnerable_software
64
+
65
+ attr_accessor :components
66
+
67
+ attr_accessor :uuid
68
+
69
+ attr_accessor :affected_project_count
70
+
71
+ class EnumAttributeValidator
72
+ attr_reader :datatype
73
+ attr_reader :allowable_values
74
+
75
+ def initialize(datatype, allowable_values)
76
+ @allowable_values = allowable_values.map do |value|
77
+ case datatype.to_s
78
+ when /Integer/i
79
+ value.to_i
80
+ when /Float/i
81
+ value.to_f
82
+ else
83
+ value
84
+ end
85
+ end
86
+ end
87
+
88
+ def valid?(value)
89
+ !value || allowable_values.include?(value)
90
+ end
91
+ end
92
+
93
+ # Attribute mapping from ruby-style variable name to JSON key.
94
+ def self.attribute_map
95
+ {
96
+ :'vuln_id' => :'vulnId',
97
+ :'source' => :'source',
98
+ :'title' => :'title',
99
+ :'sub_title' => :'subTitle',
100
+ :'description' => :'description',
101
+ :'recommendation' => :'recommendation',
102
+ :'references' => :'references',
103
+ :'credits' => :'credits',
104
+ :'created' => :'created',
105
+ :'published' => :'published',
106
+ :'updated' => :'updated',
107
+ :'cwe' => :'cwe',
108
+ :'cvss_v2_base_score' => :'cvssV2BaseScore',
109
+ :'cvss_v2_impact_sub_score' => :'cvssV2ImpactSubScore',
110
+ :'cvss_v2_exploitability_sub_score' => :'cvssV2ExploitabilitySubScore',
111
+ :'cvss_v2_vector' => :'cvssV2Vector',
112
+ :'cvss_v3_base_score' => :'cvssV3BaseScore',
113
+ :'cvss_v3_impact_sub_score' => :'cvssV3ImpactSubScore',
114
+ :'cvss_v3_exploitability_sub_score' => :'cvssV3ExploitabilitySubScore',
115
+ :'cvss_v3_vector' => :'cvssV3Vector',
116
+ :'severity' => :'severity',
117
+ :'vulnerable_versions' => :'vulnerableVersions',
118
+ :'patched_versions' => :'patchedVersions',
119
+ :'vulnerable_software' => :'vulnerableSoftware',
120
+ :'components' => :'components',
121
+ :'uuid' => :'uuid',
122
+ :'affected_project_count' => :'affectedProjectCount'
123
+ }
124
+ end
125
+
126
+ # Attribute type mapping.
127
+ def self.openapi_types
128
+ {
129
+ :'vuln_id' => :'String',
130
+ :'source' => :'String',
131
+ :'title' => :'String',
132
+ :'sub_title' => :'String',
133
+ :'description' => :'String',
134
+ :'recommendation' => :'String',
135
+ :'references' => :'String',
136
+ :'credits' => :'String',
137
+ :'created' => :'Integer',
138
+ :'published' => :'Integer',
139
+ :'updated' => :'Integer',
140
+ :'cwe' => :'Cwe',
141
+ :'cvss_v2_base_score' => :'Float',
142
+ :'cvss_v2_impact_sub_score' => :'Float',
143
+ :'cvss_v2_exploitability_sub_score' => :'Float',
144
+ :'cvss_v2_vector' => :'String',
145
+ :'cvss_v3_base_score' => :'Float',
146
+ :'cvss_v3_impact_sub_score' => :'Float',
147
+ :'cvss_v3_exploitability_sub_score' => :'Float',
148
+ :'cvss_v3_vector' => :'String',
149
+ :'severity' => :'String',
150
+ :'vulnerable_versions' => :'String',
151
+ :'patched_versions' => :'String',
152
+ :'vulnerable_software' => :'Array<VulnerableSoftware>',
153
+ :'components' => :'Array<Component>',
154
+ :'uuid' => :'String',
155
+ :'affected_project_count' => :'Integer'
156
+ }
157
+ end
158
+
159
+ # List of attributes with nullable: true
160
+ def self.openapi_nullable
161
+ Set.new([
162
+ ])
163
+ end
164
+
165
+ # Initializes the object
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ def initialize(attributes = {})
168
+ if (!attributes.is_a?(Hash))
169
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DependencyTracker::Vulnerability` initialize method"
170
+ end
171
+
172
+ # check to see if the attribute exists and convert string to symbol for hash key
173
+ attributes = attributes.each_with_object({}) { |(k, v), h|
174
+ if (!self.class.attribute_map.key?(k.to_sym))
175
+ 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
176
+ end
177
+ h[k.to_sym] = v
178
+ }
179
+
180
+ if attributes.key?(:'vuln_id')
181
+ self.vuln_id = attributes[:'vuln_id']
182
+ end
183
+
184
+ if attributes.key?(:'source')
185
+ self.source = attributes[:'source']
186
+ end
187
+
188
+ if attributes.key?(:'title')
189
+ self.title = attributes[:'title']
190
+ end
191
+
192
+ if attributes.key?(:'sub_title')
193
+ self.sub_title = attributes[:'sub_title']
194
+ end
195
+
196
+ if attributes.key?(:'description')
197
+ self.description = attributes[:'description']
198
+ end
199
+
200
+ if attributes.key?(:'recommendation')
201
+ self.recommendation = attributes[:'recommendation']
202
+ end
203
+
204
+ if attributes.key?(:'references')
205
+ self.references = attributes[:'references']
206
+ end
207
+
208
+ if attributes.key?(:'credits')
209
+ self.credits = attributes[:'credits']
210
+ end
211
+
212
+ if attributes.key?(:'created')
213
+ self.created = attributes[:'created']
214
+ end
215
+
216
+ if attributes.key?(:'published')
217
+ self.published = attributes[:'published']
218
+ end
219
+
220
+ if attributes.key?(:'updated')
221
+ self.updated = attributes[:'updated']
222
+ end
223
+
224
+ if attributes.key?(:'cwe')
225
+ self.cwe = attributes[:'cwe']
226
+ end
227
+
228
+ if attributes.key?(:'cvss_v2_base_score')
229
+ self.cvss_v2_base_score = attributes[:'cvss_v2_base_score']
230
+ end
231
+
232
+ if attributes.key?(:'cvss_v2_impact_sub_score')
233
+ self.cvss_v2_impact_sub_score = attributes[:'cvss_v2_impact_sub_score']
234
+ end
235
+
236
+ if attributes.key?(:'cvss_v2_exploitability_sub_score')
237
+ self.cvss_v2_exploitability_sub_score = attributes[:'cvss_v2_exploitability_sub_score']
238
+ end
239
+
240
+ if attributes.key?(:'cvss_v2_vector')
241
+ self.cvss_v2_vector = attributes[:'cvss_v2_vector']
242
+ end
243
+
244
+ if attributes.key?(:'cvss_v3_base_score')
245
+ self.cvss_v3_base_score = attributes[:'cvss_v3_base_score']
246
+ end
247
+
248
+ if attributes.key?(:'cvss_v3_impact_sub_score')
249
+ self.cvss_v3_impact_sub_score = attributes[:'cvss_v3_impact_sub_score']
250
+ end
251
+
252
+ if attributes.key?(:'cvss_v3_exploitability_sub_score')
253
+ self.cvss_v3_exploitability_sub_score = attributes[:'cvss_v3_exploitability_sub_score']
254
+ end
255
+
256
+ if attributes.key?(:'cvss_v3_vector')
257
+ self.cvss_v3_vector = attributes[:'cvss_v3_vector']
258
+ end
259
+
260
+ if attributes.key?(:'severity')
261
+ self.severity = attributes[:'severity']
262
+ end
263
+
264
+ if attributes.key?(:'vulnerable_versions')
265
+ self.vulnerable_versions = attributes[:'vulnerable_versions']
266
+ end
267
+
268
+ if attributes.key?(:'patched_versions')
269
+ self.patched_versions = attributes[:'patched_versions']
270
+ end
271
+
272
+ if attributes.key?(:'vulnerable_software')
273
+ if (value = attributes[:'vulnerable_software']).is_a?(Array)
274
+ self.vulnerable_software = value
275
+ end
276
+ end
277
+
278
+ if attributes.key?(:'components')
279
+ if (value = attributes[:'components']).is_a?(Array)
280
+ self.components = value
281
+ end
282
+ end
283
+
284
+ if attributes.key?(:'uuid')
285
+ self.uuid = attributes[:'uuid']
286
+ end
287
+
288
+ if attributes.key?(:'affected_project_count')
289
+ self.affected_project_count = attributes[:'affected_project_count']
290
+ end
291
+ end
292
+
293
+ # Show invalid properties with the reasons. Usually used together with valid?
294
+ # @return Array for valid properties with the reasons
295
+ def list_invalid_properties
296
+ invalid_properties = Array.new
297
+ if !@vuln_id.nil? && @vuln_id.to_s.length > 255
298
+ invalid_properties.push('invalid value for "vuln_id", the character length must be smaller than or equal to 255.')
299
+ end
300
+
301
+ if !@vuln_id.nil? && @vuln_id.to_s.length < 1
302
+ invalid_properties.push('invalid value for "vuln_id", the character length must be great than or equal to 1.')
303
+ end
304
+
305
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
306
+ if !@vuln_id.nil? && @vuln_id !~ pattern
307
+ invalid_properties.push("invalid value for \"vuln_id\", must conform to the pattern #{pattern}.")
308
+ end
309
+
310
+ if !@source.nil? && @source.to_s.length > 255
311
+ invalid_properties.push('invalid value for "source", the character length must be smaller than or equal to 255.')
312
+ end
313
+
314
+ if !@source.nil? && @source.to_s.length < 1
315
+ invalid_properties.push('invalid value for "source", the character length must be great than or equal to 1.')
316
+ end
317
+
318
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
319
+ if !@source.nil? && @source !~ pattern
320
+ invalid_properties.push("invalid value for \"source\", must conform to the pattern #{pattern}.")
321
+ end
322
+
323
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
324
+ if !@title.nil? && @title !~ pattern
325
+ invalid_properties.push("invalid value for \"title\", must conform to the pattern #{pattern}.")
326
+ end
327
+
328
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
329
+ if !@sub_title.nil? && @sub_title !~ pattern
330
+ invalid_properties.push("invalid value for \"sub_title\", must conform to the pattern #{pattern}.")
331
+ end
332
+
333
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
334
+ if !@description.nil? && @description !~ pattern
335
+ invalid_properties.push("invalid value for \"description\", must conform to the pattern #{pattern}.")
336
+ end
337
+
338
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
339
+ if !@recommendation.nil? && @recommendation !~ pattern
340
+ invalid_properties.push("invalid value for \"recommendation\", must conform to the pattern #{pattern}.")
341
+ end
342
+
343
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
344
+ if !@references.nil? && @references !~ pattern
345
+ invalid_properties.push("invalid value for \"references\", must conform to the pattern #{pattern}.")
346
+ end
347
+
348
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
349
+ if !@credits.nil? && @credits !~ pattern
350
+ invalid_properties.push("invalid value for \"credits\", must conform to the pattern #{pattern}.")
351
+ end
352
+
353
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
354
+ if !@cvss_v2_vector.nil? && @cvss_v2_vector !~ pattern
355
+ invalid_properties.push("invalid value for \"cvss_v2_vector\", must conform to the pattern #{pattern}.")
356
+ end
357
+
358
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
359
+ if !@cvss_v3_vector.nil? && @cvss_v3_vector !~ pattern
360
+ invalid_properties.push("invalid value for \"cvss_v3_vector\", must conform to the pattern #{pattern}.")
361
+ end
362
+
363
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
364
+ if !@severity.nil? && @severity !~ pattern
365
+ invalid_properties.push("invalid value for \"severity\", must conform to the pattern #{pattern}.")
366
+ end
367
+
368
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
369
+ if !@vulnerable_versions.nil? && @vulnerable_versions !~ pattern
370
+ invalid_properties.push("invalid value for \"vulnerable_versions\", must conform to the pattern #{pattern}.")
371
+ end
372
+
373
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
374
+ if !@patched_versions.nil? && @patched_versions !~ pattern
375
+ invalid_properties.push("invalid value for \"patched_versions\", must conform to the pattern #{pattern}.")
376
+ end
377
+
378
+ if @uuid.nil?
379
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
380
+ end
381
+
382
+ invalid_properties
383
+ end
384
+
385
+ # Check to see if the all the properties in the model are valid
386
+ # @return true if the model is valid
387
+ def valid?
388
+ return false if !@vuln_id.nil? && @vuln_id.to_s.length > 255
389
+ return false if !@vuln_id.nil? && @vuln_id.to_s.length < 1
390
+ return false if !@vuln_id.nil? && @vuln_id !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
391
+ return false if !@source.nil? && @source.to_s.length > 255
392
+ return false if !@source.nil? && @source.to_s.length < 1
393
+ return false if !@source.nil? && @source !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
394
+ return false if !@title.nil? && @title !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
395
+ 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]*$/)
396
+ return false if !@description.nil? && @description !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
397
+ return false if !@recommendation.nil? && @recommendation !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
398
+ return false if !@references.nil? && @references !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
399
+ return false if !@credits.nil? && @credits !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
400
+ 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]*$/)
401
+ 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]*$/)
402
+ severity_validator = EnumAttributeValidator.new('String', ["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO", "UNASSIGNED"])
403
+ return false unless severity_validator.valid?(@severity)
404
+ return false if !@severity.nil? && @severity !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
405
+ 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]*$/)
406
+ 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]*$/)
407
+ return false if @uuid.nil?
408
+ true
409
+ end
410
+
411
+ # Custom attribute writer method with validation
412
+ # @param [Object] vuln_id Value to be assigned
413
+ def vuln_id=(vuln_id)
414
+ if !vuln_id.nil? && vuln_id.to_s.length > 255
415
+ fail ArgumentError, 'invalid value for "vuln_id", the character length must be smaller than or equal to 255.'
416
+ end
417
+
418
+ if !vuln_id.nil? && vuln_id.to_s.length < 1
419
+ fail ArgumentError, 'invalid value for "vuln_id", the character length must be great than or equal to 1.'
420
+ end
421
+
422
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
423
+ if !vuln_id.nil? && vuln_id !~ pattern
424
+ fail ArgumentError, "invalid value for \"vuln_id\", must conform to the pattern #{pattern}."
425
+ end
426
+
427
+ @vuln_id = vuln_id
428
+ end
429
+
430
+ # Custom attribute writer method with validation
431
+ # @param [Object] source Value to be assigned
432
+ def source=(source)
433
+ if !source.nil? && source.to_s.length > 255
434
+ fail ArgumentError, 'invalid value for "source", the character length must be smaller than or equal to 255.'
435
+ end
436
+
437
+ if !source.nil? && source.to_s.length < 1
438
+ fail ArgumentError, 'invalid value for "source", the character length must be great than or equal to 1.'
439
+ end
440
+
441
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
442
+ if !source.nil? && source !~ pattern
443
+ fail ArgumentError, "invalid value for \"source\", must conform to the pattern #{pattern}."
444
+ end
445
+
446
+ @source = source
447
+ end
448
+
449
+ # Custom attribute writer method with validation
450
+ # @param [Object] title Value to be assigned
451
+ def title=(title)
452
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
453
+ if !title.nil? && title !~ pattern
454
+ fail ArgumentError, "invalid value for \"title\", must conform to the pattern #{pattern}."
455
+ end
456
+
457
+ @title = title
458
+ end
459
+
460
+ # Custom attribute writer method with validation
461
+ # @param [Object] sub_title Value to be assigned
462
+ def sub_title=(sub_title)
463
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
464
+ if !sub_title.nil? && sub_title !~ pattern
465
+ fail ArgumentError, "invalid value for \"sub_title\", must conform to the pattern #{pattern}."
466
+ end
467
+
468
+ @sub_title = sub_title
469
+ end
470
+
471
+ # Custom attribute writer method with validation
472
+ # @param [Object] description Value to be assigned
473
+ def description=(description)
474
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
475
+ if !description.nil? && description !~ pattern
476
+ fail ArgumentError, "invalid value for \"description\", must conform to the pattern #{pattern}."
477
+ end
478
+
479
+ @description = description
480
+ end
481
+
482
+ # Custom attribute writer method with validation
483
+ # @param [Object] recommendation Value to be assigned
484
+ def recommendation=(recommendation)
485
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
486
+ if !recommendation.nil? && recommendation !~ pattern
487
+ fail ArgumentError, "invalid value for \"recommendation\", must conform to the pattern #{pattern}."
488
+ end
489
+
490
+ @recommendation = recommendation
491
+ end
492
+
493
+ # Custom attribute writer method with validation
494
+ # @param [Object] references Value to be assigned
495
+ def references=(references)
496
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
497
+ if !references.nil? && references !~ pattern
498
+ fail ArgumentError, "invalid value for \"references\", must conform to the pattern #{pattern}."
499
+ end
500
+
501
+ @references = references
502
+ end
503
+
504
+ # Custom attribute writer method with validation
505
+ # @param [Object] credits Value to be assigned
506
+ def credits=(credits)
507
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
508
+ if !credits.nil? && credits !~ pattern
509
+ fail ArgumentError, "invalid value for \"credits\", must conform to the pattern #{pattern}."
510
+ end
511
+
512
+ @credits = credits
513
+ end
514
+
515
+ # Custom attribute writer method with validation
516
+ # @param [Object] cvss_v2_vector Value to be assigned
517
+ def cvss_v2_vector=(cvss_v2_vector)
518
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
519
+ if !cvss_v2_vector.nil? && cvss_v2_vector !~ pattern
520
+ fail ArgumentError, "invalid value for \"cvss_v2_vector\", must conform to the pattern #{pattern}."
521
+ end
522
+
523
+ @cvss_v2_vector = cvss_v2_vector
524
+ end
525
+
526
+ # Custom attribute writer method with validation
527
+ # @param [Object] cvss_v3_vector Value to be assigned
528
+ def cvss_v3_vector=(cvss_v3_vector)
529
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
530
+ if !cvss_v3_vector.nil? && cvss_v3_vector !~ pattern
531
+ fail ArgumentError, "invalid value for \"cvss_v3_vector\", must conform to the pattern #{pattern}."
532
+ end
533
+
534
+ @cvss_v3_vector = cvss_v3_vector
535
+ end
536
+
537
+ # Custom attribute writer method checking allowed values (enum).
538
+ # @param [Object] severity Object to be assigned
539
+ def severity=(severity)
540
+ validator = EnumAttributeValidator.new('String', ["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO", "UNASSIGNED"])
541
+ unless validator.valid?(severity)
542
+ fail ArgumentError, "invalid value for \"severity\", must be one of #{validator.allowable_values}."
543
+ end
544
+ @severity = severity
545
+ end
546
+
547
+ # Custom attribute writer method with validation
548
+ # @param [Object] vulnerable_versions Value to be assigned
549
+ def vulnerable_versions=(vulnerable_versions)
550
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
551
+ if !vulnerable_versions.nil? && vulnerable_versions !~ pattern
552
+ fail ArgumentError, "invalid value for \"vulnerable_versions\", must conform to the pattern #{pattern}."
553
+ end
554
+
555
+ @vulnerable_versions = vulnerable_versions
556
+ end
557
+
558
+ # Custom attribute writer method with validation
559
+ # @param [Object] patched_versions Value to be assigned
560
+ def patched_versions=(patched_versions)
561
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}\n\r\t]*$/)
562
+ if !patched_versions.nil? && patched_versions !~ pattern
563
+ fail ArgumentError, "invalid value for \"patched_versions\", must conform to the pattern #{pattern}."
564
+ end
565
+
566
+ @patched_versions = patched_versions
567
+ end
568
+
569
+ # Checks equality by comparing each attribute.
570
+ # @param [Object] Object to be compared
571
+ def ==(o)
572
+ return true if self.equal?(o)
573
+ self.class == o.class &&
574
+ vuln_id == o.vuln_id &&
575
+ source == o.source &&
576
+ title == o.title &&
577
+ sub_title == o.sub_title &&
578
+ description == o.description &&
579
+ recommendation == o.recommendation &&
580
+ references == o.references &&
581
+ credits == o.credits &&
582
+ created == o.created &&
583
+ published == o.published &&
584
+ updated == o.updated &&
585
+ cwe == o.cwe &&
586
+ cvss_v2_base_score == o.cvss_v2_base_score &&
587
+ cvss_v2_impact_sub_score == o.cvss_v2_impact_sub_score &&
588
+ cvss_v2_exploitability_sub_score == o.cvss_v2_exploitability_sub_score &&
589
+ cvss_v2_vector == o.cvss_v2_vector &&
590
+ cvss_v3_base_score == o.cvss_v3_base_score &&
591
+ cvss_v3_impact_sub_score == o.cvss_v3_impact_sub_score &&
592
+ cvss_v3_exploitability_sub_score == o.cvss_v3_exploitability_sub_score &&
593
+ cvss_v3_vector == o.cvss_v3_vector &&
594
+ severity == o.severity &&
595
+ vulnerable_versions == o.vulnerable_versions &&
596
+ patched_versions == o.patched_versions &&
597
+ vulnerable_software == o.vulnerable_software &&
598
+ components == o.components &&
599
+ uuid == o.uuid &&
600
+ affected_project_count == o.affected_project_count
601
+ end
602
+
603
+ # @see the `==` method
604
+ # @param [Object] Object to be compared
605
+ def eql?(o)
606
+ self == o
607
+ end
608
+
609
+ # Calculates hash code according to all attributes.
610
+ # @return [Integer] Hash code
611
+ def hash
612
+ [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
613
+ end
614
+
615
+ # Builds the object from hash
616
+ # @param [Hash] attributes Model attributes in the form of hash
617
+ # @return [Object] Returns the model itself
618
+ def self.build_from_hash(attributes)
619
+ new.build_from_hash(attributes)
620
+ end
621
+
622
+ # Builds the object from hash
623
+ # @param [Hash] attributes Model attributes in the form of hash
624
+ # @return [Object] Returns the model itself
625
+ def build_from_hash(attributes)
626
+ return nil unless attributes.is_a?(Hash)
627
+ self.class.openapi_types.each_pair do |key, type|
628
+ if type =~ /\AArray<(.*)>/i
629
+ # check to ensure the input is an array given that the attribute
630
+ # is documented as an array but the input is not
631
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
632
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
633
+ end
634
+ elsif !attributes[self.class.attribute_map[key]].nil?
635
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
636
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
637
+ end
638
+
639
+ self
640
+ end
641
+
642
+ # Deserializes the data based on type
643
+ # @param string type Data type
644
+ # @param string value Value to be deserialized
645
+ # @return [Object] Deserialized data
646
+ def _deserialize(type, value)
647
+ case type.to_sym
648
+ when :DateTime
649
+ DateTime.parse(value)
650
+ when :Date
651
+ Date.parse(value)
652
+ when :String
653
+ value.to_s
654
+ when :Integer
655
+ value.to_i
656
+ when :Float
657
+ value.to_f
658
+ when :Boolean
659
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
660
+ true
661
+ else
662
+ false
663
+ end
664
+ when :Object
665
+ # generic object (usually a Hash), return directly
666
+ value
667
+ when /\AArray<(?<inner_type>.+)>\z/
668
+ inner_type = Regexp.last_match[:inner_type]
669
+ value.map { |v| _deserialize(inner_type, v) }
670
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
671
+ k_type = Regexp.last_match[:k_type]
672
+ v_type = Regexp.last_match[:v_type]
673
+ {}.tap do |hash|
674
+ value.each do |k, v|
675
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
676
+ end
677
+ end
678
+ else # model
679
+ DependencyTracker.const_get(type).build_from_hash(value)
680
+ end
681
+ end
682
+
683
+ # Returns the string representation of the object
684
+ # @return [String] String presentation of the object
685
+ def to_s
686
+ to_hash.to_s
687
+ end
688
+
689
+ # to_body is an alias to to_hash (backward compatibility)
690
+ # @return [Hash] Returns the object in the form of hash
691
+ def to_body
692
+ to_hash
693
+ end
694
+
695
+ # Returns the object in the form of hash
696
+ # @return [Hash] Returns the object in the form of hash
697
+ def to_hash
698
+ hash = {}
699
+ self.class.attribute_map.each_pair do |attr, param|
700
+ value = self.send(attr)
701
+ if value.nil?
702
+ is_nullable = self.class.openapi_nullable.include?(attr)
703
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
704
+ end
705
+
706
+ hash[param] = _to_hash(value)
707
+ end
708
+ hash
709
+ end
710
+
711
+ # Outputs non-array value in the form of hash
712
+ # For object, use to_hash. Otherwise, just return the value
713
+ # @param [Object] value Any valid value
714
+ # @return [Hash] Returns the value in the form of hash
715
+ def _to_hash(value)
716
+ if value.is_a?(Array)
717
+ value.compact.map { |v| _to_hash(v) }
718
+ elsif value.is_a?(Hash)
719
+ {}.tap do |hash|
720
+ value.each { |k, v| hash[k] = _to_hash(v) }
721
+ end
722
+ elsif value.respond_to? :to_hash
723
+ value.to_hash
724
+ else
725
+ value
726
+ end
727
+ end
728
+ end
729
+ end