emass_client 1.0.3 → 1.0.5

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 +18 -9
  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,363 +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 ArtifactsRequestPutBody
16
- # [Required] File name should match exactly one file within the provided zip file. 1000 Characters.
17
- attr_accessor :filename
18
-
19
- # [Required] Indicates it is an artifact template.
20
- attr_accessor :is_template
21
-
22
- # [Required] Artifact type options
23
- attr_accessor :type
24
-
25
- # [Required] Artifact category options
26
- attr_accessor :category
27
-
28
- # [Optional] Artifact description. 2000 Characters.
29
- attr_accessor :description
30
-
31
- # [Optional] Artifact reference page number. 50 Characters.
32
- attr_accessor :ref_page_number
33
-
34
- # [Required] CCI associated with test result.
35
- attr_accessor :ccis
36
-
37
- # [Optional] Control acronym associated with the artifact. NIST SP 800-53 Revision 4 defined.
38
- attr_accessor :controls
39
-
40
- # [Optional] Date Artifact expires and requires review. In Unix Date format.
41
- attr_accessor :artifact_expiration_date
42
-
43
- # [Optional]] Date Artifact was last reviewed.. Unix time format.
44
- attr_accessor :last_reviewed_date
45
-
46
- class EnumAttributeValidator
47
- attr_reader :datatype
48
- attr_reader :allowable_values
49
-
50
- def initialize(datatype, allowable_values)
51
- @allowable_values = allowable_values.map do |value|
52
- case datatype.to_s
53
- when /Integer/i
54
- value.to_i
55
- when /Float/i
56
- value.to_f
57
- else
58
- value
59
- end
60
- end
61
- end
62
-
63
- def valid?(value)
64
- !value || allowable_values.include?(value)
65
- end
66
- end
67
-
68
- # Attribute mapping from ruby-style variable name to JSON key.
69
- def self.attribute_map
70
- {
71
- :'filename' => :'filename',
72
- :'is_template' => :'isTemplate',
73
- :'type' => :'type',
74
- :'category' => :'category',
75
- :'description' => :'description',
76
- :'ref_page_number' => :'refPageNumber',
77
- :'ccis' => :'ccis',
78
- :'controls' => :'controls',
79
- :'artifact_expiration_date' => :'artifactExpirationDate',
80
- :'last_reviewed_date' => :'lastReviewedDate'
81
- }
82
- end
83
-
84
- # Attribute type mapping.
85
- def self.openapi_types
86
- {
87
- :'filename' => :'Object',
88
- :'is_template' => :'Object',
89
- :'type' => :'Object',
90
- :'category' => :'Object',
91
- :'description' => :'Object',
92
- :'ref_page_number' => :'Object',
93
- :'ccis' => :'Object',
94
- :'controls' => :'Object',
95
- :'artifact_expiration_date' => :'Object',
96
- :'last_reviewed_date' => :'Object'
97
- }
98
- end
99
-
100
- # List of attributes with nullable: true
101
- def self.openapi_nullable
102
- Set.new([
103
- ])
104
- end
105
-
106
- # Initializes the object
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- def initialize(attributes = {})
109
- if (!attributes.is_a?(Hash))
110
- fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::ArtifactsRequestPutBody` initialize method"
111
- end
112
-
113
- # check to see if the attribute exists and convert string to symbol for hash key
114
- attributes = attributes.each_with_object({}) { |(k, v), h|
115
- if (!self.class.attribute_map.key?(k.to_sym))
116
- fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::ArtifactsRequestPutBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
117
- end
118
- h[k.to_sym] = v
119
- }
120
-
121
- if attributes.key?(:'filename')
122
- self.filename = attributes[:'filename']
123
- end
124
-
125
- if attributes.key?(:'is_template')
126
- self.is_template = attributes[:'is_template']
127
- end
128
-
129
- if attributes.key?(:'type')
130
- self.type = attributes[:'type']
131
- end
132
-
133
- if attributes.key?(:'category')
134
- self.category = attributes[:'category']
135
- end
136
-
137
- if attributes.key?(:'description')
138
- self.description = attributes[:'description']
139
- end
140
-
141
- if attributes.key?(:'ref_page_number')
142
- self.ref_page_number = attributes[:'ref_page_number']
143
- end
144
-
145
- if attributes.key?(:'ccis')
146
- self.ccis = attributes[:'ccis']
147
- end
148
-
149
- if attributes.key?(:'controls')
150
- self.controls = attributes[:'controls']
151
- end
152
-
153
- if attributes.key?(:'artifact_expiration_date')
154
- self.artifact_expiration_date = attributes[:'artifact_expiration_date']
155
- end
156
-
157
- if attributes.key?(:'last_reviewed_date')
158
- self.last_reviewed_date = attributes[:'last_reviewed_date']
159
- end
160
- end
161
-
162
- # Show invalid properties with the reasons. Usually used together with valid?
163
- # @return Array for valid properties with the reasons
164
- def list_invalid_properties
165
- invalid_properties = Array.new
166
- if @filename.nil?
167
- invalid_properties.push('invalid value for "filename", filename cannot be nil.')
168
- end
169
-
170
- if @is_template.nil?
171
- invalid_properties.push('invalid value for "is_template", is_template cannot be nil.')
172
- end
173
-
174
- if @type.nil?
175
- invalid_properties.push('invalid value for "type", type cannot be nil.')
176
- end
177
-
178
- if @category.nil?
179
- invalid_properties.push('invalid value for "category", category cannot be nil.')
180
- end
181
-
182
- invalid_properties
183
- end
184
-
185
- # Check to see if the all the properties in the model are valid
186
- # @return true if the model is valid
187
- def valid?
188
- return false if @filename.nil?
189
- return false if @is_template.nil?
190
- return false if @type.nil?
191
- type_validator = EnumAttributeValidator.new('Object', ['Procedure', 'Diagram', 'Policy', 'Labor', 'Document', 'Image', 'Other', 'Scan Result'])
192
- return false unless type_validator.valid?(@type)
193
- return false if @category.nil?
194
- category_validator = EnumAttributeValidator.new('Object', ['Implementation Guidance', 'Evidence'])
195
- return false unless category_validator.valid?(@category)
196
- true
197
- end
198
-
199
- # Custom attribute writer method checking allowed values (enum).
200
- # @param [Object] type Object to be assigned
201
- def type=(type)
202
- validator = EnumAttributeValidator.new('Object', ['Procedure', 'Diagram', 'Policy', 'Labor', 'Document', 'Image', 'Other', 'Scan Result'])
203
- unless validator.valid?(type)
204
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
205
- end
206
- @type = type
207
- end
208
-
209
- # Custom attribute writer method checking allowed values (enum).
210
- # @param [Object] category Object to be assigned
211
- def category=(category)
212
- validator = EnumAttributeValidator.new('Object', ['Implementation Guidance', 'Evidence'])
213
- unless validator.valid?(category)
214
- fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}."
215
- end
216
- @category = category
217
- end
218
-
219
- # Checks equality by comparing each attribute.
220
- # @param [Object] Object to be compared
221
- def ==(o)
222
- return true if self.equal?(o)
223
- self.class == o.class &&
224
- filename == o.filename &&
225
- is_template == o.is_template &&
226
- type == o.type &&
227
- category == o.category &&
228
- description == o.description &&
229
- ref_page_number == o.ref_page_number &&
230
- ccis == o.ccis &&
231
- controls == o.controls &&
232
- artifact_expiration_date == o.artifact_expiration_date &&
233
- last_reviewed_date == o.last_reviewed_date
234
- end
235
-
236
- # @see the `==` method
237
- # @param [Object] Object to be compared
238
- def eql?(o)
239
- self == o
240
- end
241
-
242
- # Calculates hash code according to all attributes.
243
- # @return [Integer] Hash code
244
- def hash
245
- [filename, is_template, type, category, description, ref_page_number, ccis, controls, artifact_expiration_date, last_reviewed_date].hash
246
- end
247
-
248
- # Builds the object from hash
249
- # @param [Hash] attributes Model attributes in the form of hash
250
- # @return [Object] Returns the model itself
251
- def self.build_from_hash(attributes)
252
- new.build_from_hash(attributes)
253
- end
254
-
255
- # Builds the object from hash
256
- # @param [Hash] attributes Model attributes in the form of hash
257
- # @return [Object] Returns the model itself
258
- def build_from_hash(attributes)
259
- return nil unless attributes.is_a?(Hash)
260
- self.class.openapi_types.each_pair do |key, type|
261
- if type =~ /\AArray<(.*)>/i
262
- # check to ensure the input is an array given that the attribute
263
- # is documented as an array but the input is not
264
- if attributes[self.class.attribute_map[key]].is_a?(Array)
265
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
266
- end
267
- elsif !attributes[self.class.attribute_map[key]].nil?
268
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
269
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
270
- self.send("#{key}=", nil)
271
- end
272
- end
273
-
274
- self
275
- end
276
-
277
- # Deserializes the data based on type
278
- # @param string type Data type
279
- # @param string value Value to be deserialized
280
- # @return [Object] Deserialized data
281
- def _deserialize(type, value)
282
- case type.to_sym
283
- when :DateTime
284
- DateTime.parse(value)
285
- when :Date
286
- Date.parse(value)
287
- when :String
288
- value.to_s
289
- when :Integer
290
- value.to_i
291
- when :Float
292
- value.to_f
293
- when :Boolean
294
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
295
- true
296
- else
297
- false
298
- end
299
- when :Object
300
- # generic object (usually a Hash), return directly
301
- value
302
- when /\AArray<(?<inner_type>.+)>\z/
303
- inner_type = Regexp.last_match[:inner_type]
304
- value.map { |v| _deserialize(inner_type, v) }
305
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
306
- k_type = Regexp.last_match[:k_type]
307
- v_type = Regexp.last_match[:v_type]
308
- {}.tap do |hash|
309
- value.each do |k, v|
310
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
311
- end
312
- end
313
- else # model
314
- EmassClient.const_get(type).build_from_hash(value)
315
- end
316
- end
317
-
318
- # Returns the string representation of the object
319
- # @return [String] String presentation of the object
320
- def to_s
321
- to_hash.to_s
322
- end
323
-
324
- # to_body is an alias to to_hash (backward compatibility)
325
- # @return [Hash] Returns the object in the form of hash
326
- def to_body
327
- to_hash
328
- end
329
-
330
- # Returns the object in the form of hash
331
- # @return [Hash] Returns the object in the form of hash
332
- def to_hash
333
- hash = {}
334
- self.class.attribute_map.each_pair do |attr, param|
335
- value = self.send(attr)
336
- if value.nil?
337
- is_nullable = self.class.openapi_nullable.include?(attr)
338
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
339
- end
340
-
341
- hash[param] = _to_hash(value)
342
- end
343
- hash
344
- end
345
-
346
- # Outputs non-array value in the form of hash
347
- # For object, use to_hash. Otherwise, just return the value
348
- # @param [Object] value Any valid value
349
- # @return [Hash] Returns the value in the form of hash
350
- def _to_hash(value)
351
- if value.is_a?(Array)
352
- value.compact.map { |v| _to_hash(v) }
353
- elsif value.is_a?(Hash)
354
- {}.tap do |hash|
355
- value.each { |k, v| hash[k] = _to_hash(v) }
356
- end
357
- elsif value.respond_to? :to_hash
358
- value.to_hash
359
- else
360
- value
361
- end
362
- end end
363
- end
@@ -1,217 +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 CacRequestPostBody
16
- # [Required] System acronym name.
17
- attr_accessor :control_acronym
18
-
19
- # [Conditional] Control Approval Chain comments - 2000 Characters.
20
- attr_accessor :comments
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'control_acronym' => :'controlAcronym',
26
- :'comments' => :'comments'
27
- }
28
- end
29
-
30
- # Attribute type mapping.
31
- def self.openapi_types
32
- {
33
- :'control_acronym' => :'Object',
34
- :'comments' => :'Object'
35
- }
36
- end
37
-
38
- # List of attributes with nullable: true
39
- def self.openapi_nullable
40
- Set.new([
41
- ])
42
- end
43
-
44
- # Initializes the object
45
- # @param [Hash] attributes Model attributes in the form of hash
46
- def initialize(attributes = {})
47
- if (!attributes.is_a?(Hash))
48
- fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::CacRequestPostBody` initialize method"
49
- end
50
-
51
- # check to see if the attribute exists and convert string to symbol for hash key
52
- attributes = attributes.each_with_object({}) { |(k, v), h|
53
- if (!self.class.attribute_map.key?(k.to_sym))
54
- fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::CacRequestPostBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
- end
56
- h[k.to_sym] = v
57
- }
58
-
59
- if attributes.key?(:'control_acronym')
60
- self.control_acronym = attributes[:'control_acronym']
61
- end
62
-
63
- if attributes.key?(:'comments')
64
- self.comments = attributes[:'comments']
65
- end
66
- end
67
-
68
- # Show invalid properties with the reasons. Usually used together with valid?
69
- # @return Array for valid properties with the reasons
70
- def list_invalid_properties
71
- invalid_properties = Array.new
72
- invalid_properties
73
- end
74
-
75
- # Check to see if the all the properties in the model are valid
76
- # @return true if the model is valid
77
- def valid?
78
- true
79
- end
80
-
81
- # Checks equality by comparing each attribute.
82
- # @param [Object] Object to be compared
83
- def ==(o)
84
- return true if self.equal?(o)
85
- self.class == o.class &&
86
- control_acronym == o.control_acronym &&
87
- comments == o.comments
88
- end
89
-
90
- # @see the `==` method
91
- # @param [Object] Object to be compared
92
- def eql?(o)
93
- self == o
94
- end
95
-
96
- # Calculates hash code according to all attributes.
97
- # @return [Integer] Hash code
98
- def hash
99
- [control_acronym, comments].hash
100
- end
101
-
102
- # Builds the object from hash
103
- # @param [Hash] attributes Model attributes in the form of hash
104
- # @return [Object] Returns the model itself
105
- def self.build_from_hash(attributes)
106
- new.build_from_hash(attributes)
107
- end
108
-
109
- # Builds the object from hash
110
- # @param [Hash] attributes Model attributes in the form of hash
111
- # @return [Object] Returns the model itself
112
- def build_from_hash(attributes)
113
- return nil unless attributes.is_a?(Hash)
114
- self.class.openapi_types.each_pair do |key, type|
115
- if type =~ /\AArray<(.*)>/i
116
- # check to ensure the input is an array given that the attribute
117
- # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
- end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
- self.send("#{key}=", nil)
125
- end
126
- end
127
-
128
- self
129
- end
130
-
131
- # Deserializes the data based on type
132
- # @param string type Data type
133
- # @param string value Value to be deserialized
134
- # @return [Object] Deserialized data
135
- def _deserialize(type, value)
136
- case type.to_sym
137
- when :DateTime
138
- DateTime.parse(value)
139
- when :Date
140
- Date.parse(value)
141
- when :String
142
- value.to_s
143
- when :Integer
144
- value.to_i
145
- when :Float
146
- value.to_f
147
- when :Boolean
148
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
- true
150
- else
151
- false
152
- end
153
- when :Object
154
- # generic object (usually a Hash), return directly
155
- value
156
- when /\AArray<(?<inner_type>.+)>\z/
157
- inner_type = Regexp.last_match[:inner_type]
158
- value.map { |v| _deserialize(inner_type, v) }
159
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
- k_type = Regexp.last_match[:k_type]
161
- v_type = Regexp.last_match[:v_type]
162
- {}.tap do |hash|
163
- value.each do |k, v|
164
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
- end
166
- end
167
- else # model
168
- EmassClient.const_get(type).build_from_hash(value)
169
- end
170
- end
171
-
172
- # Returns the string representation of the object
173
- # @return [String] String presentation of the object
174
- def to_s
175
- to_hash.to_s
176
- end
177
-
178
- # to_body is an alias to to_hash (backward compatibility)
179
- # @return [Hash] Returns the object in the form of hash
180
- def to_body
181
- to_hash
182
- end
183
-
184
- # Returns the object in the form of hash
185
- # @return [Hash] Returns the object in the form of hash
186
- def to_hash
187
- hash = {}
188
- self.class.attribute_map.each_pair do |attr, param|
189
- value = self.send(attr)
190
- if value.nil?
191
- is_nullable = self.class.openapi_nullable.include?(attr)
192
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
- end
194
-
195
- hash[param] = _to_hash(value)
196
- end
197
- hash
198
- end
199
-
200
- # Outputs non-array value in the form of hash
201
- # For object, use to_hash. Otherwise, just return the value
202
- # @param [Object] value Any valid value
203
- # @return [Hash] Returns the value in the form of hash
204
- def _to_hash(value)
205
- if value.is_a?(Array)
206
- value.compact.map { |v| _to_hash(v) }
207
- elsif value.is_a?(Hash)
208
- {}.tap do |hash|
209
- value.each { |k, v| hash[k] = _to_hash(v) }
210
- end
211
- elsif value.respond_to? :to_hash
212
- value.to_hash
213
- else
214
- value
215
- end
216
- end end
217
- end