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
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Enterprise Mission Assurance Support Service (eMASS)
3
3
 
4
- #The Enterprise Mission Assurance Support Service (eMASS) Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. <strong>Register External Application (that use the eMASS API)</strong></br> New users will need to [register](https://nisp.emass.apps.mil/Content/Help/jobaids/eMASS_OT_NewUser_Job_Aid.pdf) an API key with the eMASS development team prior to accessing the site for the first time. The eMASS REST API requires a client certificate (SSL/TLS, DoD PKI only). Use the `Registration` endpoint to register the client certificate.</br></br> Every call to the eMASS REST API will require the use of the agreed upon public key certificate and API key. The API key must be provided in the request header for all endpoint calls (api-key). If the service receives an untrusted certificate or API key, a 401 error response code will be returned along with an error message. </br></br> <strong>Available Request Headers</strong></br> <table> <tr> <th align=left>key</th> <th align=left>Example Value</th> <th align=left>Description</th> </tr> <tr> <td>`api-key`</td> <td>api-key-provided-by-emass</td> <td>This API key must be provided in the request header for all endpoint calls</td> </tr> <tr> <td>`user-uid`</td> <td>USER.UID.KEY</td> <td>This User unique identifier key must be provided in the request header for all PUT, POST, and DELETE endpoint calls</td> </tr> <tr> <td></td><td></td> <td> Note: For DoD users this is the DoD ID Number (EIDIPI) on their DoD CAC </td> </tr> </table> </br><strong>Approve API Client for Actionable Requests</strong></br> Users are required to log-in to eMASS and grant permissions for a client to update data within eMASS on their behalf. This is only required for actionable requests (PUT, POST, DELETE). The Registration Endpoint and all GET requests can be accessed without completing this process with the correct permissions. Please note that leaving a field parameter blank (for PUT/POST requests) has the potential to clear information in the active eMASS records. To establish an account with eMASS and/or acquire an api-key/user-uid, contact one of the listed POC:
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
5
 
6
- The version of the OpenAPI document: v3.10
7
- Contact: disa.meade.id.mbx.emass-tier-iii-support@mail.mil
6
+ The version of the OpenAPI document: v3.22
7
+ Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0-SNAPSHOT
9
+ Generator version: 7.12.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -36,9 +36,14 @@ module EmassClient
36
36
  }
37
37
  end
38
38
 
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
39
44
  # Returns all the JSON keys this model knows about
40
45
  def self.acceptable_attributes
41
- attribute_map.values
46
+ acceptable_attribute_map.values
42
47
  end
43
48
 
44
49
  # Attribute type mapping.
@@ -66,9 +71,10 @@ module EmassClient
66
71
  end
67
72
 
68
73
  # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
