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,244 @@
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 MediaType
17
+ attr_accessor :type
18
+
19
+ attr_accessor :subtype
20
+
21
+ attr_accessor :parameters
22
+
23
+ attr_accessor :wildcard_type
24
+
25
+ attr_accessor :wildcard_subtype
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'type' => :'type',
31
+ :'subtype' => :'subtype',
32
+ :'parameters' => :'parameters',
33
+ :'wildcard_type' => :'wildcardType',
34
+ :'wildcard_subtype' => :'wildcardSubtype'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'type' => :'String',
42
+ :'subtype' => :'String',
43
+ :'parameters' => :'Hash<String, String>',
44
+ :'wildcard_type' => :'Boolean',
45
+ :'wildcard_subtype' => :'Boolean'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DependencyTracker::MediaType` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DependencyTracker::MediaType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'type')
71
+ self.type = attributes[:'type']
72
+ end
73
+
74
+ if attributes.key?(:'subtype')
75
+ self.subtype = attributes[:'subtype']
76
+ end
77
+
78
+ if attributes.key?(:'parameters')
79
+ if (value = attributes[:'parameters']).is_a?(Hash)
80
+ self.parameters = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'wildcard_type')
85
+ self.wildcard_type = attributes[:'wildcard_type']
86
+ end
87
+
88
+ if attributes.key?(:'wildcard_subtype')
89
+ self.wildcard_subtype = attributes[:'wildcard_subtype']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ type == o.type &&
112
+ subtype == o.subtype &&
113
+ parameters == o.parameters &&
114
+ wildcard_type == o.wildcard_type &&
115
+ wildcard_subtype == o.wildcard_subtype
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [type, subtype, parameters, wildcard_type, wildcard_subtype].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ new.build_from_hash(attributes)
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
147
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
148
+ end
149
+ elsif !attributes[self.class.attribute_map[key]].nil?
150
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
151
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ DateTime.parse(value)
165
+ when :Date
166
+ Date.parse(value)
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :Boolean
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else # model
194
+ DependencyTracker.const_get(type).build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+ end
244
+ end
@@ -0,0 +1,284 @@
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 MultiPart
17
+ attr_accessor :content_disposition
18
+
19
+ attr_accessor :entity
20
+
21
+ attr_accessor :headers
22
+
23
+ attr_accessor :media_type
24
+
25
+ attr_accessor :message_body_workers
26
+
27
+ attr_accessor :parent
28
+
29
+ attr_accessor :providers
30
+
31
+ attr_accessor :body_parts
32
+
33
+ attr_accessor :parameterized_headers
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'content_disposition' => :'contentDisposition',
39
+ :'entity' => :'entity',
40
+ :'headers' => :'headers',
41
+ :'media_type' => :'mediaType',
42
+ :'message_body_workers' => :'messageBodyWorkers',
43
+ :'parent' => :'parent',
44
+ :'providers' => :'providers',
45
+ :'body_parts' => :'bodyParts',
46
+ :'parameterized_headers' => :'parameterizedHeaders'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'content_disposition' => :'ContentDisposition',
54
+ :'entity' => :'Object',
55
+ :'headers' => :'Hash<String, Array<String>>',
56
+ :'media_type' => :'MediaType',
57
+ :'message_body_workers' => :'Object',
58
+ :'parent' => :'MultiPart',
59
+ :'providers' => :'Object',
60
+ :'body_parts' => :'Array<BodyPart>',
61
+ :'parameterized_headers' => :'Hash<String, Array<ParameterizedHeader>>'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DependencyTracker::MultiPart` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DependencyTracker::MultiPart`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'content_disposition')
87
+ self.content_disposition = attributes[:'content_disposition']
88
+ end
89
+
90
+ if attributes.key?(:'entity')
91
+ self.entity = attributes[:'entity']
92
+ end
93
+
94
+ if attributes.key?(:'headers')
95
+ if (value = attributes[:'headers']).is_a?(Hash)
96
+ self.headers = value
97
+ end
98
+ end
99
+
100
+ if attributes.key?(:'media_type')
101
+ self.media_type = attributes[:'media_type']
102
+ end
103
+
104
+ if attributes.key?(:'message_body_workers')
105
+ self.message_body_workers = attributes[:'message_body_workers']
106
+ end
107
+
108
+ if attributes.key?(:'parent')
109
+ self.parent = attributes[:'parent']
110
+ end
111
+
112
+ if attributes.key?(:'providers')
113
+ self.providers = attributes[:'providers']
114
+ end
115
+
116
+ if attributes.key?(:'body_parts')
117
+ if (value = attributes[:'body_parts']).is_a?(Array)
118
+ self.body_parts = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'parameterized_headers')
123
+ if (value = attributes[:'parameterized_headers']).is_a?(Hash)
124
+ self.parameterized_headers = value
125
+ end
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ invalid_properties = Array.new
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ true
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ content_disposition == o.content_disposition &&
148
+ entity == o.entity &&
149
+ headers == o.headers &&
150
+ media_type == o.media_type &&
151
+ message_body_workers == o.message_body_workers &&
152
+ parent == o.parent &&
153
+ providers == o.providers &&
154
+ body_parts == o.body_parts &&
155
+ parameterized_headers == o.parameterized_headers
156
+ end
157
+
158
+ # @see the `==` method
159
+ # @param [Object] Object to be compared
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculates hash code according to all attributes.
165
+ # @return [Integer] Hash code
166
+ def hash
167
+ [content_disposition, entity, headers, media_type, message_body_workers, parent, providers, body_parts, parameterized_headers].hash
168
+ end
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def self.build_from_hash(attributes)
174
+ new.build_from_hash(attributes)
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ self.class.openapi_types.each_pair do |key, type|
183
+ if type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :DateTime
204
+ DateTime.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :Boolean
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ DependencyTracker.const_get(type).build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+ end
284
+ end