emass_client 1.0.1 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +152 -1124
  3. data/Rakefile +2 -0
  4. data/lib/emass_client/api/artifacts_api.rb +124 -97
  5. data/lib/emass_client/api/artifacts_export_api.rb +28 -19
  6. data/lib/emass_client/api/cac_api.rb +50 -31
  7. data/lib/emass_client/api/cloud_resources_api.rb +96 -0
  8. data/lib/emass_client/api/cmmc_assessments_api.rb +20 -11
  9. data/lib/emass_client/api/containers_api.rb +96 -0
  10. data/lib/emass_client/api/controls_api.rb +53 -34
  11. data/lib/emass_client/api/milestones_api.rb +138 -92
  12. data/lib/emass_client/api/pac_api.rb +50 -31
  13. data/lib/emass_client/api/poam_api.rb +132 -86
  14. data/lib/emass_client/api/registration_api.rb +30 -18
  15. data/lib/emass_client/api/static_code_scans_api.rb +38 -26
  16. data/lib/emass_client/api/system_roles_api.rb +48 -29
  17. data/lib/emass_client/api/systems_api.rb +57 -39
  18. data/lib/emass_client/api/test_api.rb +20 -11
  19. data/lib/emass_client/api/test_results_api.rb +53 -34
  20. data/lib/emass_client/api/workflow_definitions_api.rb +23 -14
  21. data/lib/emass_client/api/workflow_instances_api.rb +58 -53
  22. data/lib/emass_client/api_client.rb +59 -57
  23. data/lib/emass_client/api_error.rb +5 -5
  24. data/lib/emass_client/configuration.rb +93 -16
  25. data/lib/emass_client/models/artifacts_get.rb +54 -31
  26. data/lib/emass_client/models/{artifacts_delete_inner.rb → artifacts_request_delete_body_inner.rb} +29 -16
  27. data/lib/emass_client/models/artifacts_response_del.rb +27 -14
  28. data/lib/emass_client/models/{artifacts_response_del_data.rb → artifacts_response_del_data_inner.rb} +31 -18
  29. data/lib/emass_client/models/artifacts_response_get.rb +27 -14
  30. data/lib/emass_client/models/artifacts_response_put_post.rb +27 -14
  31. data/lib/emass_client/models/artifacts_response_put_post_data_inner.rb +265 -0
  32. data/lib/emass_client/models/cac_get.rb +82 -50
  33. data/lib/emass_client/models/cac_response_get.rb +27 -14
  34. data/lib/emass_client/models/cac_response_post.rb +27 -14
  35. data/lib/emass_client/models/{cac_response_post_data.rb → cac_response_post_data_inner.rb} +61 -21
  36. data/lib/emass_client/models/{pac_request_post_body.rb → cloud_resources_post.rb} +73 -69
  37. data/lib/emass_client/models/cloud_resources_response_post.rb +230 -0
  38. data/lib/emass_client/models/cmmc_get.rb +53 -63
  39. data/lib/emass_client/models/cmmc_response_get.rb +27 -14
  40. data/lib/emass_client/models/connectivity_ccsd.rb +29 -14
  41. data/lib/emass_client/models/containers_resources_post.rb +265 -0
  42. data/lib/emass_client/models/containers_response_post.rb +230 -0
  43. data/lib/emass_client/models/controls_get.rb +103 -66
  44. data/lib/emass_client/models/controls_put.rb +58 -18
  45. data/lib/emass_client/models/controls_response_get.rb +28 -14
  46. data/lib/emass_client/models/controls_response_put.rb +27 -14
  47. data/lib/emass_client/models/definition_transitions.rb +32 -62
  48. data/lib/emass_client/models/instances_transitions.rb +37 -88
  49. data/lib/emass_client/models/milestone_response_get.rb +27 -14
  50. data/lib/emass_client/models/milestone_response_get_milestone.rb +228 -0
  51. data/lib/emass_client/models/milestone_response_post.rb +27 -14
  52. data/lib/emass_client/models/milestone_response_put.rb +27 -14
  53. data/lib/emass_client/models/milestones_get.rb +33 -20
  54. data/lib/emass_client/models/milestones_put_post_delete.rb +60 -20
  55. data/lib/emass_client/models/{delete_milestone.rb → milestones_request_delete_body_inner.rb} +29 -21
  56. data/lib/emass_client/models/milestones_required_post.rb +27 -14
  57. data/lib/emass_client/models/milestones_required_put.rb +28 -15
  58. data/lib/emass_client/models/pac_get.rb +39 -22
  59. data/lib/emass_client/models/pac_post.rb +60 -20
  60. data/lib/emass_client/models/pac_response_get.rb +28 -14
  61. data/lib/emass_client/models/pac_response_post.rb +27 -14
  62. data/lib/emass_client/models/poam_get.rb +114 -77
  63. data/lib/emass_client/models/poam_post_put_del.rb +59 -19
  64. data/lib/emass_client/models/{delete_poam.rb → poam_request_delete_body_inner.rb} +29 -21
  65. data/lib/emass_client/models/poam_response_delete.rb +27 -14
  66. data/lib/emass_client/models/poam_response_get_poams.rb +228 -0
  67. data/lib/emass_client/models/{static_code_required_post.rb → poam_response_get_systems.rb} +42 -29
  68. data/lib/emass_client/models/poam_response_post.rb +27 -14
  69. data/lib/emass_client/models/poam_response_put.rb +27 -14
  70. data/lib/emass_client/models/register.rb +27 -14
  71. data/lib/emass_client/models/register_data.rb +26 -13
  72. data/lib/emass_client/models/register_user_request_post_body.rb +26 -13
  73. data/lib/emass_client/models/{model_200.rb → response200.rb} +53 -16
  74. data/lib/emass_client/models/{model_400.rb → response201.rb} +29 -16
  75. data/lib/emass_client/models/{model_201_meta.rb → response201_meta.rb} +54 -17
  76. data/lib/emass_client/models/{model_400_response.rb → response400.rb} +29 -16
  77. data/lib/emass_client/models/{model_400_meta.rb → response400_meta.rb} +54 -17
  78. data/lib/emass_client/models/{model_401.rb → response401.rb} +29 -16
  79. data/lib/emass_client/models/{model_401_meta.rb → response401_meta.rb} +54 -17
  80. data/lib/emass_client/models/{model_201.rb → response403.rb} +29 -16
  81. data/lib/emass_client/models/{model_403_meta.rb → response403_meta.rb} +54 -17
  82. data/lib/emass_client/models/{model_404.rb → response404.rb} +54 -17
  83. data/lib/emass_client/models/response405.rb +219 -0
  84. data/lib/emass_client/models/{model_405_meta.rb → response405_meta.rb} +54 -17
  85. data/lib/emass_client/models/response411.rb +219 -0
  86. data/lib/emass_client/models/{model_411_meta.rb → response411_meta.rb} +54 -17
  87. data/lib/emass_client/models/response490.rb +219 -0
  88. data/lib/emass_client/models/{model_490_meta.rb → response490_meta.rb} +54 -17
  89. data/lib/emass_client/models/response500.rb +219 -0
  90. data/lib/emass_client/models/{model_500_meta.rb → response500_meta.rb} +54 -17
  91. data/lib/emass_client/models/role_category.rb +32 -50
  92. data/lib/emass_client/models/roles.rb +29 -61
  93. data/lib/emass_client/models/ssps.rb +32 -16
  94. data/lib/emass_client/models/stage.rb +30 -49
  95. data/lib/emass_client/models/static_code_application.rb +34 -33
  96. data/lib/emass_client/models/static_code_post.rb +275 -0
  97. data/lib/emass_client/models/static_code_request_post_body.rb +47 -14
  98. data/lib/emass_client/models/{static_code_required_post_application.rb → static_code_request_post_body_application.rb} +30 -17
  99. data/lib/emass_client/models/static_code_response_post.rb +230 -0
  100. data/lib/emass_client/models/success200_response.rb +27 -14
  101. data/lib/emass_client/models/{error.rb → success200_response_data_inner.rb} +57 -36
  102. data/lib/emass_client/models/system_response.rb +28 -17
  103. data/lib/emass_client/models/system_roles_category_response.rb +28 -14
  104. data/lib/emass_client/models/system_roles_response.rb +27 -14
  105. data/lib/emass_client/models/{system_roles_response_data.rb → system_roles_response_data_inner.rb} +30 -17
  106. data/lib/emass_client/models/systems.rb +218 -191
  107. data/lib/emass_client/models/{poam_response_get.rb → systems_response.rb} +30 -17
  108. data/lib/emass_client/models/test.rb +27 -14
  109. data/lib/emass_client/models/test_data.rb +26 -13
  110. data/lib/emass_client/models/test_results_get.rb +39 -35
  111. data/lib/emass_client/models/test_results_post.rb +58 -18
  112. data/lib/emass_client/models/test_results_response_get.rb +27 -14
  113. data/lib/emass_client/models/test_results_response_post.rb +27 -14
  114. data/lib/emass_client/models/users.rb +28 -15
  115. data/lib/emass_client/models/workflow_definition_get.rb +63 -68
  116. data/lib/emass_client/models/workflow_definition_response_get.rb +27 -14
  117. data/lib/emass_client/models/workflow_instance_get.rb +331 -0
  118. data/lib/emass_client/models/workflow_instance_response_get.rb +230 -0
  119. data/lib/emass_client/models/workflow_instances_get.rb +107 -133
  120. data/lib/emass_client/models/workflow_instances_response_get.rb +39 -17
  121. data/lib/emass_client/models/workflow_instances_response_get_pagination.rb +246 -0
  122. data/lib/emass_client/version.rb +6 -5
  123. data/lib/emass_client.rb +47 -54
  124. metadata +60 -89
  125. data/lib/emass_client/models/artifacts_delete.rb +0 -201
  126. data/lib/emass_client/models/artifacts_request_put_body.rb +0 -363
  127. data/lib/emass_client/models/cac_request_post_body.rb +0 -217
  128. data/lib/emass_client/models/controls_request_put_body.rb +0 -606
  129. data/lib/emass_client/models/empty200_response.rb +0 -197
  130. data/lib/emass_client/models/milestones_delete.rb +0 -197
  131. data/lib/emass_client/models/milestones_post.rb +0 -197
  132. data/lib/emass_client/models/milestones_put.rb +0 -197
  133. data/lib/emass_client/models/milestones_request_post_body.rb +0 -242
  134. data/lib/emass_client/models/milestones_request_put_body.rb +0 -242
  135. data/lib/emass_client/models/model_403.rb +0 -206
  136. data/lib/emass_client/models/model_404_response.rb +0 -206
  137. data/lib/emass_client/models/model_405.rb +0 -206
  138. data/lib/emass_client/models/model_411.rb +0 -206
  139. data/lib/emass_client/models/model_490.rb +0 -206
  140. data/lib/emass_client/models/model_500.rb +0 -206
  141. data/lib/emass_client/models/poam_delete.rb +0 -197
  142. data/lib/emass_client/models/poam_post.rb +0 -197
  143. data/lib/emass_client/models/poam_put.rb +0 -197
  144. data/lib/emass_client/models/poam_request_post_body.rb +0 -197
  145. data/lib/emass_client/models/poam_request_put_body.rb +0 -197
  146. data/lib/emass_client/models/poam_required_post.rb +0 -564
  147. data/lib/emass_client/models/poam_required_put.rb +0 -594
  148. data/lib/emass_client/models/system_id_artifacts_body.rb +0 -284
  149. data/lib/emass_client/models/test_results_request_post_body.rb +0 -306
