cyber_trackr_live 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 (38) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG-GEM.md +47 -0
  3. data/CODE_OF_CONDUCT.md +20 -0
  4. data/CONTRIBUTING.md +422 -0
  5. data/LICENSE.md +16 -0
  6. data/NOTICE.md +16 -0
  7. data/README-GEM.md +75 -0
  8. data/SECURITY.md +86 -0
  9. data/cyber_trackr_live.gemspec +56 -0
  10. data/examples/cyber_trackr_client.rb +208 -0
  11. data/examples/fetch-complete-stig +174 -0
  12. data/examples/fetch-stig-complete +67 -0
  13. data/examples/fetch-stig-direct +99 -0
  14. data/examples/use_helper.rb +50 -0
  15. data/lib/cyber_trackr_client/api/api_documentation_api.rb +79 -0
  16. data/lib/cyber_trackr_client/api/cci_api.rb +147 -0
  17. data/lib/cyber_trackr_client/api/documents_api.rb +276 -0
  18. data/lib/cyber_trackr_client/api/rmf_controls_api.rb +272 -0
  19. data/lib/cyber_trackr_client/api/scap_api.rb +276 -0
  20. data/lib/cyber_trackr_client/api_client.rb +437 -0
  21. data/lib/cyber_trackr_client/api_error.rb +58 -0
  22. data/lib/cyber_trackr_client/configuration.rb +400 -0
  23. data/lib/cyber_trackr_client/models/api_documentation.rb +238 -0
  24. data/lib/cyber_trackr_client/models/assessment_procedure.rb +321 -0
  25. data/lib/cyber_trackr_client/models/cci_detail.rb +391 -0
  26. data/lib/cyber_trackr_client/models/document_detail.rb +434 -0
  27. data/lib/cyber_trackr_client/models/document_version.rb +385 -0
  28. data/lib/cyber_trackr_client/models/error.rb +313 -0
  29. data/lib/cyber_trackr_client/models/requirement_detail.rb +580 -0
  30. data/lib/cyber_trackr_client/models/requirement_summary.rb +360 -0
  31. data/lib/cyber_trackr_client/models/rmf_control_detail.rb +436 -0
  32. data/lib/cyber_trackr_client/models/rmf_control_list.rb +241 -0
  33. data/lib/cyber_trackr_client/version.rb +15 -0
  34. data/lib/cyber_trackr_client.rb +54 -0
  35. data/lib/cyber_trackr_helper.rb +269 -0
  36. data/lib/rubocop/cop/cyber_trackr_api/README.md +81 -0
  37. data/openapi/openapi.yaml +798 -0
  38. metadata +271 -0
