emass_client 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +1284 -0
  3. data/Rakefile +8 -0
  4. data/lib/emass_client/api/artifacts_api.rb +310 -0
  5. data/lib/emass_client/api/artifacts_export_api.rb +86 -0
  6. data/lib/emass_client/api/cac_api.rb +143 -0
  7. data/lib/emass_client/api/cmmc_assessments_api.rb +77 -0
  8. data/lib/emass_client/api/controls_api.rb +143 -0
  9. data/lib/emass_client/api/milestones_api.rb +366 -0
  10. data/lib/emass_client/api/pac_api.rb +140 -0
  11. data/lib/emass_client/api/poam_api.rb +345 -0
  12. data/lib/emass_client/api/registration_api.rb +78 -0
  13. data/lib/emass_client/api/static_code_scans_api.rb +84 -0
  14. data/lib/emass_client/api/system_roles_api.rb +150 -0
  15. data/lib/emass_client/api/systems_api.rb +162 -0
  16. data/lib/emass_client/api/test_api.rb +70 -0
  17. data/lib/emass_client/api/test_results_api.rb +149 -0
  18. data/lib/emass_client/api/workflow_definitions_api.rb +76 -0
  19. data/lib/emass_client/api/workflow_instances_api.rb +153 -0
  20. data/lib/emass_client/api_client.rb +389 -0
  21. data/lib/emass_client/api_error.rb +57 -0
  22. data/lib/emass_client/configuration.rb +224 -0
  23. data/lib/emass_client/models/artifacts_delete.rb +201 -0
  24. data/lib/emass_client/models/artifacts_delete_inner.rb +207 -0
  25. data/lib/emass_client/models/artifacts_get.rb +383 -0
  26. data/lib/emass_client/models/artifacts_request_put_body.rb +363 -0
  27. data/lib/emass_client/models/artifacts_response_del.rb +217 -0
  28. data/lib/emass_client/models/artifacts_response_del_data.rb +225 -0
  29. data/lib/emass_client/models/artifacts_response_get.rb +217 -0
  30. data/lib/emass_client/models/artifacts_response_put_post.rb +217 -0
  31. data/lib/emass_client/models/cac_get.rb +301 -0
  32. data/lib/emass_client/models/cac_request_post_body.rb +217 -0
  33. data/lib/emass_client/models/cac_response_get.rb +217 -0
  34. data/lib/emass_client/models/cac_response_post.rb +217 -0
  35. data/lib/emass_client/models/cac_response_post_data.rb +225 -0
  36. data/lib/emass_client/models/cmmc_get.rb +398 -0
  37. data/lib/emass_client/models/cmmc_response_get.rb +217 -0
  38. data/lib/emass_client/models/connectivity_ccsd.rb +217 -0
  39. data/lib/emass_client/models/controls_get.rb +663 -0
  40. data/lib/emass_client/models/controls_put.rb +227 -0
  41. data/lib/emass_client/models/controls_request_put_body.rb +606 -0
  42. data/lib/emass_client/models/controls_response_get.rb +217 -0
  43. data/lib/emass_client/models/controls_response_put.rb +217 -0
  44. data/lib/emass_client/models/definition_transitions.rb +274 -0
  45. data/lib/emass_client/models/delete_milestone.rb +212 -0
  46. data/lib/emass_client/models/delete_poam.rb +212 -0
  47. data/lib/emass_client/models/empty200_response.rb +197 -0
  48. data/lib/emass_client/models/error.rb +225 -0
  49. data/lib/emass_client/models/instances_transitions.rb +327 -0
  50. data/lib/emass_client/models/milestone_response_get.rb +217 -0
  51. data/lib/emass_client/models/milestone_response_post.rb +217 -0
  52. data/lib/emass_client/models/milestone_response_put.rb +217 -0
  53. data/lib/emass_client/models/milestones_delete.rb +197 -0
  54. data/lib/emass_client/models/milestones_get.rb +291 -0
  55. data/lib/emass_client/models/milestones_post.rb +197 -0
  56. data/lib/emass_client/models/milestones_put.rb +197 -0
  57. data/lib/emass_client/models/milestones_put_post_delete.rb +247 -0
  58. data/lib/emass_client/models/milestones_request_post_body.rb +242 -0
  59. data/lib/emass_client/models/milestones_request_put_body.rb +242 -0
  60. data/lib/emass_client/models/milestones_required_post.rb +227 -0
  61. data/lib/emass_client/models/milestones_required_put.rb +242 -0
  62. data/lib/emass_client/models/model_200.rb +208 -0
  63. data/lib/emass_client/models/model_201.rb +206 -0
  64. data/lib/emass_client/models/model_201_meta.rb +219 -0
  65. data/lib/emass_client/models/model_400.rb +206 -0
  66. data/lib/emass_client/models/model_400_meta.rb +219 -0
  67. data/lib/emass_client/models/model_400_response.rb +206 -0
  68. data/lib/emass_client/models/model_401.rb +206 -0
  69. data/lib/emass_client/models/model_401_meta.rb +219 -0
  70. data/lib/emass_client/models/model_403.rb +206 -0
  71. data/lib/emass_client/models/model_403_meta.rb +219 -0
  72. data/lib/emass_client/models/model_404.rb +219 -0
  73. data/lib/emass_client/models/model_404_response.rb +206 -0
  74. data/lib/emass_client/models/model_405.rb +206 -0
  75. data/lib/emass_client/models/model_405_meta.rb +219 -0
  76. data/lib/emass_client/models/model_411.rb +206 -0
  77. data/lib/emass_client/models/model_411_meta.rb +219 -0
  78. data/lib/emass_client/models/model_490.rb +206 -0
  79. data/lib/emass_client/models/model_490_meta.rb +219 -0
  80. data/lib/emass_client/models/model_500.rb +206 -0
  81. data/lib/emass_client/models/model_500_meta.rb +219 -0
  82. data/lib/emass_client/models/pac_get.rb +311 -0
  83. data/lib/emass_client/models/pac_post.rb +259 -0
  84. data/lib/emass_client/models/pac_request_post_body.rb +261 -0
  85. data/lib/emass_client/models/pac_response_get.rb +217 -0
  86. data/lib/emass_client/models/pac_response_post.rb +217 -0
  87. data/lib/emass_client/models/poam_delete.rb +197 -0
  88. data/lib/emass_client/models/poam_get.rb +646 -0
  89. data/lib/emass_client/models/poam_post.rb +197 -0
  90. data/lib/emass_client/models/poam_post_put_del.rb +237 -0
  91. data/lib/emass_client/models/poam_put.rb +197 -0
  92. data/lib/emass_client/models/poam_request_post_body.rb +197 -0
  93. data/lib/emass_client/models/poam_request_put_body.rb +197 -0
  94. data/lib/emass_client/models/poam_required_post.rb +564 -0
  95. data/lib/emass_client/models/poam_required_put.rb +594 -0
  96. data/lib/emass_client/models/poam_response_delete.rb +217 -0
  97. data/lib/emass_client/models/poam_response_get.rb +217 -0
  98. data/lib/emass_client/models/poam_response_post.rb +217 -0
  99. data/lib/emass_client/models/poam_response_put.rb +217 -0
  100. data/lib/emass_client/models/register.rb +215 -0
  101. data/lib/emass_client/models/register_data.rb +206 -0
  102. data/lib/emass_client/models/register_user_request_post_body.rb +211 -0
  103. data/lib/emass_client/models/role_category.rb +272 -0
  104. data/lib/emass_client/models/roles.rb +274 -0
  105. data/lib/emass_client/models/ssps.rb +227 -0
  106. data/lib/emass_client/models/stage.rb +252 -0
  107. data/lib/emass_client/models/static_code_application.rb +303 -0
  108. data/lib/emass_client/models/static_code_request_post_body.rb +197 -0
  109. data/lib/emass_client/models/static_code_required_post.rb +217 -0
  110. data/lib/emass_client/models/static_code_required_post_application.rb +217 -0
  111. data/lib/emass_client/models/success200_response.rb +217 -0
  112. data/lib/emass_client/models/system_id_artifacts_body.rb +284 -0
  113. data/lib/emass_client/models/system_response.rb +217 -0
  114. data/lib/emass_client/models/system_roles_category_response.rb +217 -0
  115. data/lib/emass_client/models/system_roles_response.rb +217 -0
  116. data/lib/emass_client/models/system_roles_response_data.rb +219 -0
  117. data/lib/emass_client/models/systems.rb +1137 -0
  118. data/lib/emass_client/models/test.rb +215 -0
  119. data/lib/emass_client/models/test_data.rb +206 -0
  120. data/lib/emass_client/models/test_results_get.rb +333 -0
  121. data/lib/emass_client/models/test_results_post.rb +227 -0
  122. data/lib/emass_client/models/test_results_request_post_body.rb +306 -0
  123. data/lib/emass_client/models/test_results_response_get.rb +217 -0
  124. data/lib/emass_client/models/test_results_response_post.rb +217 -0
  125. data/lib/emass_client/models/users.rb +224 -0
  126. data/lib/emass_client/models/workflow_definition_get.rb +282 -0
  127. data/lib/emass_client/models/workflow_definition_response_get.rb +217 -0
  128. data/lib/emass_client/models/workflow_instances_get.rb +368 -0
  129. data/lib/emass_client/models/workflow_instances_response_get.rb +217 -0
  130. data/lib/emass_client/version.rb +14 -0
  131. data/lib/emass_client.rb +161 -0
  132. metadata +259 -0