@@ -1,15 +1,17 @@
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. The `emasser` is a command-line interface (CLI) tool that implements all of the eMASS endpoints defined in the eMASS REST API v3.2, dated October 21, 2021.</br><br> <strong>Register CLI</strong></br> New users will need to register 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) where {url}/api/register (POST) is used 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 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:
5
5
 
6
- OpenAPI spec version: v3.2
6
+ The version of the OpenAPI document: v3.3
7
7
  Contact: disa.meade.id.mbx.emass-tier-iii-support@mail.mil
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.26
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
16
  module EmassClient
15
17
  class Roles
@@ -21,28 +23,6 @@ module EmassClient
21
23
 
22
24
  attr_accessor :users
23
25
 
24
- class EnumAttributeValidator
25
- attr_reader :datatype
26
- attr_reader :allowable_values
27
-
28
- def initialize(datatype, allowable_values)
29
- @allowable_values = allowable_values.map do |value|
30
- case datatype.to_s
31
- when /Integer/i
32
- value.to_i
33
- when /Float/i
34
- value.to_f
35
- else
36
- value
37
- end
38
- end
39
- end
40
-
41
- def valid?(value)
42
- !value || allowable_values.include?(value)
43
- end
44
- end
45
-
46
26
  # Attribute mapping from ruby-style variable name to JSON key.
