Class: Ittybit::Tasks::TasksGetResponseResults
- Inherits:
-
Object
- Object
- Ittybit::Tasks::TasksGetResponseResults
- Defined in:
- lib/ittybit/tasks/types/tasks_get_response_results.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #continue ⇒ Boolean readonly
- #failed ⇒ Array<Hash{String => Object}> readonly
- #passed ⇒ Array<Hash{String => Object}> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Ittybit::Tasks::TasksGetResponseResults
Deserialize a JSON object to an instance of TasksGetResponseResults.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(passed: OMIT, failed: OMIT, continue: OMIT, additional_properties: nil) ⇒ Ittybit::Tasks::TasksGetResponseResults constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TasksGetResponseResults to a JSON object.
Constructor Details
#initialize(passed: OMIT, failed: OMIT, continue: OMIT, additional_properties: nil) ⇒ Ittybit::Tasks::TasksGetResponseResults
28 29 30 31 32 33 34 35 36 |
# File 'lib/ittybit/tasks/types/tasks_get_response_results.rb', line 28 def initialize(passed: OMIT, failed: OMIT, continue: OMIT, additional_properties: nil) @passed = passed if passed != OMIT @failed = failed if failed != OMIT @continue = continue if continue != OMIT @additional_properties = additional_properties @_field_set = { "passed": passed, "failed": failed, "continue": continue }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/ittybit/tasks/types/tasks_get_response_results.rb', line 16 def additional_properties @additional_properties end |
#continue ⇒ Boolean (readonly)
14 15 16 |
# File 'lib/ittybit/tasks/types/tasks_get_response_results.rb', line 14 def continue @continue end |
#failed ⇒ Array<Hash{String => Object}> (readonly)
12 13 14 |
# File 'lib/ittybit/tasks/types/tasks_get_response_results.rb', line 12 def failed @failed end |
#passed ⇒ Array<Hash{String => Object}> (readonly)
10 11 12 |
# File 'lib/ittybit/tasks/types/tasks_get_response_results.rb', line 10 def passed @passed end |
Class Method Details
.from_json(json_object:) ⇒ Ittybit::Tasks::TasksGetResponseResults
Deserialize a JSON object to an instance of TasksGetResponseResults
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/ittybit/tasks/types/tasks_get_response_results.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) passed = parsed_json["passed"] failed = parsed_json["failed"] continue = parsed_json["continue"] new( passed: passed, failed: failed, continue: continue, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
69 70 71 72 73 |
# File 'lib/ittybit/tasks/types/tasks_get_response_results.rb', line 69 def self.validate_raw(obj:) obj.passed&.is_a?(Array) != false || raise("Passed value for field obj.passed is not the expected type, validation failed.") obj.failed&.is_a?(Array) != false || raise("Passed value for field obj.failed is not the expected type, validation failed.") obj.continue&.is_a?(Boolean) != false || raise("Passed value for field obj.continue is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TasksGetResponseResults to a JSON object
59 60 61 |
# File 'lib/ittybit/tasks/types/tasks_get_response_results.rb', line 59 def to_json(*_args) @_field_set&.to_json end |