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,242 @@
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 MilestonesRequestPutBody
16
+ # [Required] Unique milestone identifier.
17
+ attr_accessor :milestone_id
18
+
19
+ # [Required] Provide a description of the milestone.
20
+ attr_accessor :description
21
+
22
+ # [Required] Unix date format.
23
+ attr_accessor :scheduled_completion_date
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'milestone_id' => :'milestoneId',
29
+ :'description' => :'description',
30
+ :'scheduled_completion_date' => :'scheduledCompletionDate'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'milestone_id' => :'Object',
38
+ :'description' => :'Object',
39
+ :'scheduled_completion_date' => :'Object'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `EmassClient::MilestonesRequestPutBody` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `EmassClient::MilestonesRequestPutBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'milestone_id')
65
+ self.milestone_id = attributes[:'milestone_id']
66
+ end
67
+
68
+ if attributes.key?(:'description')
69
+ self.description = attributes[:'description']
70
+ end
71
+
72
+ if attributes.key?(:'scheduled_completion_date')
73
+ self.scheduled_completion_date = attributes[:'scheduled_completion_date']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if @milestone_id.nil?
82
+ invalid_properties.push('invalid value for "milestone_id", milestone_id cannot be nil.')
83
+ end
84
+
85
+ if @description.nil?
86
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
87
+ end
88
+
89
+ if @scheduled_completion_date.nil?
90
+ invalid_properties.push('invalid value for "scheduled_completion_date", scheduled_completion_date cannot be nil.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ return false if @milestone_id.nil?
100
+ return false if @description.nil?
101
+ return false if @scheduled_completion_date.nil?
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ milestone_id == o.milestone_id &&
111
+ description == o.description &&
112
+ scheduled_completion_date == o.scheduled_completion_date
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [milestone_id, description, scheduled_completion_date].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ new.build_from_hash(attributes)
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ self.class.openapi_types.each_pair do |key, type|
140
+ if type =~ /\AArray<(.*)>/i
141
+ # check to ensure the input is an array given that the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
144
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
145
+ end
146
+ elsif !attributes[self.class.attribute_map[key]].nil?
147
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
148
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
149
+ self.send("#{key}=", nil)
150
+ end
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def _deserialize(type, value)
161
+ case type.to_sym
162
+ when :DateTime
163
+ DateTime.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :Boolean
173
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ EmassClient.const_get(type).build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end end
242
+ end
@@ -0,0 +1,227 @@
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 MilestonesRequiredPost
16
+ # [Required] Include milestone description.
17
+ attr_accessor :description
18
+
19
+ # [Required] Required for ongoing and completed POA&M items. Unix time format.
20
+ attr_accessor :scheduled_completion_date
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'description' => :'description',
26
+ :'scheduled_completion_date' => :'scheduledCompletionDate'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.openapi_types
32
+ {
33
+ :'description' => :'Object',
34
+ :'scheduled_completion_date' => :'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::MilestonesRequiredPost` 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::MilestonesRequiredPost`. 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?(:'description')
60
+ self.description = attributes[:'description']
61
+ end
62
+
63
+ if attributes.key?(:'scheduled_completion_date')
64
+ self.scheduled_completion_date = attributes[:'scheduled_completion_date']
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
+ if @description.nil?
73
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
74
+ end
75
+
76
+ if @scheduled_completion_date.nil?
77
+ invalid_properties.push('invalid value for "scheduled_completion_date", scheduled_completion_date cannot be nil.')
78
+ end
79
+
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ return false if @description.nil?
87
+ return false if @scheduled_completion_date.nil?
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ description == o.description &&
97
+ scheduled_completion_date == o.scheduled_completion_date
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [description, scheduled_completion_date].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ new.build_from_hash(attributes)
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ end
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ EmassClient.const_get(type).build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end end
227
+ end