47
27
  def self.attribute_map
48
28
  {
@@ -52,21 +32,27 @@ module EmassClient
52
32
  }
53
33
  end
54
34
 
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
55
40
  # Attribute type mapping.
56
41
  def self.openapi_types
57
42
  {
58
- :'role_category' => :'Object',
59
- :'role' => :'Object',
60
- :'users' => :'Object'
43
+ :'role_category' => :'String',
44
+ :'role' => :'String',
45
+ :'users' => :'Array<Users>'
61
46
  }
62
47
  end
63
48
 
64
49
  # List of attributes with nullable: true
65
50
  def self.openapi_nullable
66
51
  Set.new([
52
+ :'users'
67
53
  ])
68
54
  end
69
-
55
+
70
56
  # Initializes the object
71
57
  # @param [Hash] attributes Model attributes in the form of hash
72
58
  def initialize(attributes = {})
@@ -107,33 +93,9 @@ module EmassClient
107
93
  # Check to see if the all the properties in the model are valid
108
94
  # @return true if the model is valid
109
95
  def valid?
110
- role_category_validator = EnumAttributeValidator.new('Object', ['CAC', 'PAC', 'Other'])
111
- return false unless role_category_validator.valid?(@role_category)
112
- role_validator = EnumAttributeValidator.new('Object', ['PM/IAM', 'SCA', 'AO', 'ISSO', 'IAO', 'Validator (IV&V)', 'User Rep (View Only)', 'Auditor', 'Artifact Manager', 'C&A Team'])
113
- return false unless role_validator.valid?(@role)
114
96
  true
