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,900 @@
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 Component
17
+ attr_accessor :group
18
+
19
+ attr_accessor :name
20
+
21
+ attr_accessor :version
22
+
23
+ attr_accessor :classifier
24
+
25
+ attr_accessor :filename
26
+
27
+ attr_accessor :extension
28
+
29
+ attr_accessor :md5
30
+
31
+ attr_accessor :sha1
32
+
33
+ attr_accessor :sha256
34
+
35
+ attr_accessor :sha512
36
+
37
+ attr_accessor :sha3_256
38
+
39
+ attr_accessor :sha3_512
40
+
41
+ attr_accessor :cpe
42
+
43
+ attr_accessor :purl
44
+
45
+ attr_accessor :description
46
+
47
+ attr_accessor :copyright
48
+
49
+ attr_accessor :license
50
+
51
+ attr_accessor :resolved_license
52
+
53
+ attr_accessor :parent
54
+
55
+ attr_accessor :children
56
+
57
+ attr_accessor :vulnerabilities
58
+
59
+ attr_accessor :last_inherited_risk_score
60
+
61
+ attr_accessor :uuid
62
+
63
+ attr_accessor :metrics
64
+
65
+ attr_accessor :repository_meta
66
+
67
+ attr_accessor :used_by
68
+
69
+ attr_accessor :is_internal
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
+ :'group' => :'group',
97
+ :'name' => :'name',
98
+ :'version' => :'version',
99
+ :'classifier' => :'classifier',
100
+ :'filename' => :'filename',
101
+ :'extension' => :'extension',
102
+ :'md5' => :'md5',
103
+ :'sha1' => :'sha1',
104
+ :'sha256' => :'sha256',
105
+ :'sha512' => :'sha512',
106
+ :'sha3_256' => :'sha3_256',
107
+ :'sha3_512' => :'sha3_512',
108
+ :'cpe' => :'cpe',
109
+ :'purl' => :'purl',
110
+ :'description' => :'description',
111
+ :'copyright' => :'copyright',
112
+ :'license' => :'license',
113
+ :'resolved_license' => :'resolvedLicense',
114
+ :'parent' => :'parent',
115
+ :'children' => :'children',
116
+ :'vulnerabilities' => :'vulnerabilities',
117
+ :'last_inherited_risk_score' => :'lastInheritedRiskScore',
118
+ :'uuid' => :'uuid',
119
+ :'metrics' => :'metrics',
120
+ :'repository_meta' => :'repositoryMeta',
121
+ :'used_by' => :'usedBy',
122
+ :'is_internal' => :'isInternal'
123
+ }
124
+ end
125
+
126
+ # Attribute type mapping.
127
+ def self.openapi_types
128
+ {
129
+ :'group' => :'String',
130
+ :'name' => :'String',
131
+ :'version' => :'String',
132
+ :'classifier' => :'String',
133
+ :'filename' => :'String',
134
+ :'extension' => :'String',
135
+ :'md5' => :'String',
136
+ :'sha1' => :'String',
137
+ :'sha256' => :'String',
138
+ :'sha512' => :'String',
139
+ :'sha3_256' => :'String',
140
+ :'sha3_512' => :'String',
141
+ :'cpe' => :'String',
142
+ :'purl' => :'PackageURL',
143
+ :'description' => :'String',
144
+ :'copyright' => :'String',
145
+ :'license' => :'String',
146
+ :'resolved_license' => :'License',
147
+ :'parent' => :'Component',
148
+ :'children' => :'Array<Component>',
149
+ :'vulnerabilities' => :'Array<Vulnerability>',
150
+ :'last_inherited_risk_score' => :'Float',
151
+ :'uuid' => :'String',
152
+ :'metrics' => :'ComponentMetrics',
153
+ :'repository_meta' => :'RepositoryMetaComponent',
154
+ :'used_by' => :'Integer',
155
+ :'is_internal' => :'Boolean'
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::Component` 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::Component`. 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?(:'group')
181
+ self.group = attributes[:'group']
182
+ end
183
+
184
+ if attributes.key?(:'name')
185
+ self.name = attributes[:'name']
186
+ end
187
+
188
+ if attributes.key?(:'version')
189
+ self.version = attributes[:'version']
190
+ end
191
+
192
+ if attributes.key?(:'classifier')
193
+ self.classifier = attributes[:'classifier']
194
+ end
195
+
196
+ if attributes.key?(:'filename')
197
+ self.filename = attributes[:'filename']
198
+ end
199
+
200
+ if attributes.key?(:'extension')
201
+ self.extension = attributes[:'extension']
202
+ end
203
+
204
+ if attributes.key?(:'md5')
205
+ self.md5 = attributes[:'md5']
206
+ end
207
+
208
+ if attributes.key?(:'sha1')
209
+ self.sha1 = attributes[:'sha1']
210
+ end
211
+
212
+ if attributes.key?(:'sha256')
213
+ self.sha256 = attributes[:'sha256']
214
+ end
215
+
216
+ if attributes.key?(:'sha512')
217
+ self.sha512 = attributes[:'sha512']
218
+ end
219
+
220
+ if attributes.key?(:'sha3_256')
221
+ self.sha3_256 = attributes[:'sha3_256']
222
+ end
223
+
224
+ if attributes.key?(:'sha3_512')
225
+ self.sha3_512 = attributes[:'sha3_512']
226
+ end
227
+
228
+ if attributes.key?(:'cpe')
229
+ self.cpe = attributes[:'cpe']
230
+ end
231
+
232
+ if attributes.key?(:'purl')
233
+ self.purl = attributes[:'purl']
234
+ end
235
+
236
+ if attributes.key?(:'description')
237
+ self.description = attributes[:'description']
238
+ end
239
+
240
+ if attributes.key?(:'copyright')
241
+ self.copyright = attributes[:'copyright']
242
+ end
243
+
244
+ if attributes.key?(:'license')
245
+ self.license = attributes[:'license']
246
+ end
247
+
248
+ if attributes.key?(:'resolved_license')
249
+ self.resolved_license = attributes[:'resolved_license']
250
+ end
251
+
252
+ if attributes.key?(:'parent')
253
+ self.parent = attributes[:'parent']
254
+ end
255
+
256
+ if attributes.key?(:'children')
257
+ if (value = attributes[:'children']).is_a?(Array)
258
+ self.children = value
259
+ end
260
+ end
261
+
262
+ if attributes.key?(:'vulnerabilities')
263
+ if (value = attributes[:'vulnerabilities']).is_a?(Array)
264
+ self.vulnerabilities = value
265
+ end
266
+ end
267
+
268
+ if attributes.key?(:'last_inherited_risk_score')
269
+ self.last_inherited_risk_score = attributes[:'last_inherited_risk_score']
270
+ end
271
+
272
+ if attributes.key?(:'uuid')
273
+ self.uuid = attributes[:'uuid']
274
+ end
275
+
276
+ if attributes.key?(:'metrics')
277
+ self.metrics = attributes[:'metrics']
278
+ end
279
+
280
+ if attributes.key?(:'repository_meta')
281
+ self.repository_meta = attributes[:'repository_meta']
282
+ end
283
+
284
+ if attributes.key?(:'used_by')
285
+ self.used_by = attributes[:'used_by']
286
+ end
287
+
288
+ if attributes.key?(:'is_internal')
289
+ self.is_internal = attributes[:'is_internal']
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 !@group.nil? && @group.to_s.length > 255
298
+ invalid_properties.push('invalid value for "group", the character length must be smaller than or equal to 255.')
299
+ end
300
+
301
+ if !@group.nil? && @group.to_s.length < 0
302
+ invalid_properties.push('invalid value for "group", the character length must be great than or equal to 0.')
303
+ end
304
+
305
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
306
+ if !@group.nil? && @group !~ pattern
307
+ invalid_properties.push("invalid value for \"group\", must conform to the pattern #{pattern}.")
308
+ end
309
+
310
+ if !@name.nil? && @name.to_s.length > 255
311
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
312
+ end
313
+
314
+ if !@name.nil? && @name.to_s.length < 1
315
+ invalid_properties.push('invalid value for "name", 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}]*$/)
319
+ if !@name.nil? && @name !~ pattern
320
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
321
+ end
322
+
323
+ if !@version.nil? && @version.to_s.length > 255
324
+ invalid_properties.push('invalid value for "version", the character length must be smaller than or equal to 255.')
325
+ end
326
+
327
+ if !@version.nil? && @version.to_s.length < 0
328
+ invalid_properties.push('invalid value for "version", the character length must be great than or equal to 0.')
329
+ end
330
+
331
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
332
+ if !@version.nil? && @version !~ pattern
333
+ invalid_properties.push("invalid value for \"version\", must conform to the pattern #{pattern}.")
334
+ end
335
+
336
+ if !@filename.nil? && @filename.to_s.length > 255
337
+ invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 255.')
338
+ end
339
+
340
+ if !@filename.nil? && @filename.to_s.length < 0
341
+ invalid_properties.push('invalid value for "filename", the character length must be great than or equal to 0.')
342
+ end
343
+
344
+ pattern = Regexp.new(/^[\p{Alnum}:\/\\!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/)
345
+ if !@filename.nil? && @filename !~ pattern
346
+ invalid_properties.push("invalid value for \"filename\", must conform to the pattern #{pattern}.")
347
+ end
348
+
349
+ if !@extension.nil? && @extension.to_s.length > 255
350
+ invalid_properties.push('invalid value for "extension", the character length must be smaller than or equal to 255.')
351
+ end
352
+
353
+ if !@extension.nil? && @extension.to_s.length < 0
354
+ invalid_properties.push('invalid value for "extension", the character length must be great than or equal to 0.')
355
+ end
356
+
357
+ pattern = Regexp.new(/^[\p{Alnum}!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/)
358
+ if !@extension.nil? && @extension !~ pattern
359
+ invalid_properties.push("invalid value for \"extension\", must conform to the pattern #{pattern}.")
360
+ end
361
+
362
+ pattern = Regexp.new(/^[0-9a-f]{32}$/)
363
+ if !@md5.nil? && @md5 !~ pattern
364
+ invalid_properties.push("invalid value for \"md5\", must conform to the pattern #{pattern}.")
365
+ end
366
+
367
+ pattern = Regexp.new(/^[0-9a-f]{40}$/)
368
+ if !@sha1.nil? && @sha1 !~ pattern
369
+ invalid_properties.push("invalid value for \"sha1\", must conform to the pattern #{pattern}.")
370
+ end
371
+
372
+ pattern = Regexp.new(/^[0-9a-f]{64}$/)
373
+ if !@sha256.nil? && @sha256 !~ pattern
374
+ invalid_properties.push("invalid value for \"sha256\", must conform to the pattern #{pattern}.")
375
+ end
376
+
377
+ pattern = Regexp.new(/^[0-9a-f]{128}$/)
378
+ if !@sha512.nil? && @sha512 !~ pattern
379
+ invalid_properties.push("invalid value for \"sha512\", must conform to the pattern #{pattern}.")
380
+ end
381
+
382
+ pattern = Regexp.new(/^[0-9a-f]{64}$/)
383
+ if !@sha3_256.nil? && @sha3_256 !~ pattern
384
+ invalid_properties.push("invalid value for \"sha3_256\", must conform to the pattern #{pattern}.")
385
+ end
386
+
387
+ pattern = Regexp.new(/^[0-9a-f]{128}$/)
388
+ if !@sha3_512.nil? && @sha3_512 !~ pattern
389
+ invalid_properties.push("invalid value for \"sha3_512\", must conform to the pattern #{pattern}.")
390
+ end
391
+
392
+ if !@cpe.nil? && @cpe.to_s.length > 255
393
+ invalid_properties.push('invalid value for "cpe", the character length must be smaller than or equal to 255.')
394
+ end
395
+
396
+ if !@cpe.nil? && @cpe.to_s.length < 0
397
+ invalid_properties.push('invalid value for "cpe", the character length must be great than or equal to 0.')
398
+ end
399
+
400
+ pattern = Regexp.new(/(cpe:2\.3:[aho\*\-](:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){4})|([c][pP][eE]:\/[AHOaho]?(:[A-Za-z0-9\._\-~%]*){0,6})/)
401
+ if !@cpe.nil? && @cpe !~ pattern
402
+ invalid_properties.push("invalid value for \"cpe\", must conform to the pattern #{pattern}.")
403
+ end
404
+
405
+ if !@description.nil? && @description.to_s.length > 1024
406
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 1024.')
407
+ end
408
+
409
+ if !@description.nil? && @description.to_s.length < 0
410
+ invalid_properties.push('invalid value for "description", the character length must be great than or equal to 0.')
411
+ end
412
+
413
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
414
+ if !@description.nil? && @description !~ pattern
415
+ invalid_properties.push("invalid value for \"description\", must conform to the pattern #{pattern}.")
416
+ end
417
+
418
+ if !@copyright.nil? && @copyright.to_s.length > 1024
419
+ invalid_properties.push('invalid value for "copyright", the character length must be smaller than or equal to 1024.')
420
+ end
421
+
422
+ if !@copyright.nil? && @copyright.to_s.length < 0
423
+ invalid_properties.push('invalid value for "copyright", the character length must be great than or equal to 0.')
424
+ end
425
+
426
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
427
+ if !@copyright.nil? && @copyright !~ pattern
428
+ invalid_properties.push("invalid value for \"copyright\", must conform to the pattern #{pattern}.")
429
+ end
430
+
431
+ if !@license.nil? && @license.to_s.length > 255
432
+ invalid_properties.push('invalid value for "license", the character length must be smaller than or equal to 255.')
433
+ end
434
+
435
+ if !@license.nil? && @license.to_s.length < 0
436
+ invalid_properties.push('invalid value for "license", the character length must be great than or equal to 0.')
437
+ end
438
+
439
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
440
+ if !@license.nil? && @license !~ pattern
441
+ invalid_properties.push("invalid value for \"license\", must conform to the pattern #{pattern}.")
442
+ end
443
+
444
+ if @uuid.nil?
445
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
446
+ end
447
+
448
+ invalid_properties
449
+ end
450
+
451
+ # Check to see if the all the properties in the model are valid
452
+ # @return true if the model is valid
453
+ def valid?
454
+ return false if !@group.nil? && @group.to_s.length > 255
455
+ return false if !@group.nil? && @group.to_s.length < 0
456
+ return false if !@group.nil? && @group !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
457
+ return false if !@name.nil? && @name.to_s.length > 255
458
+ return false if !@name.nil? && @name.to_s.length < 1
459
+ return false if !@name.nil? && @name !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
460
+ return false if !@version.nil? && @version.to_s.length > 255
461
+ return false if !@version.nil? && @version.to_s.length < 0
462
+ return false if !@version.nil? && @version !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
463
+ classifier_validator = EnumAttributeValidator.new('String', ["APPLICATION", "FRAMEWORK", "LIBRARY", "OPERATING_SYSTEM", "DEVICE", "FILE"])
464
+ return false unless classifier_validator.valid?(@classifier)
465
+ return false if !@filename.nil? && @filename.to_s.length > 255
466
+ return false if !@filename.nil? && @filename.to_s.length < 0
467
+ return false if !@filename.nil? && @filename !~ Regexp.new(/^[\p{Alnum}:\/\\!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/)
468
+ return false if !@extension.nil? && @extension.to_s.length > 255
469
+ return false if !@extension.nil? && @extension.to_s.length < 0
470
+ return false if !@extension.nil? && @extension !~ Regexp.new(/^[\p{Alnum}!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/)
471
+ return false if !@md5.nil? && @md5 !~ Regexp.new(/^[0-9a-f]{32}$/)
472
+ return false if !@sha1.nil? && @sha1 !~ Regexp.new(/^[0-9a-f]{40}$/)
473
+ return false if !@sha256.nil? && @sha256 !~ Regexp.new(/^[0-9a-f]{64}$/)
474
+ return false if !@sha512.nil? && @sha512 !~ Regexp.new(/^[0-9a-f]{128}$/)
475
+ return false if !@sha3_256.nil? && @sha3_256 !~ Regexp.new(/^[0-9a-f]{64}$/)
476
+ return false if !@sha3_512.nil? && @sha3_512 !~ Regexp.new(/^[0-9a-f]{128}$/)
477
+ return false if !@cpe.nil? && @cpe.to_s.length > 255
478
+ return false if !@cpe.nil? && @cpe.to_s.length < 0
479
+ return false if !@cpe.nil? && @cpe !~ Regexp.new(/(cpe:2\.3:[aho\*\-](:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){4})|([c][pP][eE]:\/[AHOaho]?(:[A-Za-z0-9\._\-~%]*){0,6})/)
480
+ return false if !@description.nil? && @description.to_s.length > 1024
481
+ return false if !@description.nil? && @description.to_s.length < 0
482
+ return false if !@description.nil? && @description !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
483
+ return false if !@copyright.nil? && @copyright.to_s.length > 1024
484
+ return false if !@copyright.nil? && @copyright.to_s.length < 0
485
+ return false if !@copyright.nil? && @copyright !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
486
+ return false if !@license.nil? && @license.to_s.length > 255
487
+ return false if !@license.nil? && @license.to_s.length < 0
488
+ return false if !@license.nil? && @license !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
489
+ return false if @uuid.nil?
490
+ true
491
+ end
492
+
493
+ # Custom attribute writer method with validation
494
+ # @param [Object] group Value to be assigned
495
+ def group=(group)
496
+ if !group.nil? && group.to_s.length > 255
497
+ fail ArgumentError, 'invalid value for "group", the character length must be smaller than or equal to 255.'
498
+ end
499
+
500
+ if !group.nil? && group.to_s.length < 0
501
+ fail ArgumentError, 'invalid value for "group", the character length must be great than or equal to 0.'
502
+ end
503
+
504
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
505
+ if !group.nil? && group !~ pattern
506
+ fail ArgumentError, "invalid value for \"group\", must conform to the pattern #{pattern}."
507
+ end
508
+
509
+ @group = group
510
+ end
511
+
512
+ # Custom attribute writer method with validation
513
+ # @param [Object] name Value to be assigned
514
+ def name=(name)
515
+ if !name.nil? && name.to_s.length > 255
516
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
517
+ end
518
+
519
+ if !name.nil? && name.to_s.length < 1
520
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
521
+ end
522
+
523
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
524
+ if !name.nil? && name !~ pattern
525
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
526
+ end
527
+
528
+ @name = name
529
+ end
530
+
531
+ # Custom attribute writer method with validation
532
+ # @param [Object] version Value to be assigned
533
+ def version=(version)
534
+ if !version.nil? && version.to_s.length > 255
535
+ fail ArgumentError, 'invalid value for "version", the character length must be smaller than or equal to 255.'
536
+ end
537
+
538
+ if !version.nil? && version.to_s.length < 0
539
+ fail ArgumentError, 'invalid value for "version", the character length must be great than or equal to 0.'
540
+ end
541
+
542
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
543
+ if !version.nil? && version !~ pattern
544
+ fail ArgumentError, "invalid value for \"version\", must conform to the pattern #{pattern}."
545
+ end
546
+
547
+ @version = version
548
+ end
549
+
550
+ # Custom attribute writer method checking allowed values (enum).
551
+ # @param [Object] classifier Object to be assigned
552
+ def classifier=(classifier)
553
+ validator = EnumAttributeValidator.new('String', ["APPLICATION", "FRAMEWORK", "LIBRARY", "OPERATING_SYSTEM", "DEVICE", "FILE"])
554
+ unless validator.valid?(classifier)
555
+ fail ArgumentError, "invalid value for \"classifier\", must be one of #{validator.allowable_values}."
556
+ end
557
+ @classifier = classifier
558
+ end
559
+
560
+ # Custom attribute writer method with validation
561
+ # @param [Object] filename Value to be assigned
562
+ def filename=(filename)
563
+ if !filename.nil? && filename.to_s.length > 255
564
+ fail ArgumentError, 'invalid value for "filename", the character length must be smaller than or equal to 255.'
565
+ end
566
+
567
+ if !filename.nil? && filename.to_s.length < 0
568
+ fail ArgumentError, 'invalid value for "filename", the character length must be great than or equal to 0.'
569
+ end
570
+
571
+ pattern = Regexp.new(/^[\p{Alnum}:\/\\!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/)
572
+ if !filename.nil? && filename !~ pattern
573
+ fail ArgumentError, "invalid value for \"filename\", must conform to the pattern #{pattern}."
574
+ end
575
+
576
+ @filename = filename
577
+ end
578
+
579
+ # Custom attribute writer method with validation
580
+ # @param [Object] extension Value to be assigned
581
+ def extension=(extension)
582
+ if !extension.nil? && extension.to_s.length > 255
583
+ fail ArgumentError, 'invalid value for "extension", the character length must be smaller than or equal to 255.'
584
+ end
585
+
586
+ if !extension.nil? && extension.to_s.length < 0
587
+ fail ArgumentError, 'invalid value for "extension", the character length must be great than or equal to 0.'
588
+ end
589
+
590
+ pattern = Regexp.new(/^[\p{Alnum}!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/)
591
+ if !extension.nil? && extension !~ pattern
592
+ fail ArgumentError, "invalid value for \"extension\", must conform to the pattern #{pattern}."
593
+ end
594
+
595
+ @extension = extension
596
+ end
597
+
598
+ # Custom attribute writer method with validation
599
+ # @param [Object] md5 Value to be assigned
600
+ def md5=(md5)
601
+ pattern = Regexp.new(/^[0-9a-f]{32}$/)
602
+ if !md5.nil? && md5 !~ pattern
603
+ fail ArgumentError, "invalid value for \"md5\", must conform to the pattern #{pattern}."
604
+ end
605
+
606
+ @md5 = md5
607
+ end
608
+
609
+ # Custom attribute writer method with validation
610
+ # @param [Object] sha1 Value to be assigned
611
+ def sha1=(sha1)
612
+ pattern = Regexp.new(/^[0-9a-f]{40}$/)
613
+ if !sha1.nil? && sha1 !~ pattern
614
+ fail ArgumentError, "invalid value for \"sha1\", must conform to the pattern #{pattern}."
615
+ end
616
+
617
+ @sha1 = sha1
618
+ end
619
+
620
+ # Custom attribute writer method with validation
621
+ # @param [Object] sha256 Value to be assigned
622
+ def sha256=(sha256)
623
+ pattern = Regexp.new(/^[0-9a-f]{64}$/)
624
+ if !sha256.nil? && sha256 !~ pattern
625
+ fail ArgumentError, "invalid value for \"sha256\", must conform to the pattern #{pattern}."
626
+ end
627
+
628
+ @sha256 = sha256
629
+ end
630
+
631
+ # Custom attribute writer method with validation
632
+ # @param [Object] sha512 Value to be assigned
633
+ def sha512=(sha512)
634
+ pattern = Regexp.new(/^[0-9a-f]{128}$/)
635
+ if !sha512.nil? && sha512 !~ pattern
636
+ fail ArgumentError, "invalid value for \"sha512\", must conform to the pattern #{pattern}."
637
+ end
638
+
639
+ @sha512 = sha512
640
+ end
641
+
642
+ # Custom attribute writer method with validation
643
+ # @param [Object] sha3_256 Value to be assigned
644
+ def sha3_256=(sha3_256)
645
+ pattern = Regexp.new(/^[0-9a-f]{64}$/)
646
+ if !sha3_256.nil? && sha3_256 !~ pattern
647
+ fail ArgumentError, "invalid value for \"sha3_256\", must conform to the pattern #{pattern}."
648
+ end
649
+
650
+ @sha3_256 = sha3_256
651
+ end
652
+
653
+ # Custom attribute writer method with validation
654
+ # @param [Object] sha3_512 Value to be assigned
655
+ def sha3_512=(sha3_512)
656
+ pattern = Regexp.new(/^[0-9a-f]{128}$/)
657
+ if !sha3_512.nil? && sha3_512 !~ pattern
658
+ fail ArgumentError, "invalid value for \"sha3_512\", must conform to the pattern #{pattern}."
659
+ end
660
+
661
+ @sha3_512 = sha3_512
662
+ end
663
+
664
+ # Custom attribute writer method with validation
665
+ # @param [Object] cpe Value to be assigned
666
+ def cpe=(cpe)
667
+ if !cpe.nil? && cpe.to_s.length > 255
668
+ fail ArgumentError, 'invalid value for "cpe", the character length must be smaller than or equal to 255.'
669
+ end
670
+
671
+ if !cpe.nil? && cpe.to_s.length < 0
672
+ fail ArgumentError, 'invalid value for "cpe", the character length must be great than or equal to 0.'
673
+ end
674
+
675
+ pattern = Regexp.new(/(cpe:2\.3:[aho\*\-](:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){4})|([c][pP][eE]:\/[AHOaho]?(:[A-Za-z0-9\._\-~%]*){0,6})/)
676
+ if !cpe.nil? && cpe !~ pattern
677
+ fail ArgumentError, "invalid value for \"cpe\", must conform to the pattern #{pattern}."
678
+ end
679
+
680
+ @cpe = cpe
681
+ end
682
+
683
+ # Custom attribute writer method with validation
684
+ # @param [Object] description Value to be assigned
685
+ def description=(description)
686
+ if !description.nil? && description.to_s.length > 1024
687
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 1024.'
688
+ end
689
+
690
+ if !description.nil? && description.to_s.length < 0
691
+ fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 0.'
692
+ end
693
+
694
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
695
+ if !description.nil? && description !~ pattern
696
+ fail ArgumentError, "invalid value for \"description\", must conform to the pattern #{pattern}."
697
+ end
698
+
699
+ @description = description
700
+ end
701
+
702
+ # Custom attribute writer method with validation
703
+ # @param [Object] copyright Value to be assigned
704
+ def copyright=(copyright)
705
+ if !copyright.nil? && copyright.to_s.length > 1024
706
+ fail ArgumentError, 'invalid value for "copyright", the character length must be smaller than or equal to 1024.'
707
+ end
708
+
709
+ if !copyright.nil? && copyright.to_s.length < 0
710
+ fail ArgumentError, 'invalid value for "copyright", the character length must be great than or equal to 0.'
711
+ end
712
+
713
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
714
+ if !copyright.nil? && copyright !~ pattern
715
+ fail ArgumentError, "invalid value for \"copyright\", must conform to the pattern #{pattern}."
716
+ end
717
+
718
+ @copyright = copyright
719
+ end
720
+
721
+ # Custom attribute writer method with validation
722
+ # @param [Object] license Value to be assigned
723
+ def license=(license)
724
+ if !license.nil? && license.to_s.length > 255
725
+ fail ArgumentError, 'invalid value for "license", the character length must be smaller than or equal to 255.'
726
+ end
727
+
728
+ if !license.nil? && license.to_s.length < 0
729
+ fail ArgumentError, 'invalid value for "license", the character length must be great than or equal to 0.'
730
+ end
731
+
732
+ pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/)
733
+ if !license.nil? && license !~ pattern
734
+ fail ArgumentError, "invalid value for \"license\", must conform to the pattern #{pattern}."
735
+ end
736
+
737
+ @license = license
738
+ end
739
+
740
+ # Checks equality by comparing each attribute.
741
+ # @param [Object] Object to be compared
742
+ def ==(o)
743
+ return true if self.equal?(o)
744
+ self.class == o.class &&
745
+ group == o.group &&
746
+ name == o.name &&
747
+ version == o.version &&
748
+ classifier == o.classifier &&
749
+ filename == o.filename &&
750
+ extension == o.extension &&
751
+ md5 == o.md5 &&
752
+ sha1 == o.sha1 &&
753
+ sha256 == o.sha256 &&
754
+ sha512 == o.sha512 &&
755
+ sha3_256 == o.sha3_256 &&
756
+ sha3_512 == o.sha3_512 &&
757
+ cpe == o.cpe &&
758
+ purl == o.purl &&
759
+ description == o.description &&
760
+ copyright == o.copyright &&
761
+ license == o.license &&
762
+ resolved_license == o.resolved_license &&
763
+ parent == o.parent &&
764
+ children == o.children &&
765
+ vulnerabilities == o.vulnerabilities &&
766
+ last_inherited_risk_score == o.last_inherited_risk_score &&
767
+ uuid == o.uuid &&
768
+ metrics == o.metrics &&
769
+ repository_meta == o.repository_meta &&
770
+ used_by == o.used_by &&
771
+ is_internal == o.is_internal
772
+ end
773
+
774
+ # @see the `==` method
775
+ # @param [Object] Object to be compared
776
+ def eql?(o)
777
+ self == o
778
+ end
779
+
780
+ # Calculates hash code according to all attributes.
781
+ # @return [Integer] Hash code
782
+ def hash
783
+ [group, name, version, classifier, filename, extension, md5, sha1, sha256, sha512, sha3_256, sha3_512, cpe, purl, description, copyright, license, resolved_license, parent, children, vulnerabilities, last_inherited_risk_score, uuid, metrics, repository_meta, used_by, is_internal].hash
784
+ end
785
+
786
+ # Builds the object from hash
787
+ # @param [Hash] attributes Model attributes in the form of hash
788
+ # @return [Object] Returns the model itself
789
+ def self.build_from_hash(attributes)
790
+ new.build_from_hash(attributes)
791
+ end
792
+
793
+ # Builds the object from hash
794
+ # @param [Hash] attributes Model attributes in the form of hash
795
+ # @return [Object] Returns the model itself
796
+ def build_from_hash(attributes)
797
+ return nil unless attributes.is_a?(Hash)
798
+ self.class.openapi_types.each_pair do |key, type|
799
+ if type =~ /\AArray<(.*)>/i
800
+ # check to ensure the input is an array given that the attribute
801
+ # is documented as an array but the input is not
802
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
803
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
804
+ end
805
+ elsif !attributes[self.class.attribute_map[key]].nil?
806
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
807
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
808
+ end
809
+
810
+ self
811
+ end
812
+
813
+ # Deserializes the data based on type
814
+ # @param string type Data type
815
+ # @param string value Value to be deserialized
816
+ # @return [Object] Deserialized data
817
+ def _deserialize(type, value)
818
+ case type.to_sym
819
+ when :DateTime
820
+ DateTime.parse(value)
821
+ when :Date
822
+ Date.parse(value)
823
+ when :String
824
+ value.to_s
825
+ when :Integer
826
+ value.to_i
827
+ when :Float
828
+ value.to_f
829
+ when :Boolean
830
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
831
+ true
832
+ else
833
+ false
834
+ end
835
+ when :Object
836
+ # generic object (usually a Hash), return directly
837
+ value
838
+ when /\AArray<(?<inner_type>.+)>\z/
839
+ inner_type = Regexp.last_match[:inner_type]
840
+ value.map { |v| _deserialize(inner_type, v) }
841
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
842
+ k_type = Regexp.last_match[:k_type]
843
+ v_type = Regexp.last_match[:v_type]
844
+ {}.tap do |hash|
845
+ value.each do |k, v|
846
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
847
+ end
848
+ end
849
+ else # model
850
+ DependencyTracker.const_get(type).build_from_hash(value)
851
+ end
852
+ end
853
+
854
+ # Returns the string representation of the object
855
+ # @return [String] String presentation of the object
856
+ def to_s
857
+ to_hash.to_s
858
+ end
859
+
860
+ # to_body is an alias to to_hash (backward compatibility)
861
+ # @return [Hash] Returns the object in the form of hash
862
+ def to_body
863
+ to_hash
864
+ end
865
+
866
+ # Returns the object in the form of hash
867
+ # @return [Hash] Returns the object in the form of hash
868
+ def to_hash
869
+ hash = {}
870
+ self.class.attribute_map.each_pair do |attr, param|
871
+ value = self.send(attr)
872
+ if value.nil?
873
+ is_nullable = self.class.openapi_nullable.include?(attr)
874
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
875
+ end
876
+
877
+ hash[param] = _to_hash(value)
878
+ end
879
+ hash
880
+ end
881
+
882
+ # Outputs non-array value in the form of hash
883
+ # For object, use to_hash. Otherwise, just return the value
884
+ # @param [Object] value Any valid value
885
+ # @return [Hash] Returns the value in the form of hash
886
+ def _to_hash(value)
887
+ if value.is_a?(Array)
888
+ value.compact.map { |v| _to_hash(v) }
889
+ elsif value.is_a?(Hash)
890
+ {}.tap do |hash|
891
+ value.each { |k, v| hash[k] = _to_hash(v) }
892
+ end
893
+ elsif value.respond_to? :to_hash
894
+ value.to_hash
895
+ else
896
+ value
897
+ end
898
+ end
899
+ end
900
+ end