emass_client 3.10.1 → 3.22.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 (208) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +174 -131
  3. data/lib/emass_client/api/artifacts_api.rb +47 -52
  4. data/lib/emass_client/api/artifacts_export_api.rb +5 -5
  5. data/lib/emass_client/api/cac_api.rb +12 -12
  6. data/lib/emass_client/api/cloud_resource_results_api.rb +83 -9
  7. data/lib/emass_client/api/cmmc_assessment_dashboards_api.rb +314 -0
  8. data/lib/emass_client/api/cmmc_assessments_api.rb +5 -5
  9. data/lib/emass_client/api/coast_guard_system_fisma_metrics_dashboard_api.rb +95 -0
  10. data/lib/emass_client/api/container_scan_results_api.rb +83 -9
  11. data/lib/emass_client/api/controls_api.rb +17 -17
  12. data/lib/emass_client/api/device_scan_results_api.rb +112 -0
  13. data/lib/emass_client/api/hardware_baseline_api.rb +313 -0
  14. data/lib/emass_client/api/milestones_api.rb +18 -18
  15. data/lib/emass_client/api/organization_migration_status_dashboard_api.rb +95 -0
  16. data/lib/emass_client/api/pac_api.rb +16 -16
  17. data/lib/emass_client/api/poam_api.rb +47 -44
  18. data/lib/emass_client/api/registration_api.rb +5 -5
  19. data/lib/emass_client/api/software_baseline_api.rb +313 -0
  20. data/lib/emass_client/api/static_code_scans_api.rb +9 -9
  21. data/lib/emass_client/api/system_application_findings_dashboards_api.rb +168 -0
  22. data/lib/emass_client/api/system_artifacts_dashboards_api.rb +168 -0
  23. data/lib/emass_client/api/system_associations_dashboard_api.rb +95 -0
  24. data/lib/emass_client/api/system_atciatc_dashboard_api.rb +95 -0
  25. data/lib/emass_client/api/system_conmon_integration_status_dashboard_api.rb +95 -0
  26. data/lib/emass_client/api/system_connectivity_ccsd_dashboards_api.rb +168 -0
  27. data/lib/emass_client/api/system_critical_assets_dashboard_api.rb +95 -0
  28. data/lib/emass_client/api/system_device_findings_dashboards_api.rb +168 -0
  29. data/lib/emass_client/api/system_fisma_metrics_dashboard_api.rb +95 -0
  30. data/lib/emass_client/api/system_hardware_dashboards_api.rb +168 -0
  31. data/lib/emass_client/api/system_migration_status_dashboard_api.rb +95 -0
  32. data/lib/emass_client/api/system_poam_dashboards_api.rb +168 -0
  33. data/lib/emass_client/api/system_ports_protocols_dashboards_api.rb +168 -0
  34. data/lib/emass_client/api/system_privacy_dashboard_api.rb +95 -0
  35. data/lib/emass_client/api/system_questionnaire_dashboards_api.rb +168 -0
  36. data/lib/emass_client/api/system_roles_api.rb +8 -16
  37. data/lib/emass_client/api/system_security_controls_dashboards_api.rb +241 -0
  38. data/lib/emass_client/api/system_sensor_hardware_dashboards_api.rb +168 -0
  39. data/lib/emass_client/api/system_sensor_software_dashboards_api.rb +241 -0
  40. data/lib/emass_client/api/system_software_dashboards_api.rb +168 -0
  41. data/lib/emass_client/api/system_status_dashboard_api.rb +95 -0
  42. data/lib/emass_client/api/system_terms_conditions_dashboards_api.rb +168 -0
  43. data/lib/emass_client/api/system_vulnerability_dashboard_api.rb +95 -0
  44. data/lib/emass_client/api/system_workflows_dashboards_api.rb +241 -0
  45. data/lib/emass_client/api/systems_api.rb +22 -28
  46. data/lib/emass_client/api/test_api.rb +5 -5
  47. data/lib/emass_client/api/test_results_api.rb +19 -16
  48. data/lib/emass_client/api/user_system_assignments_dashboard_api.rb +95 -0
  49. data/lib/emass_client/api/va_system_dashboards_api.rb +679 -0
  50. data/lib/emass_client/api/vaombfisma_dashboard_api.rb +95 -0
  51. data/lib/emass_client/api/workflow_definitions_api.rb +9 -9
  52. data/lib/emass_client/api/workflow_instances_api.rb +17 -14
  53. data/lib/emass_client/api_client.rb +46 -32
  54. data/lib/emass_client/api_error.rb +4 -4
  55. data/lib/emass_client/configuration.rb +42 -12
  56. data/lib/emass_client/models/{response201.rb → api_rule_failed.rb} +29 -28
  57. data/lib/emass_client/models/{response490_meta.rb → api_rule_failed_meta.rb} +34 -29
  58. data/lib/emass_client/models/artifacts_ids.rb +221 -0
  59. data/lib/emass_client/models/artifacts_optional_fields.rb +298 -0
  60. data/lib/emass_client/models/artifacts_read_only_fields.rb +255 -0
  61. data/lib/emass_client/models/artifacts_request_delete_body_inner.rb +26 -25
  62. data/lib/emass_client/models/artifacts_required_fields.rb +252 -0
  63. data/lib/emass_client/models/artifacts_response_del.rb +26 -25
  64. data/lib/emass_client/models/artifacts_response_del_data_inner.rb +26 -25
  65. data/lib/emass_client/models/artifacts_response_get.rb +27 -26
  66. data/lib/emass_client/models/{artifacts_get.rb → artifacts_response_get_data_inner.rb} +91 -70
  67. data/lib/emass_client/models/artifacts_response_put_post.rb +26 -25
  68. data/lib/emass_client/models/artifacts_response_put_post_data_inner.rb +40 -30
  69. data/lib/emass_client/models/{response403.rb → bad_request.rb} +29 -28
  70. data/lib/emass_client/models/{response400_meta.rb → bad_request_meta.rb} +34 -29
  71. data/lib/emass_client/models/cac_get.rb +26 -25
  72. data/lib/emass_client/models/cac_response_get.rb +26 -25
  73. data/lib/emass_client/models/cac_response_post.rb +26 -25
  74. data/lib/emass_client/models/cac_response_post_data_inner.rb +40 -30
  75. data/lib/emass_client/models/{poam_response_post.rb → cloud_resources_delete.rb} +29 -28
  76. data/lib/emass_client/models/cloud_resources_delete_body_inner.rb +221 -0
  77. data/lib/emass_client/models/{cloud_resources_post.rb → cloud_resources_post_delete.rb} +42 -32
  78. data/lib/emass_client/models/cloud_resources_response_post.rb +27 -26
  79. data/lib/emass_client/models/cmmc_get.rb +96 -140
  80. data/lib/emass_client/models/cmmc_response_get.rb +26 -25
  81. data/lib/emass_client/models/connectivity_ccsd.rb +26 -25
  82. data/lib/emass_client/models/container_resources_delete_body_inner.rb +221 -0
  83. data/lib/emass_client/models/{containers_resources_post.rb → containers_resources_post_delete.rb} +42 -32
  84. data/lib/emass_client/models/{poam_response_delete.rb → containers_response_delete.rb} +29 -28
  85. data/lib/emass_client/models/containers_response_post.rb +27 -26
  86. data/lib/emass_client/models/controls_conditional_fields.rb +357 -0
  87. data/lib/emass_client/models/controls_ids.rb +221 -0
  88. data/lib/emass_client/models/controls_optional_fields.rb +471 -0
  89. data/lib/emass_client/models/controls_put.rb +40 -30
  90. data/lib/emass_client/models/controls_read_only_fields.rb +277 -0
  91. data/lib/emass_client/models/controls_required_fields.rb +295 -0
  92. data/lib/emass_client/models/controls_response_get.rb +27 -26
  93. data/lib/emass_client/models/{controls_get.rb → controls_response_get_data_inner.rb} +210 -166
  94. data/lib/emass_client/models/controls_response_put.rb +26 -25
  95. data/lib/emass_client/models/{response400.rb → created.rb} +29 -28
  96. data/lib/emass_client/models/{response201_meta.rb → created_meta.rb} +34 -29
  97. data/lib/emass_client/models/definition_transitions.rb +26 -25
  98. data/lib/emass_client/models/{success200_response.rb → device_scan_results_response_post.rb} +29 -28
  99. data/lib/emass_client/models/{success200_response_data_inner.rb → device_scan_results_response_post_data_inner.rb} +72 -33
  100. data/lib/emass_client/models/{response401.rb → forbidden.rb} +29 -28
  101. data/lib/emass_client/models/{response403_meta.rb → forbidden_meta.rb} +34 -29
  102. data/lib/emass_client/models/get_system_status_details200_response.rb +240 -0
  103. data/lib/emass_client/models/hw_baseline_conditional_fields.rb +244 -0
  104. data/lib/emass_client/models/hw_baseline_ids.rb +221 -0
  105. data/lib/emass_client/models/hw_baseline_optional_fields.rb +354 -0
  106. data/lib/emass_client/models/hw_baseline_read_only_fields.rb +222 -0
  107. data/lib/emass_client/models/hw_baseline_request_delete_body_inner.rb +220 -0
  108. data/lib/emass_client/models/hw_baseline_required_fields.rb +221 -0
  109. data/lib/emass_client/models/hw_baseline_response_delete.rb +231 -0
  110. data/lib/emass_client/models/hw_baseline_response_delete_data_inner.rb +274 -0
  111. data/lib/emass_client/models/{dashboard_mock_response.rb → hw_baseline_response_get.rb} +30 -29
  112. data/lib/emass_client/models/hw_baseline_response_get_data_inner.rb +429 -0
  113. data/lib/emass_client/models/hw_baseline_response_post_put.rb +231 -0
  114. data/lib/emass_client/models/hw_baseline_response_post_put_data_inner.rb +274 -0
  115. data/lib/emass_client/models/{instances_transitions.rb → instance_transitions.rb} +28 -27
  116. data/lib/emass_client/models/internal_server_error.rb +220 -0
  117. data/lib/emass_client/models/{response500_meta.rb → internal_server_error_meta.rb} +34 -29
  118. data/lib/emass_client/models/length_required.rb +220 -0
  119. data/lib/emass_client/models/{response411_meta.rb → length_required_meta.rb} +34 -29
  120. data/lib/emass_client/models/method_not_allowed.rb +220 -0
  121. data/lib/emass_client/models/{response405_meta.rb → method_not_allowed_meta.rb} +34 -29
  122. data/lib/emass_client/models/milestone_response_delete.rb +231 -0
  123. data/lib/emass_client/models/milestone_response_get.rb +26 -25
  124. data/lib/emass_client/models/milestone_response_get_milestone.rb +26 -25
  125. data/lib/emass_client/models/milestone_response_post.rb +26 -25
  126. data/lib/emass_client/models/milestone_response_put.rb +26 -25
  127. data/lib/emass_client/models/milestones_fields.rb +222 -0
  128. data/lib/emass_client/models/milestones_get.rb +55 -32
  129. data/lib/emass_client/models/milestones_put_post_delete.rb +40 -30
  130. data/lib/emass_client/models/milestones_request_delete_body_inner.rb +26 -25
  131. data/lib/emass_client/models/milestones_required_post.rb +35 -53
  132. data/lib/emass_client/models/milestones_required_post_milestones_inner.rb +265 -0
  133. data/lib/emass_client/models/milestones_required_put.rb +35 -68
  134. data/lib/emass_client/models/{ssps.rb → milestones_required_put_milestones_inner.rb} +101 -52
  135. data/lib/emass_client/models/{response404.rb → not_found.rb} +34 -29
  136. data/lib/emass_client/models/pac_get.rb +29 -37
  137. data/lib/emass_client/models/pac_post.rb +40 -30
  138. data/lib/emass_client/models/pac_response_get.rb +26 -25
  139. data/lib/emass_client/models/pac_response_post.rb +26 -25
  140. data/lib/emass_client/models/{dashboard_mock_response_pagination.rb → pagination.rb} +47 -46
  141. data/lib/emass_client/models/poam_conditional_fields.rb +402 -0
  142. data/lib/emass_client/models/poam_ids.rb +241 -0
  143. data/lib/emass_client/models/poam_optional_fields.rb +409 -0
  144. data/lib/emass_client/models/poam_post_put_del.rb +40 -30
  145. data/lib/emass_client/models/poam_read_only_fields.rb +332 -0
  146. data/lib/emass_client/models/poam_request_delete_body_inner.rb +26 -25
  147. data/lib/emass_client/models/poam_required_fields.rb +305 -0
  148. data/lib/emass_client/models/poam_response_get_poams.rb +27 -26
  149. data/lib/emass_client/models/poam_response_get_poams_data.rb +824 -0
  150. data/lib/emass_client/models/poam_response_get_systems.rb +27 -26
  151. data/lib/emass_client/models/poam_response_get_systems_data_inner.rb +824 -0
  152. data/lib/emass_client/models/{poam_response_put.rb → poam_response_post_put_delete.rb} +28 -27
  153. data/lib/emass_client/models/register.rb +26 -25
  154. data/lib/emass_client/models/register_data.rb +26 -25
  155. data/lib/emass_client/models/register_user_request_post_body.rb +38 -25
  156. data/lib/emass_client/models/response200.rb +32 -27
  157. data/lib/emass_client/models/role_category.rb +26 -25
  158. data/lib/emass_client/models/roles.rb +26 -25
  159. data/lib/emass_client/models/stage.rb +26 -25
  160. data/lib/emass_client/models/{static_code_application.rb → static_code_application_post.rb} +28 -27
  161. data/lib/emass_client/models/static_code_post.rb +40 -30
  162. data/lib/emass_client/models/static_code_request_post_body.rb +27 -26
  163. data/lib/emass_client/models/static_code_request_post_body_application.rb +26 -25
  164. data/lib/emass_client/models/static_code_response_post.rb +26 -25
  165. data/lib/emass_client/models/sw_baseline_conditional_fields.rb +222 -0
  166. data/lib/emass_client/models/sw_baseline_ids.rb +221 -0
  167. data/lib/emass_client/models/sw_baseline_optional_fields.rb +563 -0
  168. data/lib/emass_client/models/sw_baseline_read_only_fields.rb +222 -0
  169. data/lib/emass_client/models/sw_baseline_request_delete_body_inner.rb +220 -0
  170. data/lib/emass_client/models/sw_baseline_required_fields.rb +241 -0
  171. data/lib/emass_client/models/sw_baseline_response_delete.rb +231 -0
  172. data/lib/emass_client/models/sw_baseline_response_delete_data_inner.rb +274 -0
  173. data/lib/emass_client/models/sw_baseline_response_get.rb +240 -0
  174. data/lib/emass_client/models/sw_baseline_response_get_data_inner.rb +624 -0
  175. data/lib/emass_client/models/sw_baseline_response_post_put.rb +231 -0
  176. data/lib/emass_client/models/sw_baseline_response_post_put_data_inner.rb +274 -0
  177. data/lib/emass_client/models/system_response.rb +26 -25
  178. data/lib/emass_client/models/system_roles_category_response.rb +26 -25
  179. data/lib/emass_client/models/system_roles_response.rb +26 -25
  180. data/lib/emass_client/models/system_roles_response_data_inner.rb +26 -25
  181. data/lib/emass_client/models/systems.rb +950 -113
  182. data/lib/emass_client/models/systems_response.rb +26 -25
  183. data/lib/emass_client/models/test.rb +26 -25
  184. data/lib/emass_client/models/test_data.rb +26 -25
  185. data/lib/emass_client/models/test_results_get.rb +37 -26
  186. data/lib/emass_client/models/test_results_post.rb +40 -30
  187. data/lib/emass_client/models/test_results_response_get.rb +26 -25
  188. data/lib/emass_client/models/test_results_response_post.rb +26 -25
  189. data/lib/emass_client/models/unauthorized.rb +220 -0
  190. data/lib/emass_client/models/{response401_meta.rb → unauthorized_meta.rb} +34 -29
  191. data/lib/emass_client/models/users.rb +26 -25
  192. data/lib/emass_client/models/workflow_definition_get.rb +26 -25
  193. data/lib/emass_client/models/workflow_definition_response_get.rb +26 -25
  194. data/lib/emass_client/models/workflow_instance_get.rb +40 -28
  195. data/lib/emass_client/models/workflow_instance_response_get.rb +26 -25
  196. data/lib/emass_client/models/workflow_instances_response_get.rb +27 -26
  197. data/lib/emass_client/models/workflow_instances_response_get_pagination.rb +26 -25
  198. data/lib/emass_client/version.rb +5 -5
  199. data/lib/emass_client.rb +112 -39
  200. metadata +116 -43
  201. data/lib/emass_client/api/dashboards_api.rb +0 -2139
  202. data/lib/emass_client/models/mock_object.rb +0 -343
  203. data/lib/emass_client/models/poam_get.rb +0 -683
  204. data/lib/emass_client/models/response405.rb +0 -219
  205. data/lib/emass_client/models/response411.rb +0 -219
  206. data/lib/emass_client/models/response490.rb +0 -219
  207. data/lib/emass_client/models/response500.rb +0 -219
  208. data/lib/emass_client/models/workflow_instances_get.rb +0 -342
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #Enterprise Mission Assurance Support Service (eMASS)
3
+
4
+ #The eMASS Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. The eMASS API provides an interface for application to communicate eMASS Services. For information on how to register and use the eMASS API reference the [eMASS API Getting Started](eMASSGettingStarted.md). Additional information about eMASS can be obtain by contacting the National Industrial Security Program (NISP). Points of Contact are:
5
+
6
+ The version of the OpenAPI document: v3.22
7
+ Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module EmassClient
17
+ class ControlsIds
18
+ # [Required] Unique eMASS system identifier.
19
+ attr_accessor :system_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'system_id' => :'systemId'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'system_id' => :'Integer'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::ControlsIds` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::ControlsIds`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'system_id')
68
+ self.system_id = attributes[:'system_id']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ system_id == o.system_id
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [system_id].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def self._deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = EmassClient.const_get(type)
169
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,471 @@
1
+ =begin
2
+ #Enterprise Mission Assurance Support Service (eMASS)
3
+
4
+ #The eMASS Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. The eMASS API provides an interface for application to communicate eMASS Services. For information on how to register and use the eMASS API reference the [eMASS API Getting Started](eMASSGettingStarted.md). Additional information about eMASS can be obtain by contacting the National Industrial Security Program (NISP). Points of Contact are:
5
+
6
+ The version of the OpenAPI document: v3.22
7
+ Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module EmassClient
17
+ class ControlsOptionalFields
18
+ # [Optional] Implementation Status of the Security Control for the information system.
19
+ attr_accessor :implementation_status
20
+
21
+ # [Optional] Values include the following options (Very Low, Low, Moderate,High,Very High)
22
+ attr_accessor :severity
23
+
24
+ # [Optional] Include vulnerability summary. Character Limit = 2,000.
25
+ attr_accessor :vulnerabilty_summary
26
+
27
+ # [Optional] Include recommendations. Character Limit = 2,000.
28
+ attr_accessor :recommendations
29
+
30
+ # [Optional] Values include the following options (Very Low, Low, Moderate,High,Very High)
31
+ attr_accessor :relevance_of_threat
32
+
33
+ # [Optional] Values include the following options (Very Low, Low, Moderate,High,Very High)
34
+ attr_accessor :likelihood
35
+
36
+ # [Optional] Values include the following options (Very Low, Low, Moderate,High,Very High)
37
+ attr_accessor :impact
38
+
39
+ # [Optional] Include description of Security Control's impact.
40
+ attr_accessor :impact_description
41
+
42
+ # [Optional] Values include the following options (Very Low, Low, Moderate,High,Very High)
43
+ attr_accessor :residual_risk_level
44
+
45
+ # [Optional] Identifies the assessment method / combination that will determine if the security requirements are implemented correctly.
46
+ attr_accessor :test_method
47
+
48
+ # [Optional] Identify any mitigations in place for the Non-Compliant Security Control's vulnerabilities. Character Limit = 2,000.
49
+ attr_accessor :mitigations
50
+
51
+ # [Optional] If the Financial Management (Navy) overlay is applied to the system, this field appears and can be populated. Character Limit = 2,000. Navy only.
52
+ attr_accessor :application_layer
53
+
54
+ # [Optional] If the Financial Management (Navy) overlay is applied to the system, this field appears and can be populated. Navy only.
55
+ attr_accessor :database_layer
56
+
57
+ # [Optional] If the Financial Management (Navy) overlay is applied to the system, this field appears and can be populated. Navy only.
58
+ attr_accessor :operating_system_layer
59
+
60
+ class EnumAttributeValidator
61
+ attr_reader :datatype
62
+ attr_reader :allowable_values
63
+
64
+ def initialize(datatype, allowable_values)
65
+ @allowable_values = allowable_values.map do |value|
66
+ case datatype.to_s
67
+ when /Integer/i
68
+ value.to_i
69
+ when /Float/i
70
+ value.to_f
71
+ else
72
+ value
73
+ end
74
+ end
75
+ end
76
+
77
+ def valid?(value)
78
+ !value || allowable_values.include?(value)
79
+ end
80
+ end
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'implementation_status' => :'implementationStatus',
86
+ :'severity' => :'severity',
87
+ :'vulnerabilty_summary' => :'vulnerabiltySummary',
88
+ :'recommendations' => :'recommendations',
89
+ :'relevance_of_threat' => :'relevanceOfThreat',
90
+ :'likelihood' => :'likelihood',
91
+ :'impact' => :'impact',
92
+ :'impact_description' => :'impactDescription',
93
+ :'residual_risk_level' => :'residualRiskLevel',
94
+ :'test_method' => :'testMethod',
95
+ :'mitigations' => :'mitigations',
96
+ :'application_layer' => :'applicationLayer',
97
+ :'database_layer' => :'databaseLayer',
98
+ :'operating_system_layer' => :'operatingSystemLayer'
99
+ }
100
+ end
101
+
102
+ # Returns attribute mapping this model knows about
103
+ def self.acceptable_attribute_map
104
+ attribute_map
105
+ end
106
+
107
+ # Returns all the JSON keys this model knows about
108
+ def self.acceptable_attributes
109
+ acceptable_attribute_map.values
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.openapi_types
114
+ {
115
+ :'implementation_status' => :'String',
116
+ :'severity' => :'String',
117
+ :'vulnerabilty_summary' => :'String',
118
+ :'recommendations' => :'String',
119
+ :'relevance_of_threat' => :'String',
120
+ :'likelihood' => :'String',
121
+ :'impact' => :'String',
122
+ :'impact_description' => :'String',
123
+ :'residual_risk_level' => :'String',
124
+ :'test_method' => :'String',
125
+ :'mitigations' => :'String',
126
+ :'application_layer' => :'String',
127
+ :'database_layer' => :'String',
128
+ :'operating_system_layer' => :'String'
129
+ }
130
+ end
131
+
132
+ # List of attributes with nullable: true
133
+ def self.openapi_nullable
134
+ Set.new([
135
+ :'implementation_status',
136
+ :'severity',
137
+ :'vulnerabilty_summary',
138
+ :'recommendations',
139
+ :'relevance_of_threat',
140
+ :'likelihood',
141
+ :'impact',
142
+ :'impact_description',
143
+ :'residual_risk_level',
144
+ :'test_method',
145
+ :'mitigations',
146
+ :'application_layer',
147
+ :'database_layer',
148
+ :'operating_system_layer'
149
+ ])
150
+ end
151
+
152
+ # Initializes the object
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ def initialize(attributes = {})
155
+ if (!attributes.is_a?(Hash))
156
+ fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::ControlsOptionalFields` initialize method"
157
+ end
158
+
159
+ # check to see if the attribute exists and convert string to symbol for hash key
160
+ acceptable_attribute_map = self.class.acceptable_attribute_map
161
+ attributes = attributes.each_with_object({}) { |(k, v), h|
162
+ if (!acceptable_attribute_map.key?(k.to_sym))
163
+ fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::ControlsOptionalFields`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
164
+ end
165
+ h[k.to_sym] = v
166
+ }
167
+
168
+ if attributes.key?(:'implementation_status')
169
+ self.implementation_status = attributes[:'implementation_status']
170
+ end
171
+
172
+ if attributes.key?(:'severity')
173
+ self.severity = attributes[:'severity']
174
+ end
175
+
176
+ if attributes.key?(:'vulnerabilty_summary')
177
+ self.vulnerabilty_summary = attributes[:'vulnerabilty_summary']
178
+ end
179
+
180
+ if attributes.key?(:'recommendations')
181
+ self.recommendations = attributes[:'recommendations']
182
+ end
183
+
184
+ if attributes.key?(:'relevance_of_threat')
185
+ self.relevance_of_threat = attributes[:'relevance_of_threat']
186
+ end
187
+
188
+ if attributes.key?(:'likelihood')
189
+ self.likelihood = attributes[:'likelihood']
190
+ end
191
+
192
+ if attributes.key?(:'impact')
193
+ self.impact = attributes[:'impact']
194
+ end
195
+
196
+ if attributes.key?(:'impact_description')
197
+ self.impact_description = attributes[:'impact_description']
198
+ end
199
+
200
+ if attributes.key?(:'residual_risk_level')
201
+ self.residual_risk_level = attributes[:'residual_risk_level']
202
+ end
203
+
204
+ if attributes.key?(:'test_method')
205
+ self.test_method = attributes[:'test_method']
206
+ end
207
+
208
+ if attributes.key?(:'mitigations')
209
+ self.mitigations = attributes[:'mitigations']
210
+ end
211
+
212
+ if attributes.key?(:'application_layer')
213
+ self.application_layer = attributes[:'application_layer']
214
+ end
215
+
216
+ if attributes.key?(:'database_layer')
217
+ self.database_layer = attributes[:'database_layer']
218
+ end
219
+
220
+ if attributes.key?(:'operating_system_layer')
221
+ self.operating_system_layer = attributes[:'operating_system_layer']
222
+ end
223
+ end
224
+
225
+ # Show invalid properties with the reasons. Usually used together with valid?
226
+ # @return Array for valid properties with the reasons
227
+ def list_invalid_properties
228
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
229
+ invalid_properties = Array.new
230
+ invalid_properties
231
+ end
232
+
233
+ # Check to see if the all the properties in the model are valid
234
+ # @return true if the model is valid
235
+ def valid?
236
+ warn '[DEPRECATED] the `valid?` method is obsolete'
237
+ implementation_status_validator = EnumAttributeValidator.new('String', ["Planned", "Implemented", "Inherited", "Not Applicable", "Manually Inherited", "unknown_default_open_api"])
238
+ return false unless implementation_status_validator.valid?(@implementation_status)
239
+ severity_validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
240
+ return false unless severity_validator.valid?(@severity)
241
+ relevance_of_threat_validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
242
+ return false unless relevance_of_threat_validator.valid?(@relevance_of_threat)
243
+ likelihood_validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
244
+ return false unless likelihood_validator.valid?(@likelihood)
245
+ impact_validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
246
+ return false unless impact_validator.valid?(@impact)
247
+ residual_risk_level_validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
248
+ return false unless residual_risk_level_validator.valid?(@residual_risk_level)
249
+ test_method_validator = EnumAttributeValidator.new('String', ["Test", "Interview", "Examine", "Test, Interview", "Test, Examine", "Interview, Examine", "Test, Interview, Examine", "unknown_default_open_api"])
250
+ return false unless test_method_validator.valid?(@test_method)
251
+ true
252
+ end
253
+
254
+ # Custom attribute writer method checking allowed values (enum).
255
+ # @param [Object] implementation_status Object to be assigned
256
+ def implementation_status=(implementation_status)
257
+ validator = EnumAttributeValidator.new('String', ["Planned", "Implemented", "Inherited", "Not Applicable", "Manually Inherited", "unknown_default_open_api"])
258
+ unless validator.valid?(implementation_status)
259
+ fail ArgumentError, "invalid value for \"implementation_status\", must be one of #{validator.allowable_values}."
260
+ end
261
+ @implementation_status = implementation_status
262
+ end
263
+
264
+ # Custom attribute writer method checking allowed values (enum).
265
+ # @param [Object] severity Object to be assigned
266
+ def severity=(severity)
267
+ validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
268
+ unless validator.valid?(severity)
269
+ fail ArgumentError, "invalid value for \"severity\", must be one of #{validator.allowable_values}."
270
+ end
271
+ @severity = severity
272
+ end
273
+
274
+ # Custom attribute writer method checking allowed values (enum).
275
+ # @param [Object] relevance_of_threat Object to be assigned
276
+ def relevance_of_threat=(relevance_of_threat)
277
+ validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
278
+ unless validator.valid?(relevance_of_threat)
279
+ fail ArgumentError, "invalid value for \"relevance_of_threat\", must be one of #{validator.allowable_values}."
280
+ end
281
+ @relevance_of_threat = relevance_of_threat
282
+ end
283
+
284
+ # Custom attribute writer method checking allowed values (enum).
285
+ # @param [Object] likelihood Object to be assigned
286
+ def likelihood=(likelihood)
287
+ validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
288
+ unless validator.valid?(likelihood)
289
+ fail ArgumentError, "invalid value for \"likelihood\", must be one of #{validator.allowable_values}."
290
+ end
291
+ @likelihood = likelihood
292
+ end
293
+
294
+ # Custom attribute writer method checking allowed values (enum).
295
+ # @param [Object] impact Object to be assigned
296
+ def impact=(impact)
297
+ validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
298
+ unless validator.valid?(impact)
299
+ fail ArgumentError, "invalid value for \"impact\", must be one of #{validator.allowable_values}."
300
+ end
301
+ @impact = impact
302
+ end
303
+
304
+ # Custom attribute writer method checking allowed values (enum).
305
+ # @param [Object] residual_risk_level Object to be assigned
306
+ def residual_risk_level=(residual_risk_level)
307
+ validator = EnumAttributeValidator.new('String', ["Very Low", "Low", "Moderate", "High", "Very High", "unknown_default_open_api"])
308
+ unless validator.valid?(residual_risk_level)
309
+ fail ArgumentError, "invalid value for \"residual_risk_level\", must be one of #{validator.allowable_values}."
310
+ end
311
+ @residual_risk_level = residual_risk_level
312
+ end
313
+
314
+ # Custom attribute writer method checking allowed values (enum).
315
+ # @param [Object] test_method Object to be assigned
316
+ def test_method=(test_method)
317
+ validator = EnumAttributeValidator.new('String', ["Test", "Interview", "Examine", "Test, Interview", "Test, Examine", "Interview, Examine", "Test, Interview, Examine", "unknown_default_open_api"])
318
+ unless validator.valid?(test_method)
319
+ fail ArgumentError, "invalid value for \"test_method\", must be one of #{validator.allowable_values}."
320
+ end
321
+ @test_method = test_method
322
+ end
323
+
324
+ # Checks equality by comparing each attribute.
325
+ # @param [Object] Object to be compared
326
+ def ==(o)
327
+ return true if self.equal?(o)
328
+ self.class == o.class &&
329
+ implementation_status == o.implementation_status &&
330
+ severity == o.severity &&
331
+ vulnerabilty_summary == o.vulnerabilty_summary &&
332
+ recommendations == o.recommendations &&
333
+ relevance_of_threat == o.relevance_of_threat &&
334
+ likelihood == o.likelihood &&
335
+ impact == o.impact &&
336
+ impact_description == o.impact_description &&
337
+ residual_risk_level == o.residual_risk_level &&
338
+ test_method == o.test_method &&
339
+ mitigations == o.mitigations &&
340
+ application_layer == o.application_layer &&
341
+ database_layer == o.database_layer &&
342
+ operating_system_layer == o.operating_system_layer
343
+ end
344
+
345
+ # @see the `==` method
346
+ # @param [Object] Object to be compared
347
+ def eql?(o)
348
+ self == o
349
+ end
350
+
351
+ # Calculates hash code according to all attributes.
352
+ # @return [Integer] Hash code
353
+ def hash
354
+ [implementation_status, severity, vulnerabilty_summary, recommendations, relevance_of_threat, likelihood, impact, impact_description, residual_risk_level, test_method, mitigations, application_layer, database_layer, operating_system_layer].hash
355
+ end
356
+
357
+ # Builds the object from hash
358
+ # @param [Hash] attributes Model attributes in the form of hash
359
+ # @return [Object] Returns the model itself
360
+ def self.build_from_hash(attributes)
361
+ return nil unless attributes.is_a?(Hash)
362
+ attributes = attributes.transform_keys(&:to_sym)
363
+ transformed_hash = {}
364
+ openapi_types.each_pair do |key, type|
365
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
366
+ transformed_hash["#{key}"] = nil
367
+ elsif type =~ /\AArray<(.*)>/i
368
+ # check to ensure the input is an array given that the attribute
369
+ # is documented as an array but the input is not
370
+ if attributes[attribute_map[key]].is_a?(Array)
371
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
372
+ end
373
+ elsif !attributes[attribute_map[key]].nil?
374
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
375
+ end
376
+ end
377
+ new(transformed_hash)
378
+ end
379
+
380
+ # Deserializes the data based on type
381
+ # @param string type Data type
382
+ # @param string value Value to be deserialized
383
+ # @return [Object] Deserialized data
384
+ def self._deserialize(type, value)
385
+ case type.to_sym
386
+ when :Time
387
+ Time.parse(value)
388
+ when :Date
389
+ Date.parse(value)
390
+ when :String
391
+ value.to_s
392
+ when :Integer
393
+ value.to_i
394
+ when :Float
395
+ value.to_f
396
+ when :Boolean
397
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
398
+ true
399
+ else
400
+ false
401
+ end
402
+ when :Object
403
+ # generic object (usually a Hash), return directly
404
+ value
405
+ when /\AArray<(?<inner_type>.+)>\z/
406
+ inner_type = Regexp.last_match[:inner_type]
407
+ value.map { |v| _deserialize(inner_type, v) }
408
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
409
+ k_type = Regexp.last_match[:k_type]
410
+ v_type = Regexp.last_match[:v_type]
411
+ {}.tap do |hash|
412
+ value.each do |k, v|
413
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
414
+ end
415
+ end
416
+ else # model
417
+ # models (e.g. Pet) or oneOf
418
+ klass = EmassClient.const_get(type)
419
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
420
+ end
421
+ end
422
+
423
+ # Returns the string representation of the object
424
+ # @return [String] String presentation of the object
425
+ def to_s
426
+ to_hash.to_s
427
+ end
428
+
429
+ # to_body is an alias to to_hash (backward compatibility)
430
+ # @return [Hash] Returns the object in the form of hash
431
+ def to_body
432
+ to_hash
433
+ end
434
+
435
+ # Returns the object in the form of hash
436
+ # @return [Hash] Returns the object in the form of hash
437
+ def to_hash
438
+ hash = {}
439
+ self.class.attribute_map.each_pair do |attr, param|
440
+ value = self.send(attr)
441
+ if value.nil?
442
+ is_nullable = self.class.openapi_nullable.include?(attr)
443
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
444
+ end
445
+
446
+ hash[param] = _to_hash(value)
447
+ end
448
+ hash
449
+ end
450
+
451
+ # Outputs non-array value in the form of hash
452
+ # For object, use to_hash. Otherwise, just return the value
453
+ # @param [Object] value Any valid value
454
+ # @return [Hash] Returns the value in the form of hash
455
+ def _to_hash(value)
456
+ if value.is_a?(Array)
457
+ value.compact.map { |v| _to_hash(v) }
458
+ elsif value.is_a?(Hash)
459
+ {}.tap do |hash|
460
+ value.each { |k, v| hash[k] = _to_hash(v) }
461
+ end
462
+ elsif value.respond_to? :to_hash
463
+ value.to_hash
464
+ else
465
+ value
466
+ end
467
+ end
468
+
469
+ end
470
+
471
+ end