115
97
  end
116
98
 
117
- # Custom attribute writer method checking allowed values (enum).
118
- # @param [Object] role_category Object to be assigned
119
- def role_category=(role_category)
120
- validator = EnumAttributeValidator.new('Object', ['CAC', 'PAC', 'Other'])
121
- unless validator.valid?(role_category)
122
- fail ArgumentError, "invalid value for \"role_category\", must be one of #{validator.allowable_values}."
123
- end
124
- @role_category = role_category
125
- end
126
-
127
- # Custom attribute writer method checking allowed values (enum).
128
- # @param [Object] role Object to be assigned
129
- def role=(role)
130
- validator = EnumAttributeValidator.new('Object', ['PM/IAM', 'SCA', 'AO', 'ISSO', 'IAO', 'Validator (IV&V)', 'User Rep (View Only)', 'Auditor', 'Artifact Manager', 'C&A Team'])
131
- unless validator.valid?(role)
132
- fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
133
- end
134
- @role = role
135
- end
136
-
137
99
  # Checks equality by comparing each attribute.
138
100
  # @param [Object] Object to be compared
139
101
  def ==(o)
@@ -168,8 +130,11 @@ module EmassClient
168
130
  # @return [Object] Returns the model itself
169
131
  def build_from_hash(attributes)
170
132
  return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
171
134
  self.class.openapi_types.each_pair do |key, type|
172
- if type =~ /\AArray<(.*)>/i
135
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
136
+ self.send("#{key}=", nil)
137
+ elsif type =~ /\AArray<(.*)>/i
173
138
  # check to ensure the input is an array given that the attribute