@@ -0,0 +1,436 @@
1
+ =begin
2
+ #Cyber Trackr API
3
+
4
+ #Complete OpenAPI 3.1.1 specification for cyber.trackr.live API. This API provides access to DISA STIGs, SRGs, RMF controls, CCIs, and SCAP data. ## DISA Cybersecurity Ecosystem Hierarchy ``` NIST RMF Controls (high-level policy framework) ↓ (decomposed into atomic, testable statements) CCIs (Control Correlation Identifiers - bridge policy to implementation) ↓ (grouped by technology class into generic requirements) SRGs (Security Requirements Guides - technology class \"what\" to do) ↓ (implemented as vendor-specific \"how\" to do it) STIGs (Security Technical Implementation Guides - vendor/product specific) ↓ (automated versions for scanning tools) SCAP (Security Content Automation Protocol documents) ``` ## Critical Relationships - **RMF Controls** contain assessment procedures that reference **CCIs** - **CCIs** map back to **RMF Controls** and forward to **STIG/SRG requirements** - **SRGs** define generic technology requirements that **STIGs** implement specifically - **V-IDs** can appear in both SRG and corresponding STIG (same requirement, different specificity) - **SV-IDs** are XCCDF rule identifiers with revision tracking across document releases
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module CyberTrackrClient
17
+ # Complete RMF control details with CCI mappings
18
+ class RmfControlDetail
19
+ attr_accessor :number
20
+
21
+ attr_accessor :title
22
+
23
+ attr_accessor :family
24
+
25
+ attr_accessor :baseline
26
+
27
+ attr_accessor :statements
28
+
29
+ attr_accessor :assessment_procedures
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'number' => :'number',
57
+ :'title' => :'title',
58
+ :'family' => :'family',
59
+ :'baseline' => :'baseline',
60
+ :'statements' => :'statements',
61
+ :'assessment_procedures' => :'assessment_procedures'
62
+ }
63
+ end
64
+
65
+ # Returns attribute mapping this model knows about
66
+ def self.acceptable_attribute_map
67
+ attribute_map
68
+ end
69
+
70
+ # Returns all the JSON keys this model knows about
71
+ def self.acceptable_attributes
72
+ acceptable_attribute_map.values
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'number' => :'String',
79
+ :'title' => :'String',
80
+ :'family' => :'String',
81
+ :'baseline' => :'Array<String>',
82
+ :'statements' => :'String',
83
+ :'assessment_procedures' => :'Array<AssessmentProcedure>'
84
+ }
85
+ end
86
+
87
+ # List of attributes with nullable: true
88
+ def self.openapi_nullable
89
+ Set.new([
90
+ ])
91
+ end
92
+
93
+ # Initializes the object
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ def initialize(attributes = {})
96
+ if (!attributes.is_a?(Hash))
97
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CyberTrackrClient::RmfControlDetail` initialize method"
98
+ end
99
+
100
+ # check to see if the attribute exists and convert string to symbol for hash key
101
+ acceptable_attribute_map = self.class.acceptable_attribute_map
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!acceptable_attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CyberTrackrClient::RmfControlDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'number')
110
+ self.number = attributes[:'number']
111
+ else
112
+ self.number = nil
113
+ end
114
+
115
+ if attributes.key?(:'title')
116
+ self.title = attributes[:'title']
117
+ else
118
+ self.title = nil
119
+ end
120
+
121
+ if attributes.key?(:'family')
122
+ self.family = attributes[:'family']
123
+ else
124
+ self.family = nil
125
+ end
126
+
127
+ if attributes.key?(:'baseline')
128
+ if (value = attributes[:'baseline']).is_a?(Array)
129
+ self.baseline = value
130
+ end
131
+ else
132
+ self.baseline = nil
133
+ end
134
+
135
+ if attributes.key?(:'statements')
136
+ self.statements = attributes[:'statements']
137
+ else
138
+ self.statements = nil
139
+ end
140
+
141
+ if attributes.key?(:'assessment_procedures')
142
+ if (value = attributes[:'assessment_procedures']).is_a?(Array)
143
+ self.assessment_procedures = value
144
+ end
145
+ else
146
+ self.assessment_procedures = nil
147
+ end
148
+ end
149
+
150
+ # Show invalid properties with the reasons. Usually used together with valid?
151
+ # @return Array for valid properties with the reasons
152
+ def list_invalid_properties
153
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
154
+ invalid_properties = Array.new
155
+ if @number.nil?
156
+ invalid_properties.push('invalid value for "number", number cannot be nil.')
157
+ end
158
+
159
+ pattern = Regexp.new(/^[A-Z]+-\d+$/)
160
+ if @number !~ pattern
161
+ invalid_properties.push("invalid value for \"number\", must conform to the pattern #{pattern}.")
162
+ end
163
+
164
+ if @title.nil?
165
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
166
+ end
167
+
168
+ if @title.to_s.length < 1
169
+ invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.')
170
+ end
171
+
172
+ if @family.nil?
173
+ invalid_properties.push('invalid value for "family", family cannot be nil.')
174
+ end
175
+
176
+ if @family.to_s.length < 1
177
+ invalid_properties.push('invalid value for "family", the character length must be greater than or equal to 1.')
178
+ end
179
+
180
+ if @baseline.nil?
181
+ invalid_properties.push('invalid value for "baseline", baseline cannot be nil.')
182
+ end
183
+
184
+ if @baseline.length < 1
185
+ invalid_properties.push('invalid value for "baseline", number of items must be greater than or equal to 1.')
186
+ end
187
+
188
+ if @statements.nil?
189
+ invalid_properties.push('invalid value for "statements", statements cannot be nil.')
190
+ end
191
+
192
+ if @statements.to_s.length < 1
193
+ invalid_properties.push('invalid value for "statements", the character length must be greater than or equal to 1.')
194
+ end
195
+
196
+ if @assessment_procedures.nil?
197
+ invalid_properties.push('invalid value for "assessment_procedures", assessment_procedures cannot be nil.')
198
+ end
199
+
200
+ if @assessment_procedures.length < 1
201
+ invalid_properties.push('invalid value for "assessment_procedures", number of items must be greater than or equal to 1.')
202
+ end
203
+
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ warn '[DEPRECATED] the `valid?` method is obsolete'
211
+ return false if @number.nil?
212
+ return false if @number !~ Regexp.new(/^[A-Z]+-\d+$/)
213
+ return false if @title.nil?
214
+ return false if @title.to_s.length < 1
215
+ return false if @family.nil?
216
+ return false if @family.to_s.length < 1
217
+ return false if @baseline.nil?
218
+ return false if @baseline.length < 1
219
+ return false if @statements.nil?
220
+ return false if @statements.to_s.length < 1
221
+ return false if @assessment_procedures.nil?
222
+ return false if @assessment_procedures.length < 1
223
+ true
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] number Value to be assigned
228
+ def number=(number)
229
+ if number.nil?
230
+ fail ArgumentError, 'number cannot be nil'
231
+ end
232
+
233
+ pattern = Regexp.new(/^[A-Z]+-\d+$/)
234
+ if number !~ pattern
235
+ fail ArgumentError, "invalid value for \"number\", must conform to the pattern #{pattern}."
236
+ end
237
+
238
+ @number = number
239
+ end
240
+
241
+ # Custom attribute writer method with validation
242
+ # @param [Object] title Value to be assigned
243
+ def title=(title)
244
+ if title.nil?
245
+ fail ArgumentError, 'title cannot be nil'
246
+ end
247
+
248
+ if title.to_s.length < 1
249
+ fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 1.'
250
+ end
251
+
252
+ @title = title
253
+ end
254
+
255
+ # Custom attribute writer method with validation
256
+ # @param [Object] family Value to be assigned
257
+ def family=(family)
258
+ if family.nil?
259
+ fail ArgumentError, 'family cannot be nil'
260
+ end
261
+
262
+ if family.to_s.length < 1
263
+ fail ArgumentError, 'invalid value for "family", the character length must be greater than or equal to 1.'
264
+ end
265
+
266
+ @family = family
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] statements Value to be assigned
271
+ def statements=(statements)
272
+ if statements.nil?
273
+ fail ArgumentError, 'statements cannot be nil'
274
+ end
275
+
276
+ if statements.to_s.length < 1
277
+ fail ArgumentError, 'invalid value for "statements", the character length must be greater than or equal to 1.'
278
+ end
279
+
280
+ @statements = statements
281
+ end
282
+
283
+ # Custom attribute writer method with validation
284
+ # @param [Object] assessment_procedures Value to be assigned
285
+ def assessment_procedures=(assessment_procedures)
286
+ if assessment_procedures.nil?
287
+ fail ArgumentError, 'assessment_procedures cannot be nil'
288
+ end
289
+
290
+ if assessment_procedures.length < 1
291
+ fail ArgumentError, 'invalid value for "assessment_procedures", number of items must be greater than or equal to 1.'
292
+ end
293
+
294
+ @assessment_procedures = assessment_procedures
295
+ end
296
+
297
+ # Checks equality by comparing each attribute.
298
+ # @param [Object] Object to be compared
299
+ def ==(o)
300
+ return true if self.equal?(o)
301
+ self.class == o.class &&
302
+ number == o.number &&
303
+ title == o.title &&
304
+ family == o.family &&
305
+ baseline == o.baseline &&
306
+ statements == o.statements &&
307
+ assessment_procedures == o.assessment_procedures
308
+ end
309
+
310
+ # @see the `==` method
311
+ # @param [Object] Object to be compared
312
+ def eql?(o)
313
+ self == o
314
+ end
315
+
316
+ # Calculates hash code according to all attributes.
317
+ # @return [Integer] Hash code
318
+ def hash
319
+ [number, title, family, baseline, statements, assessment_procedures].hash
320
+ end
321
+
322
+ # Builds the object from hash
323
+ # @param [Hash] attributes Model attributes in the form of hash
324
+ # @return [Object] Returns the model itself
325
+ def self.build_from_hash(attributes)
326
+ return nil unless attributes.is_a?(Hash)
327
+ attributes = attributes.transform_keys(&:to_sym)
328
+ transformed_hash = {}
329
+ openapi_types.each_pair do |key, type|
330
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
331
+ transformed_hash["#{key}"] = nil
332
+ elsif type =~ /\AArray<(.*)>/i
333
+ # check to ensure the input is an array given that the attribute
334
+ # is documented as an array but the input is not
335
+ if attributes[attribute_map[key]].is_a?(Array)
336
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
337
+ end
338
+ elsif !attributes[attribute_map[key]].nil?
339
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
340
+ end
341
+ end
342
+ new(transformed_hash)
343
+ end
344
+
345
+ # Deserializes the data based on type
346
+ # @param string type Data type
347
+ # @param string value Value to be deserialized
348
+ # @return [Object] Deserialized data
349
+ def self._deserialize(type, value)
350
+ case type.to_sym
351
+ when :Time
352
+ Time.parse(value)
353
+ when :Date
354
+ Date.parse(value)
355
+ when :String
356
+ value.to_s
357
+ when :Integer
358
+ value.to_i
359
+ when :Float
360
+ value.to_f
361
+ when :Boolean
362
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
363
+ true
364
+ else
365
+ false
366
+ end
367
+ when :Object
368
+ # generic object (usually a Hash), return directly
369
+ value
370
+ when /\AArray<(?<inner_type>.+)>\z/
371
+ inner_type = Regexp.last_match[:inner_type]
372
+ value.map { |v| _deserialize(inner_type, v) }
373
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
374
+ k_type = Regexp.last_match[:k_type]
375
+ v_type = Regexp.last_match[:v_type]
376
+ {}.tap do |hash|
377
+ value.each do |k, v|
378
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
379
+ end
380
+ end
381
+ else # model
382
+ # models (e.g. Pet) or oneOf
383
+ klass = CyberTrackrClient.const_get(type)
384
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
385
+ end
386
+ end
387
+
388
+ # Returns the string representation of the object
389
+ # @return [String] String presentation of the object
390
+ def to_s
391
+ to_hash.to_s
392
+ end
393
+
394
+ # to_body is an alias to to_hash (backward compatibility)
395
+ # @return [Hash] Returns the object in the form of hash
396
+ def to_body
397
+ to_hash
398
+ end
399
+
400
+ # Returns the object in the form of hash
401
+ # @return [Hash] Returns the object in the form of hash
402
+ def to_hash
403
+ hash = {}
404
+ self.class.attribute_map.each_pair do |attr, param|
405
+ value = self.send(attr)
406
+ if value.nil?
407
+ is_nullable = self.class.openapi_nullable.include?(attr)
408
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
409
+ end
410
+
411
+ hash[param] = _to_hash(value)
412
+ end
413
+ hash
414
+ end
415
+
416
+ # Outputs non-array value in the form of hash
417
+ # For object, use to_hash. Otherwise, just return the value
418
+ # @param [Object] value Any valid value
419
+ # @return [Hash] Returns the value in the form of hash
420
+ def _to_hash(value)
421
+ if value.is_a?(Array)
422
+ value.compact.map { |v| _to_hash(v) }
423
+ elsif value.is_a?(Hash)
424
+ {}.tap do |hash|
425
+ value.each { |k, v| hash[k] = _to_hash(v) }
426
+ end
427
+ elsif value.respond_to? :to_hash
428
+ value.to_hash
429
+ else
430
+ value
431
+ end
432
+ end
433
+
434
+ end
435
+
436
+ end
@@ -0,0 +1,241 @@
1
+ =begin
2
+ #Cyber Trackr API
3
+
4
+ #Complete OpenAPI 3.1.1 specification for cyber.trackr.live API. This API provides access to DISA STIGs, SRGs, RMF controls, CCIs, and SCAP data. ## DISA Cybersecurity Ecosystem Hierarchy ``` NIST RMF Controls (high-level policy framework) ↓ (decomposed into atomic, testable statements) CCIs (Control Correlation Identifiers - bridge policy to implementation) ↓ (grouped by technology class into generic requirements) SRGs (Security Requirements Guides - technology class \"what\" to do) ↓ (implemented as vendor-specific \"how\" to do it) STIGs (Security Technical Implementation Guides - vendor/product specific) ↓ (automated versions for scanning tools) SCAP (Security Content Automation Protocol documents) ``` ## Critical Relationships - **RMF Controls** contain assessment procedures that reference **CCIs** - **CCIs** map back to **RMF Controls** and forward to **STIG/SRG requirements** - **SRGs** define generic technology requirements that **STIGs** implement specifically - **V-IDs** can appear in both SRG and corresponding STIG (same requirement, different specificity) - **SV-IDs** are XCCDF rule identifiers with revision tracking across document releases
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module CyberTrackrClient
17
+ # List of RMF controls with titles
18
+ class RmfControlList
19
+ # RMF controls mapped to titles
20
+ attr_accessor :controls
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'controls' => :'controls'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'controls' => :'Hash<String, String>'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CyberTrackrClient::RmfControlList` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CyberTrackrClient::RmfControlList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'controls')
69
+ if (value = attributes[:'controls']).is_a?(Hash)
70
+ self.controls = value
71
+ end
72
+ else
73
+ self.controls = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @controls.nil?
83
+ invalid_properties.push('invalid value for "controls", controls cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if @controls.nil?
94
+ true
95
+ end
96
+
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] controls Value to be assigned
99
+ def controls=(controls)
100
+ if controls.nil?
101
+ fail ArgumentError, 'controls cannot be nil'
102
+ end
103
+
104
+ @controls = controls
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ controls == o.controls
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [controls].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def self._deserialize(type, value)
155
+ case type.to_sym
156
+ when :Time
157
+ Time.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ # models (e.g. Pet) or oneOf
188
+ klass = CyberTrackrClient.const_get(type)
189
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end
238
+
239
+ end
240
+
241
+ end
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #Cyber Trackr API
3
+
4
+ #Complete OpenAPI 3.1.1 specification for cyber.trackr.live API. This API provides access to DISA STIGs, SRGs, RMF controls, CCIs, and SCAP data. ## DISA Cybersecurity Ecosystem Hierarchy ``` NIST RMF Controls (high-level policy framework) ↓ (decomposed into atomic, testable statements) CCIs (Control Correlation Identifiers - bridge policy to implementation) ↓ (grouped by technology class into generic requirements) SRGs (Security Requirements Guides - technology class \"what\" to do) ↓ (implemented as vendor-specific \"how\" to do it) STIGs (Security Technical Implementation Guides - vendor/product specific) ↓ (automated versions for scanning tools) SCAP (Security Content Automation Protocol documents) ``` ## Critical Relationships - **RMF Controls** contain assessment procedures that reference **CCIs** - **CCIs** map back to **RMF Controls** and forward to **STIG/SRG requirements** - **SRGs** define generic technology requirements that **STIGs** implement specifically - **V-IDs** can appear in both SRG and corresponding STIG (same requirement, different specificity) - **SV-IDs** are XCCDF rule identifiers with revision tracking across document releases
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ module CyberTrackrClient
14
+ VERSION = '1.0.0'
15
+ end