Class: Vellum::WorkflowExecutionNodeResultEvent
- Inherits:
-
Object
- Object
- Vellum::WorkflowExecutionNodeResultEvent
- Defined in:
- lib/vellum_ai/types/workflow_execution_node_result_event.rb
Overview
A NODE-level event emitted from the workflow’s execution.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #data ⇒ Vellum::WorkflowNodeResultEvent readonly
- #execution_id ⇒ String readonly
- #external_id ⇒ String readonly
- #run_id ⇒ String readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(execution_id:, run_id: OMIT, external_id: OMIT, type:, data:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionNodeResultEvent constructor
- #to_json ⇒ String
Constructor Details
#initialize(execution_id:, run_id: OMIT, external_id: OMIT, type:, data:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionNodeResultEvent
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 34 def initialize(execution_id:, run_id: OMIT, external_id: OMIT, type:, data:, additional_properties: nil) @execution_id = execution_id @run_id = run_id if run_id != OMIT @external_id = external_id if external_id != OMIT @type = type @data = data @additional_properties = additional_properties @_field_set = { "execution_id": execution_id, "run_id": run_id, "external_id": external_id, "type": type, "data": data }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 20 def additional_properties @additional_properties end |
#data ⇒ Vellum::WorkflowNodeResultEvent (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 18 def data @data end |
#execution_id ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 10 def execution_id @execution_id end |
#external_id ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 14 def external_id @external_id end |
#run_id ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 12 def run_id @run_id end |
#type ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 16 def type @type end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowExecutionNodeResultEvent
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 49 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) execution_id = parsed_json["execution_id"] run_id = parsed_json["run_id"] external_id = parsed_json["external_id"] type = parsed_json["type"] unless parsed_json["data"].nil? data = parsed_json["data"].to_json data = Vellum::WorkflowNodeResultEvent.from_json(json_object: data) else data = nil end new( execution_id: execution_id, run_id: run_id, external_id: external_id, type: type, data: data, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
83 84 85 86 87 88 89 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 83 def self.validate_raw(obj:) obj.execution_id.is_a?(String) != false || raise("Passed value for field obj.execution_id is not the expected type, validation failed.") obj.run_id&.is_a?(String) != false || raise("Passed value for field obj.run_id is not the expected type, validation failed.") obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") Vellum::WorkflowNodeResultEvent.validate_raw(obj: obj.data) end |
Instance Method Details
#to_json ⇒ String
74 75 76 |
# File 'lib/vellum_ai/types/workflow_execution_node_result_event.rb', line 74 def to_json @_field_set&.to_json end |