174
139
  # is documented as an array but the input is not
175
140
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -177,8 +142,6 @@ module EmassClient
177
142
  end
178
143
  elsif !attributes[self.class.attribute_map[key]].nil?
179
144
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
180
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
181
- self.send("#{key}=", nil)
182
145
  end
183
146
  end
184
147
 
@@ -191,8 +154,8 @@ module EmassClient
191
154
  # @return [Object] Deserialized data
192
155
  def _deserialize(type, value)
193
156
  case type.to_sym
194
- when :DateTime
195
- DateTime.parse(value)
157
+ when :Time
158
+ Time.parse(value)
196
159
  when :Date
197
160
  Date.parse(value)
198
161
  when :String
@@ -222,7 +185,9 @@ module EmassClient
222
185
  end
223
186
  end
224
187
  else # model
225
- EmassClient.const_get(type).build_from_hash(value)
188
+ # models (e.g. Pet) or oneOf
189
+ klass = EmassClient.const_get(type)
190
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
191
  end
227
192
  end
228
193
 
@@ -270,5 +235,8 @@ module EmassClient
270
235
  else
271
236
  value
272
237
  end
273
- end end
238
+ end
239
+
240
+ end
241
+
274
242
  end
@@ -1,15 +1,17 @@
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. The `emasser` is a command-line interface (CLI) tool that implements all of the eMASS endpoints defined in the eMASS REST API v3.2, dated October 21, 2021.</br><br> <strong>Register CLI</strong></br> New users will need to register 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) where {url}/api/register (POST) is used 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 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:
5
5
 
6
- OpenAPI spec version: v3.2
6
+ The version of the OpenAPI document: v3.3
7
7
  Contact: disa.meade.id.mbx.emass-tier-iii-support@mail.mil
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.26
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
16
  module EmassClient
15
17
  class Ssps
@@ -19,7 +21,7 @@ module EmassClient
19
21
  # [Read-Only] Version of the System Security Plan.
20
22
  attr_accessor :ssp_version
21
23
 
22
- # Date of the System Security Plan. Unix date format.
24
+ # [Read-Only] Date of the System Security Plan. Unix date format.
23
25
  attr_accessor :ssp_date
24
26
 
25
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -31,21 +33,29 @@ module EmassClient
31
33
  }
32
34
  end
33
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
34
41
  # Attribute type mapping.
35
42
  def self.openapi_types
36
43
  {
37
- :'ssp_name' => :'Object',
38
- :'ssp_version' => :'Object',
39
- :'ssp_date' => :'Object'
44
+ :'ssp_name' => :'String',
45
+ :'ssp_version' => :'String',
46
+ :'ssp_date' => :'Integer'
40
47
  }
41
48
  end
42
49
 
43
50
  # List of attributes with nullable: true
44
51
  def self.openapi_nullable
45
52
  Set.new([
53
+ :'ssp_name',
54
+ :'ssp_version',
55
+ :'ssp_date'
46
56
  ])
47
57
  end
48
-
58
+
49
59
  # Initializes the object
50
60
  # @param [Hash] attributes Model attributes in the form of hash
51
61
  def initialize(attributes = {})
@@ -121,8 +131,11 @@ module EmassClient
121
131
  # @return [Object] Returns the model itself
122
132
  def build_from_hash(attributes)
123
133
  return nil unless attributes.is_a?(Hash)
134
+ attributes = attributes.transform_keys(&:to_sym)
124
135
  self.class.openapi_types.each_pair do |key, type|
125
- if type =~ /\AArray<(.*)>/i
136
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
137
+ self.send("#{key}=", nil)
138
+ elsif type =~ /\AArray<(.*)>/i
126
139
  # check to ensure the input is an array given that the attribute
127
140
  # is documented as an array but the input is not
128
141
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -130,8 +143,6 @@ module EmassClient
130
143
  end
131
144
  elsif !attributes[self.class.attribute_map[key]].nil?
132
145
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
- self.send("#{key}=", nil)
135
146
  end
136
147
  end
137
148
 
@@ -144,8 +155,8 @@ module EmassClient
144
155
  # @return [Object] Deserialized data
