Class: Ittybit::Tasks::TasksGetResponse
- Inherits:
-
Object
- Object
- Ittybit::Tasks::TasksGetResponse
- Defined in:
- lib/ittybit/tasks/types/tasks_get_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #created ⇒ DateTime readonly
- #created_by ⇒ String readonly
- #error ⇒ String readonly
- #id ⇒ String readonly
- #input ⇒ Hash{String => Object} readonly
- #kind ⇒ Ittybit::Tasks::TasksGetResponseKind readonly
- #object ⇒ String readonly
- #options ⇒ Hash{String => Object} readonly
- #output ⇒ Hash{String => Object} readonly
- #parent_id ⇒ String readonly
- #progress ⇒ Integer readonly
- #results ⇒ Ittybit::Tasks::TasksGetResponseResults readonly
- #status ⇒ Ittybit::Tasks::TasksGetResponseStatus readonly
- #updated ⇒ DateTime readonly
- #workflow ⇒ Array<Object> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Ittybit::Tasks::TasksGetResponse
Deserialize a JSON object to an instance of TasksGetResponse.
-
.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(id:, object:, kind:, status:, created:, updated:, input: OMIT, options: OMIT, output: OMIT, progress: OMIT, error: OMIT, created_by: OMIT, parent_id: OMIT, workflow: OMIT, results: OMIT, additional_properties: nil) ⇒ Ittybit::Tasks::TasksGetResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TasksGetResponse to a JSON object.
Constructor Details
#initialize(id:, object:, kind:, status:, created:, updated:, input: OMIT, options: OMIT, output: OMIT, progress: OMIT, error: OMIT, created_by: OMIT, parent_id: OMIT, workflow: OMIT, results: OMIT, additional_properties: nil) ⇒ Ittybit::Tasks::TasksGetResponse
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 68 def initialize(id:, object:, kind:, status:, created:, updated:, input: OMIT, options: OMIT, output: OMIT, progress: OMIT, error: OMIT, created_by: OMIT, parent_id: OMIT, workflow: OMIT, results: OMIT, additional_properties: nil) @id = id @object = object @kind = kind @input = input if input != OMIT @options = if != OMIT @output = output if output != OMIT @status = status @progress = progress if progress != OMIT @error = error if error != OMIT @created_by = created_by if created_by != OMIT @created = created @updated = updated @parent_id = parent_id if parent_id != OMIT @workflow = workflow if workflow != OMIT @results = results if results != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "object": object, "kind": kind, "input": input, "options": , "output": output, "status": status, "progress": progress, "error": error, "created_by": created_by, "created": created, "updated": updated, "parent_id": parent_id, "workflow": workflow, "results": results }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
44 45 46 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 44 def additional_properties @additional_properties end |
#created ⇒ DateTime (readonly)
34 35 36 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 34 def created @created end |
#created_by ⇒ String (readonly)
32 33 34 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 32 def created_by @created_by end |
#error ⇒ String (readonly)
30 31 32 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 30 def error @error end |
#id ⇒ String (readonly)
14 15 16 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 14 def id @id end |
#input ⇒ Hash{String => Object} (readonly)
20 21 22 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 20 def input @input end |
#kind ⇒ Ittybit::Tasks::TasksGetResponseKind (readonly)
18 19 20 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 18 def kind @kind end |
#object ⇒ String (readonly)
16 17 18 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 16 def object @object end |
#options ⇒ Hash{String => Object} (readonly)
22 23 24 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 22 def @options end |
#output ⇒ Hash{String => Object} (readonly)
24 25 26 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 24 def output @output end |
#parent_id ⇒ String (readonly)
38 39 40 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 38 def parent_id @parent_id end |
#progress ⇒ Integer (readonly)
28 29 30 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 28 def progress @progress end |
#results ⇒ Ittybit::Tasks::TasksGetResponseResults (readonly)
42 43 44 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 42 def results @results end |
#status ⇒ Ittybit::Tasks::TasksGetResponseStatus (readonly)
26 27 28 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 26 def status @status end |
#updated ⇒ DateTime (readonly)
36 37 38 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 36 def updated @updated end |
#workflow ⇒ Array<Object> (readonly)
40 41 42 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 40 def workflow @workflow end |
Class Method Details
.from_json(json_object:) ⇒ Ittybit::Tasks::TasksGetResponse
Deserialize a JSON object to an instance of TasksGetResponse
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 111 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] object = parsed_json["object"] kind = parsed_json["kind"] input = parsed_json["input"] = parsed_json["options"] output = parsed_json["output"] status = parsed_json["status"] progress = parsed_json["progress"] error = parsed_json["error"] created_by = parsed_json["created_by"] created = (DateTime.parse(parsed_json["created"]) unless parsed_json["created"].nil?) updated = (DateTime.parse(parsed_json["updated"]) unless parsed_json["updated"].nil?) parent_id = parsed_json["parent_id"] workflow = parsed_json["workflow"] if parsed_json["results"].nil? results = nil else results = parsed_json["results"].to_json results = Ittybit::Tasks::TasksGetResponseResults.from_json(json_object: results) end new( id: id, object: object, kind: kind, input: input, options: , output: output, status: status, progress: progress, error: error, created_by: created_by, created: created, updated: updated, parent_id: parent_id, workflow: workflow, results: results, 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.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 167 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.object.is_a?(String) != false || raise("Passed value for field obj.object is not the expected type, validation failed.") obj.kind.is_a?(Ittybit::Tasks::TasksGetResponseKind) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.") obj.input&.is_a?(Hash) != false || raise("Passed value for field obj.input is not the expected type, validation failed.") obj.&.is_a?(Hash) != false || raise("Passed value for field obj.options is not the expected type, validation failed.") obj.output&.is_a?(Hash) != false || raise("Passed value for field obj.output is not the expected type, validation failed.") obj.status.is_a?(Ittybit::Tasks::TasksGetResponseStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") obj.progress&.is_a?(Integer) != false || raise("Passed value for field obj.progress is not the expected type, validation failed.") obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.") obj.created_by&.is_a?(String) != false || raise("Passed value for field obj.created_by is not the expected type, validation failed.") obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.") obj.updated.is_a?(DateTime) != false || raise("Passed value for field obj.updated is not the expected type, validation failed.") obj.parent_id&.is_a?(String) != false || raise("Passed value for field obj.parent_id is not the expected type, validation failed.") obj.workflow&.is_a?(Array) != false || raise("Passed value for field obj.workflow is not the expected type, validation failed.") obj.results.nil? || Ittybit::Tasks::TasksGetResponseResults.validate_raw(obj: obj.results) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TasksGetResponse to a JSON object
157 158 159 |
# File 'lib/ittybit/tasks/types/tasks_get_response.rb', line 157 def to_json(*_args) @_field_set&.to_json end |