@@ -0,0 +1,301 @@
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 CacGet
16
+ # [Required] Unique eMASS system identifier.
17
+ attr_accessor :system_id
18
+
19
+ # [Required] System acronym name.
20
+ attr_accessor :control_acronym
21
+
22
+ # [Read-only] Compliance status of the control.
23
+ attr_accessor :compliance_status
24
+
25
+ # [Read-Only] Role in current stage.
26
+ attr_accessor :current_stage_name
27
+
28
+ # [Read-Only] Current step in the Control Approval Chain.
29
+ attr_accessor :current_stage
30
+
31
+ # [Read-Only] Total number of steps in Control Approval Chain.
32
+ attr_accessor :total_stages
33
+
34
+ # [Conditional] Control Approval Chain comments - 2000 Characters.
35
+ attr_accessor :comments
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'system_id' => :'systemId',
63
+ :'control_acronym' => :'controlAcronym',
64
+ :'compliance_status' => :'complianceStatus',
65
+ :'current_stage_name' => :'currentStageName',
66
+ :'current_stage' => :'currentStage',
67
+ :'total_stages' => :'totalStages',
68
+ :'comments' => :'comments'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'system_id' => :'Object',
76
+ :'control_acronym' => :'Object',
77
+ :'compliance_status' => :'Object',
78
+ :'current_stage_name' => :'Object',
79
+ :'current_stage' => :'Object',
80
+ :'total_stages' => :'Object',
81
+ :'comments' => :'Object'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::CacGet` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ attributes = attributes.each_with_object({}) { |(k, v), h|
100
+ if (!self.class.attribute_map.key?(k.to_sym))
101
+ fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::CacGet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
102
+ end
103
+ h[k.to_sym] = v
104
+ }
105
+
106
+ if attributes.key?(:'system_id')
107
+ self.system_id = attributes[:'system_id']
108
+ end
109
+
110
+ if attributes.key?(:'control_acronym')
111
+ self.control_acronym = attributes[:'control_acronym']
112
+ end
113
+
114
+ if attributes.key?(:'compliance_status')
115
+ self.compliance_status = attributes[:'compliance_status']
116
+ end
117
+
118
+ if attributes.key?(:'current_stage_name')
119
+ self.current_stage_name = attributes[:'current_stage_name']
120
+ end
121
+
122
+ if attributes.key?(:'current_stage')
123
+ self.current_stage = attributes[:'current_stage']
124
+ end
125
+
126
+ if attributes.key?(:'total_stages')
127
+ self.total_stages = attributes[:'total_stages']
128
+ end
129
+
130
+ if attributes.key?(:'comments')
131
+ self.comments = attributes[:'comments']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ invalid_properties = Array.new
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ compliance_status_validator = EnumAttributeValidator.new('Object', ['Compliant', 'Not Compliant', 'No Status', 'Not Applicable'])
146
+ return false unless compliance_status_validator.valid?(@compliance_status)
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method checking allowed values (enum).
151
+ # @param [Object] compliance_status Object to be assigned
152
+ def compliance_status=(compliance_status)
153
+ validator = EnumAttributeValidator.new('Object', ['Compliant', 'Not Compliant', 'No Status', 'Not Applicable'])
154
+ unless validator.valid?(compliance_status)
155
+ fail ArgumentError, "invalid value for \"compliance_status\", must be one of #{validator.allowable_values}."
156
+ end
157
+ @compliance_status = compliance_status
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ system_id == o.system_id &&
166
+ control_acronym == o.control_acronym &&
167
+ compliance_status == o.compliance_status &&
168
+ current_stage_name == o.current_stage_name &&
169
+ current_stage == o.current_stage &&
170
+ total_stages == o.total_stages &&
171
+ comments == o.comments
172
+ end
173
+
174
+ # @see the `==` method
175
+ # @param [Object] Object to be compared
176
+ def eql?(o)
177
+ self == o
178
+ end
179
+
180
+ # Calculates hash code according to all attributes.
181
+ # @return [Integer] Hash code
182
+ def hash
183
+ [system_id, control_acronym, compliance_status, current_stage_name, current_stage, total_stages, comments].hash
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def self.build_from_hash(attributes)
190
+ new.build_from_hash(attributes)
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ self.class.openapi_types.each_pair do |key, type|
199
+ if type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
203
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
204
+ end
205
+ elsif !attributes[self.class.attribute_map[key]].nil?
206
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
207
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
208
+ self.send("#{key}=", nil)
209
+ end
210
+ end
211
+
212
+ self
213
+ end
214
+
215
+ # Deserializes the data based on type
216
+ # @param string type Data type
217
+ # @param string value Value to be deserialized
218
+ # @return [Object] Deserialized data
219
+ def _deserialize(type, value)
220
+ case type.to_sym
221
+ when :DateTime
222
+ DateTime.parse(value)
223
+ when :Date
224
+ Date.parse(value)
225
+ when :String
226
+ value.to_s
227
+ when :Integer
228
+ value.to_i
229
+ when :Float
230
+ value.to_f
231
+ when :Boolean
232
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
233
+ true
234
+ else
235
+ false
236
+ end
237
+ when :Object
238
+ # generic object (usually a Hash), return directly
239
+ value
240
+ when /\AArray<(?<inner_type>.+)>\z/
241
+ inner_type = Regexp.last_match[:inner_type]
242
+ value.map { |v| _deserialize(inner_type, v) }
243
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
244
+ k_type = Regexp.last_match[:k_type]
245
+ v_type = Regexp.last_match[:v_type]
246
+ {}.tap do |hash|
247
+ value.each do |k, v|
248
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
249
+ end
250
+ end
251
+ else # model
252
+ EmassClient.const_get(type).build_from_hash(value)
253
+ end
254
+ end
255
+
256
+ # Returns the string representation of the object
257
+ # @return [String] String presentation of the object
258
+ def to_s
259
+ to_hash.to_s
260
+ end
261
+
262
+ # to_body is an alias to to_hash (backward compatibility)
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_body
265
+ to_hash
266
+ end
267
+
268
+ # Returns the object in the form of hash
269
+ # @return [Hash] Returns the object in the form of hash
270
+ def to_hash
271
+ hash = {}
272
+ self.class.attribute_map.each_pair do |attr, param|
273
+ value = self.send(attr)
274
+ if value.nil?
275
+ is_nullable = self.class.openapi_nullable.include?(attr)
276
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
277
+ end
278
+
279
+ hash[param] = _to_hash(value)
280
+ end
281
+ hash
282
+ end
283
+
284
+ # Outputs non-array value in the form of hash
285
+ # For object, use to_hash. Otherwise, just return the value
286
+ # @param [Object] value Any valid value
287
+ # @return [Hash] Returns the value in the form of hash
288
+ def _to_hash(value)
289
+ if value.is_a?(Array)
290
+ value.compact.map { |v| _to_hash(v) }
291
+ elsif value.is_a?(Hash)
292
+ {}.tap do |hash|
293
+ value.each { |k, v| hash[k] = _to_hash(v) }
294
+ end
295
+ elsif value.respond_to? :to_hash
296
+ value.to_hash
297
+ else
298
+ value
299
+ end
300
+ end end
301
+ end
@@ -0,0 +1,217 @@
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