145
156
  def _deserialize(type, value)
146
157
  case type.to_sym
147
- when :DateTime
148
- DateTime.parse(value)
158
+ when :Time
159
+ Time.parse(value)
149
160
  when :Date
150
161
  Date.parse(value)
151
162
  when :String
@@ -175,7 +186,9 @@ module EmassClient
175
186
  end
176
187
  end
177
188
  else # model
178
- EmassClient.const_get(type).build_from_hash(value)
189
+ # models (e.g. Pet) or oneOf
190
+ klass = EmassClient.const_get(type)
191
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
192
  end
180
193
  end
181
194
 
@@ -223,5 +236,8 @@ module EmassClient
223
236
  else
224
237
  value
225
238
  end
226
- end end
239
+ end
240
+
241
+ end
242
+
227
243
  end
@@ -1,45 +1,25 @@
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. The `emasser` is a command-line interface (CLI) tool that implements all of the eMASS endpoints defined in the eMASS REST API v3.2, dated October 21, 2021.</br><br> <strong>Register CLI</strong></br> New users will need to register 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) where {url}/api/register (POST) is used 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 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:
5
5
 
6
- OpenAPI spec version: v3.2
6
+ The version of the OpenAPI document: v3.3
7
7
  Contact: disa.meade.id.mbx.emass-tier-iii-support@mail.mil
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.26
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
16
  module EmassClient
15
17
  class Stage
16
- # [Read-Only] Name of the stage.
18
+ # [Read-Only] Name of the stage. For older workflows, this will match the user assigned to the stage.
17
19
  attr_accessor :name
18
20
 
19
21
  attr_accessor :transitions
20
22
 
21
- class EnumAttributeValidator
22
- attr_reader :datatype
23
- attr_reader :allowable_values
24
-
25
- def initialize(datatype, allowable_values)
26
- @allowable_values = allowable_values.map do |value|
27
- case datatype.to_s
28
- when /Integer/i
29
- value.to_i
30
- when /Float/i
31
- value.to_f
32
- else
33
- value
34
- end
35
- end
36
- end
37
-
38
- def valid?(value)
39
- !value || allowable_values.include?(value)
40
- end
41
- end
42
-
43
23
  # Attribute mapping from ruby-style variable name to JSON key.
44
24
  def self.attribute_map
45
25
  {
@@ -48,20 +28,27 @@ module EmassClient
48
28
  }
49
29
  end
50
30
 
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
51
36
  # Attribute type mapping.
52
37
  def self.openapi_types
53
38
  {
54
- :'name' => :'Object',
55
- :'transitions' => :'Object'
39
+ :'name' => :'String',
40
+ :'transitions' => :'Array<DefinitionTransitions>'
56
41
  }
57
42
  end
58
43
 
59
44
  # List of attributes with nullable: true
60
45
  def self.openapi_nullable
61
46
  Set.new([
47
+ :'name',
48
+ :'transitions'
62
49
  ])
63
50
  end
64
-
51
+
65
52
  # Initializes the object
66
53
  # @param [Hash] attributes Model attributes in the form of hash
67
54
  def initialize(attributes = {})
@@ -98,21 +85,9 @@ module EmassClient
98
85
  # Check to see if the all the properties in the model are valid
99
86
  # @return true if the model is valid
100
87
  def valid?
101
- name_validator = EnumAttributeValidator.new('Object', ['Not Started', 'Categorize System', 'Submit Categorization', 'Approval', 'Complete'])
102
- return false unless name_validator.valid?(@name)
103
88
  true
104
89
  end
105
90
 
106
- # Custom attribute writer method checking allowed values (enum).
107
- # @param [Object] name Object to be assigned
108
- def name=(name)
109
- validator = EnumAttributeValidator.new('Object', ['Not Started', 'Categorize System', 'Submit Categorization', 'Approval', 'Complete'])
110
- unless validator.valid?(name)
111
- fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
112
- end
113
- @name = name
114
- end
115
-
116
91
  # Checks equality by comparing each attribute.
117
92
  # @param [Object] Object to be compared