75
  attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::ControlsPut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::ControlsPut`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
78
  end
73
79
  h[k.to_sym] = v
74
80
  }
@@ -95,9 +101,14 @@ module EmassClient
95
101
  # Show invalid properties with the reasons. Usually used together with valid?
96
102
  # @return Array for valid properties with the reasons
97
103
  def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
105
  invalid_properties = Array.new
99
- if !@errors.nil? && @errors.length > 5
100
- invalid_properties.push('invalid value for "errors", number of items must be less than or equal to 5.')
106
+ if !@errors.nil? && @errors.length > 25
107
+ invalid_properties.push('invalid value for "errors", number of items must be less than or equal to 25.')
108
+ end
109
+
110
+ if !@errors.nil? && @errors.length < 1
111
+ invalid_properties.push('invalid value for "errors", number of items must be greater than or equal to 1.')
101
112
  end
102
113
 
103
114
  invalid_properties
@@ -106,15 +117,21 @@ module EmassClient
106
117
  # Check to see if the all the properties in the model are valid
107
118
  # @return true if the model is valid
108
119
  def valid?
109
- return false if !@errors.nil? && @errors.length > 5
120
+ warn '[DEPRECATED] the `valid?` method is obsolete'
121
+ return false if !@errors.nil? && @errors.length > 25
122
+ return false if !@errors.nil? && @errors.length < 1
110
123
  true
111
124
  end
112
125
 
113
126
  # Custom attribute writer method with validation
114
127
  # @param [Object] errors Value to be assigned
115
128
  def errors=(errors)
116
- if !errors.nil? && errors.length > 5
117
- fail ArgumentError, 'invalid value for "errors", number of items must be less than or equal to 5.'
129
+ if !errors.nil? && errors.length > 25
130
+ fail ArgumentError, 'invalid value for "errors", number of items must be less than or equal to 25.'
131
+ end
132
+
133
+ if !errors.nil? && errors.length < 1
134
+ fail ArgumentError, 'invalid value for "errors", number of items must be greater than or equal to 1.'
118
135
  end
119
136
 
120
137
  @errors = errors
@@ -147,37 +164,30 @@ module EmassClient
147
164
  # @param [Hash] attributes Model attributes in the form of hash
148
165
  # @return [Object] Returns the model itself
149
166
  def self.build_from_hash(attributes)
150
- new.build_from_hash(attributes)
151
- end
152
-
153
- # Builds the object from hash
154
- # @param [Hash] attributes Model attributes in the form of hash
155
- # @return [Object] Returns the model itself
156
- def build_from_hash(attributes)
157
167
  return nil unless attributes.is_a?(Hash)
158
168
  attributes = attributes.transform_keys(&:to_sym)
159
- self.class.openapi_types.each_pair do |key, type|
160
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
161
- self.send("#{key}=", nil)
169
+ transformed_hash = {}
170
+ openapi_types.each_pair do |key, type|
171
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
172
+ transformed_hash["#{key}"] = nil
162
173
  elsif type =~ /\AArray<(.*)>/i
163
174
  # check to ensure the input is an array given that the attribute
164
175
  # is documented as an array but the input is not
165
- if attributes[self.class.attribute_map[key]].is_a?(Array)
166
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
176
+ if attributes[attribute_map[key]].is_a?(Array)
177
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
178
  end
168
- elsif !attributes[self.class.attribute_map[key]].nil?
169
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
179
+ elsif !attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
181
  end
171
182
  end
172
-
173
- self
183
+ new(transformed_hash)
174
184
  end
175
185
 
176
186
  # Deserializes the data based on type
177
187
  # @param string type Data type
178
188
  # @param string value Value to be deserialized
179
189
  # @return [Object] Deserialized data
180
- def _deserialize(type, value)
190
+ def self._deserialize(type, value)
181
191
  case type.to_sym
182
192
  when :Time
183
193
  Time.parse(value)
@@ -212,7 +222,7 @@ module EmassClient
212
222
  else # model
213
223
  # models (e.g. Pet) or oneOf
214
224
  klass = EmassClient.const_get(type)
215
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
225
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
216
226
  end
217
227
  end
218
228
 
@@ -0,0 +1,277 @@
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 ControlsReadOnlyFields
18
+ # [Read-only] Name of the system record.
19
+ attr_accessor :name
20
+
21
+ # [Read-only] Comma separated list of CCIs associated with the control.
22
+ attr_accessor :ccis
23
+
24
+ # [Read-only] Indicates whether a control is inherited.
25
+ attr_accessor :is_inherited
26
+
27
+ # [Read-only] List of overlays that affect the control.
28
+ attr_accessor :modified_by_overlays
29
+
30
+ # [Read-only] Indicates the manner by which a control was included in the system's categorization.
31
+ attr_accessor :included_status
32
+
33
+ # [Read-only] Compliance of the control.
34
+ attr_accessor :compliance_status
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'name' => :'name',
40
+ :'ccis' => :'ccis',
41
+ :'is_inherited' => :'isInherited',
42
+ :'modified_by_overlays' => :'modifiedByOverlays',
43
+ :'included_status' => :'includedStatus',
44
+ :'compliance_status' => :'complianceStatus'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'name' => :'String',
62
+ :'ccis' => :'String',
63
+ :'is_inherited' => :'Boolean',
64
+ :'modified_by_overlays' => :'String',
65
+ :'included_status' => :'String',
66
+ :'compliance_status' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ :'name',
74
+ :'ccis',
75
+ :'is_inherited',
76
+ :'modified_by_overlays',
77
+ :'included_status',
78
+ :'compliance_status'
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::ControlsReadOnlyFields` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::ControlsReadOnlyFields`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'name')
99
+ self.name = attributes[:'name']
100
+ end
101
+
102
+ if attributes.key?(:'ccis')
103
+ self.ccis = attributes[:'ccis']
104
+ end
105
+
106
+ if attributes.key?(:'is_inherited')
107
+ self.is_inherited = attributes[:'is_inherited']
108
+ end
109
+
110
+ if attributes.key?(:'modified_by_overlays')
111
+ self.modified_by_overlays = attributes[:'modified_by_overlays']
112
+ end
113
+
114
+ if attributes.key?(:'included_status')
115
+ self.included_status = attributes[:'included_status']
116
+ end
117
+
118
+ if attributes.key?(:'compliance_status')
119
+ self.compliance_status = attributes[:'compliance_status']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ true
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ name == o.name &&
144
+ ccis == o.ccis &&
145
+ is_inherited == o.is_inherited &&
146
+ modified_by_overlays == o.modified_by_overlays &&
147
+ included_status == o.included_status &&
148
+ compliance_status == o.compliance_status
149
+ end
150
+
151
+ # @see the `==` method
152
+ # @param [Object] Object to be compared
153
+ def eql?(o)
154
+ self == o
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Integer] Hash code
159
+ def hash
160
+ [name, ccis, is_inherited, modified_by_overlays, included_status, compliance_status].hash
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def self.build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ attributes = attributes.transform_keys(&:to_sym)
169
+ transformed_hash = {}
170
+ openapi_types.each_pair do |key, type|
171
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
172
+ transformed_hash["#{key}"] = nil
173
+ elsif type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[attribute_map[key]].is_a?(Array)
177
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
178
+ end
179
+ elsif !attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
181
+ end
182
+ end
183
+ new(transformed_hash)
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def self._deserialize(type, value)
191
+ case type.to_sym
192
+ when :Time
193
+ Time.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ # models (e.g. Pet) or oneOf
224
+ klass = EmassClient.const_get(type)
225
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ # Outputs non-array value in the form of hash
258
+ # For object, use to_hash. Otherwise, just return the value
259
+ # @param [Object] value Any valid value
260
+ # @return [Hash] Returns the value in the form of hash
261
+ def _to_hash(value)
262
+ if value.is_a?(Array)
263
+ value.compact.map { |v| _to_hash(v) }
264
+ elsif value.is_a?(Hash)
265
+ {}.tap do |hash|
266
+ value.each { |k, v| hash[k] = _to_hash(v) }
267
+ end
268
+ elsif value.respond_to? :to_hash
269
+ value.to_hash
270
+ else
271
+ value
272
+ end
273
+ end
274
+
275
+ end
276
+
277
+ end