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,284 +0,0 @@
1
- =begin
2
- #Enterprise Mission Assurance Support Service (eMASS)
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:
5
-
6
- OpenAPI spec version: v3.2
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
10
- =end
11
-
12
- require 'date'
13
-
14
- module EmassClient
15
- class SystemIdArtifactsBody
16
- attr_accessor :is_template
17
-
18
- attr_accessor :type
19
-
20
- attr_accessor :category
21
-
22
- attr_accessor :zipper
23
-
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
- # Attribute mapping from ruby-style variable name to JSON key.
47
- def self.attribute_map
48
- {
49
- :'is_template' => :'isTemplate',
50
- :'type' => :'type',
51
- :'category' => :'category',
52
- :'zipper' => :'Zipper'
53
- }
54
- end
55
-
56
- # Attribute type mapping.
57
- def self.openapi_types
58
- {
59
- :'is_template' => :'Object',
60
- :'type' => :'Object',
61
- :'category' => :'Object',
62
- :'zipper' => :'Object'
63
- }
64
- end
65
-
66
- # List of attributes with nullable: true
67
- def self.openapi_nullable
68
- Set.new([
69
- ])
70
- end
71
-
72
- # Initializes the object
73
- # @param [Hash] attributes Model attributes in the form of hash
74
- def initialize(attributes = {})
75
- if (!attributes.is_a?(Hash))
76
- fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::SystemIdArtifactsBody` initialize method"
77
- end
78
-
79
- # check to see if the attribute exists and convert string to symbol for hash key
80
- attributes = attributes.each_with_object({}) { |(k, v), h|
81
- if (!self.class.attribute_map.key?(k.to_sym))
82
- fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::SystemIdArtifactsBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
- end
84
- h[k.to_sym] = v
85
- }
86
-
87
- if attributes.key?(:'is_template')
88
- self.is_template = attributes[:'is_template']
89
- end
90
-
91
- if attributes.key?(:'type')
92
- self.type = attributes[:'type']
93
- end
94
-
95
- if attributes.key?(:'category')
96
- self.category = attributes[:'category']
97
- end
98
-
99
- if attributes.key?(:'zipper')
100
- self.zipper = attributes[:'zipper']
101
- end
102
- end
103
-
104
- # Show invalid properties with the reasons. Usually used together with valid?
105
- # @return Array for valid properties with the reasons
106
- def list_invalid_properties
107
- invalid_properties = Array.new
108
- if @zipper.nil?
109
- invalid_properties.push('invalid value for "zipper", zipper cannot be nil.')
110
- end
111
-
112
- invalid_properties
113
- end
114
-
115
- # Check to see if the all the properties in the model are valid
116
- # @return true if the model is valid
117
- def valid?
118
- type_validator = EnumAttributeValidator.new('Object', ['Procedure', 'Diagram', 'Policy', 'Labor', 'Document', 'Image', 'Other', 'Scan Result', 'Auditor Report'])
119
- return false unless type_validator.valid?(@type)
120
- category_validator = EnumAttributeValidator.new('Object', ['Implementation Guidance', 'Evidence'])
121
- return false unless category_validator.valid?(@category)
122
- return false if @zipper.nil?
123
- true
124
- end
125
-
126
- # Custom attribute writer method checking allowed values (enum).
127
- # @param [Object] type Object to be assigned
128
- def type=(type)
129
- validator = EnumAttributeValidator.new('Object', ['Procedure', 'Diagram', 'Policy', 'Labor', 'Document', 'Image', 'Other', 'Scan Result', 'Auditor Report'])
130
- unless validator.valid?(type)
131
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
132
- end
133
- @type = type
134
- end
135
-
136
- # Custom attribute writer method checking allowed values (enum).
137
- # @param [Object] category Object to be assigned
138
- def category=(category)
139
- validator = EnumAttributeValidator.new('Object', ['Implementation Guidance', 'Evidence'])
140
- unless validator.valid?(category)
141
- fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}."
142
- end
143
- @category = category
144
- end
145
-
146
- # Checks equality by comparing each attribute.
147
- # @param [Object] Object to be compared
148
- def ==(o)
149
- return true if self.equal?(o)
150
- self.class == o.class &&
151
- is_template == o.is_template &&
152
- type == o.type &&
153
- category == o.category &&
154
- zipper == o.zipper
155
- end
156
-
157
- # @see the `==` method
158
- # @param [Object] Object to be compared
159
- def eql?(o)
160
- self == o
161
- end
162
-
163
- # Calculates hash code according to all attributes.
164
- # @return [Integer] Hash code
165
- def hash
166
- [is_template, type, category, zipper].hash
167
- end
168
-
169
- # Builds the object from hash
170
- # @param [Hash] attributes Model attributes in the form of hash
171
- # @return [Object] Returns the model itself
172
- def self.build_from_hash(attributes)
173
- new.build_from_hash(attributes)
174
- end
175
-
176
- # Builds the object from hash
177
- # @param [Hash] attributes Model attributes in the form of hash
178
- # @return [Object] Returns the model itself
179
- def build_from_hash(attributes)
180
- return nil unless attributes.is_a?(Hash)
181
- self.class.openapi_types.each_pair do |key, type|
182
- if type =~ /\AArray<(.*)>/i
183
- # check to ensure the input is an array given that the attribute
184
- # is documented as an array but the input is not
185
- if attributes[self.class.attribute_map[key]].is_a?(Array)
186
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
187
- end
188
- elsif !attributes[self.class.attribute_map[key]].nil?
189
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
191
- self.send("#{key}=", nil)
192
- end
193
- end
194
-
195
- self
196
- end
197
-
198
- # Deserializes the data based on type
199
- # @param string type Data type
200
- # @param string value Value to be deserialized
201
- # @return [Object] Deserialized data
202
- def _deserialize(type, value)
203
- case type.to_sym
204
- when :DateTime
205
- DateTime.parse(value)
206
- when :Date
207
- Date.parse(value)
208
- when :String
209
- value.to_s
210
- when :Integer
211
- value.to_i
212
- when :Float
213
- value.to_f
214
- when :Boolean
215
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
- true
217
- else
218
- false
219
- end
220
- when :Object
221
- # generic object (usually a Hash), return directly
222
- value
223
- when /\AArray<(?<inner_type>.+)>\z/
224
- inner_type = Regexp.last_match[:inner_type]
225
- value.map { |v| _deserialize(inner_type, v) }
226
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
- k_type = Regexp.last_match[:k_type]
228
- v_type = Regexp.last_match[:v_type]
229
- {}.tap do |hash|
230
- value.each do |k, v|
231
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
- end
233
- end
234
- else # model
235
- EmassClient.const_get(type).build_from_hash(value)
236
- end
237
- end
238
-
239
- # Returns the string representation of the object
240
- # @return [String] String presentation of the object
241
- def to_s
242
- to_hash.to_s
243
- end
244
-
245
- # to_body is an alias to to_hash (backward compatibility)
246
- # @return [Hash] Returns the object in the form of hash
247
- def to_body
248
- to_hash
249
- end
250
-
251
- # Returns the object in the form of hash
252
- # @return [Hash] Returns the object in the form of hash
253
- def to_hash
254
- hash = {}
255
- self.class.attribute_map.each_pair do |attr, param|
256
- value = self.send(attr)
257
- if value.nil?
258
- is_nullable = self.class.openapi_nullable.include?(attr)
259
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
- end
261
-
262
- hash[param] = _to_hash(value)
263
- end
264
- hash
265
- end
266
-
267
- # Outputs non-array value in the form of hash
268
- # For object, use to_hash. Otherwise, just return the value
269
- # @param [Object] value Any valid value
270
- # @return [Hash] Returns the value in the form of hash
271
- def _to_hash(value)
272
- if value.is_a?(Array)
273
- value.compact.map { |v| _to_hash(v) }
274
- elsif value.is_a?(Hash)
275
- {}.tap do |hash|
276
- value.each { |k, v| hash[k] = _to_hash(v) }
277
- end
278
- elsif value.respond_to? :to_hash
279
- value.to_hash
280
- else
281
- value
282
- end
283
- end end
284
- end
@@ -1,306 +0,0 @@
1
- =begin
2
- #Enterprise Mission Assurance Support Service (eMASS)
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:
5
-
6
- OpenAPI spec version: v3.2
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
10
- =end
11
-
12
- require 'date'
13
-
14
- module EmassClient
15
- class TestResultsRequestPostBody
16
- # [Required] CCI associated with test result.
17
- attr_accessor :cci
18
-
19
- # [Required] Last Name, First Name. 100 Characters.
20
- attr_accessor :tested_by
21
-
22
- # [Required] Unix time format.
23
- attr_accessor :test_date
24
-
25
- # [Required] Include description of test result. 4000 Characters.
26
- attr_accessor :description
27
-
28
- # [Required] Test result compliance status
29
- attr_accessor :compliance_status
30
-
31
- class EnumAttributeValidator
32
- attr_reader :datatype
33
- attr_reader :allowable_values
34
-
35
- def initialize(datatype, allowable_values)
36
- @allowable_values = allowable_values.map do |value|
37
- case datatype.to_s
38
- when /Integer/i
39
- value.to_i
40
- when /Float/i
41
- value.to_f
42
- else
43
- value
44
- end
45
- end
46
- end
47
-
48
- def valid?(value)
49
- !value || allowable_values.include?(value)
50
- end
51
- end
52
-
53
- # Attribute mapping from ruby-style variable name to JSON key.
54
- def self.attribute_map
55
- {
56
- :'cci' => :'cci',
57
- :'tested_by' => :'testedBy',
58
- :'test_date' => :'testDate',
59
- :'description' => :'description',
60
- :'compliance_status' => :'complianceStatus'
61
- }
62
- end
63
-
64
- # Attribute type mapping.
65
- def self.openapi_types
66
- {
67
- :'cci' => :'Object',
68
- :'tested_by' => :'Object',
69
- :'test_date' => :'Object',
70
- :'description' => :'Object',
71
- :'compliance_status' => :'Object'
72
- }
73
- end
74
-
75
- # List of attributes with nullable: true
76
- def self.openapi_nullable
77
- Set.new([
78
- ])
79
- end
80
-
81
- # Initializes the object
82
- # @param [Hash] attributes Model attributes in the form of hash
83
- def initialize(attributes = {})
84
- if (!attributes.is_a?(Hash))
85
- fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::TestResultsRequestPostBody` initialize method"
86
- end
87
-
88
- # check to see if the attribute exists and convert string to symbol for hash key
89
- attributes = attributes.each_with_object({}) { |(k, v), h|
90
- if (!self.class.attribute_map.key?(k.to_sym))
91
- fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::TestResultsRequestPostBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
- end
93
- h[k.to_sym] = v
94
- }
95
-
96
- if attributes.key?(:'cci')
97
- self.cci = attributes[:'cci']
98
- end
99
-
100
- if attributes.key?(:'tested_by')
101
- self.tested_by = attributes[:'tested_by']
102
- end
103
-
104
- if attributes.key?(:'test_date')
105
- self.test_date = attributes[:'test_date']
106
- end
107
-
108
- if attributes.key?(:'description')
109
- self.description = attributes[:'description']
110
- end
111
-
112
- if attributes.key?(:'compliance_status')
113
- self.compliance_status = attributes[:'compliance_status']
114
- end
115
- end
116
-
117
- # Show invalid properties with the reasons. Usually used together with valid?
118
- # @return Array for valid properties with the reasons
119
- def list_invalid_properties
120
- invalid_properties = Array.new
121
- if @cci.nil?
122
- invalid_properties.push('invalid value for "cci", cci cannot be nil.')
123
- end
124
-
125
- if @tested_by.nil?
126
- invalid_properties.push('invalid value for "tested_by", tested_by cannot be nil.')
127
- end
128
-
129
- if @test_date.nil?
130
- invalid_properties.push('invalid value for "test_date", test_date cannot be nil.')
131
- end
132
-
133
- if @description.nil?
134
- invalid_properties.push('invalid value for "description", description cannot be nil.')
135
- end
136
-
137
- if @compliance_status.nil?
138
- invalid_properties.push('invalid value for "compliance_status", compliance_status cannot be nil.')
139
- end
140
-
141
- invalid_properties
142
- end
143
-
144
- # Check to see if the all the properties in the model are valid
145
- # @return true if the model is valid
146
- def valid?
147
- return false if @cci.nil?
148
- return false if @tested_by.nil?
149
- return false if @test_date.nil?
150
- return false if @description.nil?
151
- return false if @compliance_status.nil?
152
- compliance_status_validator = EnumAttributeValidator.new('Object', ['Compliant', 'Non-Compliant', 'Not Applicable'])
153
- return false unless compliance_status_validator.valid?(@compliance_status)
154
- true
155
- end
156
-
157
- # Custom attribute writer method checking allowed values (enum).
158
- # @param [Object] compliance_status Object to be assigned
159
- def compliance_status=(compliance_status)
160
- validator = EnumAttributeValidator.new('Object', ['Compliant', 'Non-Compliant', 'Not Applicable'])
161
- unless validator.valid?(compliance_status)
162
- fail ArgumentError, "invalid value for \"compliance_status\", must be one of #{validator.allowable_values}."
163
- end
164
- @compliance_status = compliance_status
165
- end
166
-
167
- # Checks equality by comparing each attribute.
168
- # @param [Object] Object to be compared
169
- def ==(o)
170
- return true if self.equal?(o)
171
- self.class == o.class &&
172
- cci == o.cci &&
173
- tested_by == o.tested_by &&
174
- test_date == o.test_date &&
175
- description == o.description &&
176
- compliance_status == o.compliance_status
177
- end
178
-
179
- # @see the `==` method
180
- # @param [Object] Object to be compared
181
- def eql?(o)
182
- self == o
183
- end
184
-
185
- # Calculates hash code according to all attributes.
186
- # @return [Integer] Hash code
187
- def hash
188
- [cci, tested_by, test_date, description, compliance_status].hash
189
- end
190
-
191
- # Builds the object from hash
192
- # @param [Hash] attributes Model attributes in the form of hash
193
- # @return [Object] Returns the model itself
194
- def self.build_from_hash(attributes)
195
- new.build_from_hash(attributes)
196
- end
197
-
198
- # Builds the object from hash
199
- # @param [Hash] attributes Model attributes in the form of hash
200
- # @return [Object] Returns the model itself
201
- def build_from_hash(attributes)
202
- return nil unless attributes.is_a?(Hash)
203
- self.class.openapi_types.each_pair do |key, type|
204
- if type =~ /\AArray<(.*)>/i
205
- # check to ensure the input is an array given that the attribute
206
- # is documented as an array but the input is not
207
- if attributes[self.class.attribute_map[key]].is_a?(Array)
208
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
209
- end
210
- elsif !attributes[self.class.attribute_map[key]].nil?
211
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
212
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
213
- self.send("#{key}=", nil)
214
- end
215
- end
216
-
217
- self
218
- end
219
-
220
- # Deserializes the data based on type
221
- # @param string type Data type
222
- # @param string value Value to be deserialized
223
- # @return [Object] Deserialized data
224
- def _deserialize(type, value)
225
- case type.to_sym
226
- when :DateTime
227
- DateTime.parse(value)
228
- when :Date
229
- Date.parse(value)
230
- when :String
231
- value.to_s
232
- when :Integer
233
- value.to_i
234
- when :Float
235
- value.to_f
236
- when :Boolean
237
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
238
- true
239
- else
240
- false
241
- end
242
- when :Object
243
- # generic object (usually a Hash), return directly
244
- value
245
- when /\AArray<(?<inner_type>.+)>\z/
246
- inner_type = Regexp.last_match[:inner_type]
247
- value.map { |v| _deserialize(inner_type, v) }
248
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
249
- k_type = Regexp.last_match[:k_type]
250
- v_type = Regexp.last_match[:v_type]
251
- {}.tap do |hash|
252
- value.each do |k, v|
253
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
254
- end
255
- end
256
- else # model
257
- EmassClient.const_get(type).build_from_hash(value)
258
- end
259
- end
260
-
261
- # Returns the string representation of the object
262
- # @return [String] String presentation of the object
263
- def to_s
264
- to_hash.to_s
265
- end
266
-
267
- # to_body is an alias to to_hash (backward compatibility)
268
- # @return [Hash] Returns the object in the form of hash
269
- def to_body
270
- to_hash
271
- end
272
-
273
- # Returns the object in the form of hash
274
- # @return [Hash] Returns the object in the form of hash
275
- def to_hash
276
- hash = {}
277
- self.class.attribute_map.each_pair do |attr, param|
278
- value = self.send(attr)
279
- if value.nil?
280
- is_nullable = self.class.openapi_nullable.include?(attr)
281
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
- end
283
-
284
- hash[param] = _to_hash(value)
285
- end
286
- hash
287
- end
288
-
289
- # Outputs non-array value in the form of hash
290
- # For object, use to_hash. Otherwise, just return the value
291
- # @param [Object] value Any valid value
292
- # @return [Hash] Returns the value in the form of hash
293
- def _to_hash(value)
294
- if value.is_a?(Array)
295
- value.compact.map { |v| _to_hash(v) }
296
- elsif value.is_a?(Hash)
297
- {}.tap do |hash|
298
- value.each { |k, v| hash[k] = _to_hash(v) }
299
- end
300
- elsif value.respond_to? :to_hash
301
- value.to_hash
302
- else
303
- value
304
- end
305
- end end
306
- end