118
93
  def ==(o)
@@ -146,8 +121,11 @@ module EmassClient
146
121
  # @return [Object] Returns the model itself
147
122
  def build_from_hash(attributes)
148
123
  return nil unless attributes.is_a?(Hash)
124
+ attributes = attributes.transform_keys(&:to_sym)
149
125
  self.class.openapi_types.each_pair do |key, type|
150
- if type =~ /\AArray<(.*)>/i
126
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
127
+ self.send("#{key}=", nil)
128
+ elsif type =~ /\AArray<(.*)>/i
151
129
  # check to ensure the input is an array given that the attribute
152
130
  # is documented as an array but the input is not
153
131
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -155,8 +133,6 @@ module EmassClient
155
133
  end
156
134
  elsif !attributes[self.class.attribute_map[key]].nil?
157
135
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
159
- self.send("#{key}=", nil)
160
136
  end
161
137
  end
162
138
 
@@ -169,8 +145,8 @@ module EmassClient
169
145
  # @return [Object] Deserialized data
170
146
  def _deserialize(type, value)
171
147
  case type.to_sym
172
- when :DateTime
173
- DateTime.parse(value)
148
+ when :Time
149
+ Time.parse(value)
174
150
  when :Date
175
151
  Date.parse(value)
176
152
  when :String
@@ -200,7 +176,9 @@ module EmassClient
200
176
  end
201
177
  end
202
178
  else # model
203
- EmassClient.const_get(type).build_from_hash(value)
179
+ # models (e.g. Pet) or oneOf
180
+ klass = EmassClient.const_get(type)
181
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
182
  end
205
183
  end
206
184
 
@@ -248,5 +226,8 @@ module EmassClient
248
226
  else
249
227
  value
250
228
  end
251
- end end
229
+ end
230
+
231
+ end
232
+
252
233
  end
@@ -1,15 +1,17 @@
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. The `emasser` is a command-line interface (CLI) tool that implements all of the eMASS endpoints defined in the eMASS REST API v3.2, dated October 21, 2021.</br><br> <strong>Register CLI</strong></br> New users will need to register 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) where {url}/api/register (POST) is used 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 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:
5
5
 
6
- OpenAPI spec version: v3.2
6
+ The version of the OpenAPI document: v3.3
7
7
  Contact: disa.meade.id.mbx.emass-tier-iii-support@mail.mil
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.26
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
16
  module EmassClient
15
17
  class StaticCodeApplication
@@ -19,7 +21,7 @@ module EmassClient
19
21
  # [Required] Name of the software vulnerability or weakness.
20
22
  attr_accessor :code_check_name
21
23
 
22
- # [Optional] Number of instances observed for a specified finding.
24
+ # [Required] Number of instances observed for a specified finding.
23
25
  attr_accessor :count
24
26
 
25
27
  # [Required] The date of the scan. Unix date format.
@@ -65,15 +67,20 @@ module EmassClient
65
67
  }
66
68
  end
67
69
 
70
+ # Returns all the JSON keys this model knows about
71
+ def self.acceptable_attributes
72
+ attribute_map.values
73
+ end
74
+
68
75
  # Attribute type mapping.
69
76
  def self.openapi_types
70
77
  {
71
- :'raw_severity' => :'Object',
72
- :'code_check_name' => :'Object',
73
- :'count' => :'Object',
74
- :'scan_date' => :'Object',
75
- :'cwe_id' => :'Object',
76
- :'clear_findings' => :'Object'
78
+ :'raw_severity' => :'String',
79
+ :'code_check_name' => :'String',
80
+ :'count' => :'Integer',
81
+ :'scan_date' => :'Integer',
82
+ :'cwe_id' => :'String',
83
+ :'clear_findings' => :'Boolean'
77
84
  }
78
85
  end
79
86
 
@@ -82,7 +89,7 @@ module EmassClient
82
89
  Set.new([
83
90
  ])
84
91
  end
85
-
92
+
86
93
  # Initializes the object
87
94
  # @param [Hash] attributes Model attributes in the form of hash
88
95
  def initialize(attributes = {})
@@ -133,33 +140,21 @@ module EmassClient
133
140
  # Check to see if the all the properties in the model are valid
134
141
  # @return true if the model is valid
135
142
  def valid?
136
- raw_severity_validator = EnumAttributeValidator.new('Object', ['Low', 'Medium', 'Moderate', 'High', 'Critical'])
143
+ raw_severity_validator = EnumAttributeValidator.new('String', ["Low", "Medium", "Moderate", "High", "Critical", "unknown_default_open_api"])
137
144
  return false unless raw_severity_validator.valid?(@raw_severity)
138
- code_check_name_validator = EnumAttributeValidator.new('Object', ['Hidden Field', 'Redundant Check', 'Invalid Field', 'Vulnerable Field'])
139
- return false unless code_check_name_validator.valid?(@code_check_name)
140
145
  true
141
146
  end
142
147
 
143
148
  # Custom attribute writer method checking allowed values (enum).
144
149
  # @param [Object] raw_severity Object to be assigned
145
150
  def raw_severity=(raw_severity)
146
- validator = EnumAttributeValidator.new('Object', ['Low', 'Medium', 'Moderate', 'High', 'Critical'])
151
+ validator = EnumAttributeValidator.new('String', ["Low", "Medium", "Moderate", "High", "Critical", "unknown_default_open_api"])
147
152
  unless validator.valid?(raw_severity)
148
153
  fail ArgumentError, "invalid value for \"raw_severity\", must be one of #{validator.allowable_values}."
149
154
  end
150
155
  @raw_severity = raw_severity
151
156
  end
152
157
 
153
- # Custom attribute writer method checking allowed values (enum).
154
- # @param [Object] code_check_name Object to be assigned
155
- def code_check_name=(code_check_name)
156
- validator = EnumAttributeValidator.new('Object', ['Hidden Field', 'Redundant Check', 'Invalid Field', 'Vulnerable Field'])
157
- unless validator.valid?(code_check_name)
158
- fail ArgumentError, "invalid value for \"code_check_name\", must be one of #{validator.allowable_values}."
159
- end
160
- @code_check_name = code_check_name
161
- end
162
-
163
158
  # Checks equality by comparing each attribute.
164
159
  # @param [Object] Object to be compared
165
160
  def ==(o)
@@ -197,8 +192,11 @@ module EmassClient
197
192
  # @return [Object] Returns the model itself
198
193
  def build_from_hash(attributes)
199
194
  return nil unless attributes.is_a?(Hash)
195
+ attributes = attributes.transform_keys(&:to_sym)
200
196
  self.class.openapi_types.each_pair do |key, type|
201
- if type =~ /\AArray<(.*)>/i
197
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
198
+ self.send("#{key}=", nil)
199
+ elsif type =~ /\AArray<(.*)>/i
202
200
  # check to ensure the input is an array given that the attribute
203
201
  # is documented as an array but the input is not
204
202
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -206,8 +204,6 @@ module EmassClient
206
204
  end
207
205
  elsif !attributes[self.class.attribute_map[key]].nil?
208
206
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
209
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
210
- self.send("#{key}=", nil)
211
207
  end
212
208
  end
213
209
 
@@ -220,8 +216,8 @@ module EmassClient
220
216
  # @return [Object] Deserialized data
221
217
  def _deserialize(type, value)
222
218
  case type.to_sym
223
- when :DateTime
224
- DateTime.parse(value)
219
+ when :Time
220
+ Time.parse(value)
225
221
  when :Date
226
222
  Date.parse(value)
227
223
  when :String
@@ -251,7 +247,9 @@ module EmassClient
251
247
  end
252
248
  end
253
249
  else # model
254
- EmassClient.const_get(type).build_from_hash(value)
250
+ # models (e.g. Pet) or oneOf
251
+ klass = EmassClient.const_get(type)
252
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
255
253
  end
256
254
  end
257
255
 
@@ -299,5 +297,8 @@ module EmassClient
299
297
  else
300
298
  value
301
299
  end
302
- end end
300
+ end
301
+
302
+ end
303
+
303
304
  end