Class: Vellum::InitiatedWorkflowNodeResultEvent
- Inherits:
-
Object
- Object
- Vellum::InitiatedWorkflowNodeResultEvent
- Defined in:
- lib/vellum_ai/types/initiated_workflow_node_result_event.rb
Overview
An event that indicates that the node has initiated its 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::WorkflowNodeResultData readonly
- #id ⇒ String readonly
- #input_values ⇒ Array<Vellum::NodeInputVariableCompiledValue> readonly
- #node_id ⇒ String readonly
- #node_result_id ⇒ String readonly
- #source_execution_id ⇒ String readonly
- #state ⇒ String readonly
- #ts ⇒ DateTime readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, node_id:, node_result_id:, state:, ts: OMIT, data: OMIT, source_execution_id: OMIT, input_values: OMIT, additional_properties: nil) ⇒ Vellum::InitiatedWorkflowNodeResultEvent constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, node_id:, node_result_id:, state:, ts: OMIT, data: OMIT, source_execution_id: OMIT, input_values: OMIT, additional_properties: nil) ⇒ Vellum::InitiatedWorkflowNodeResultEvent
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 45 def initialize(id:, node_id:, node_result_id:, state:, ts: OMIT, data: OMIT, source_execution_id: OMIT, input_values: OMIT, additional_properties: nil) @id = id @node_id = node_id @node_result_id = node_result_id @state = state @ts = ts if ts != OMIT @data = data if data != OMIT @source_execution_id = source_execution_id if source_execution_id != OMIT @input_values = input_values if input_values != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "node_id": node_id, "node_result_id": node_result_id, "state": state, "ts": ts, "data": data, "source_execution_id": source_execution_id, "input_values": input_values }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
28 29 30 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 28 def additional_properties @additional_properties end |
#data ⇒ Vellum::WorkflowNodeResultData (readonly)
22 23 24 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 22 def data @data end |
#id ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 12 def id @id end |
#input_values ⇒ Array<Vellum::NodeInputVariableCompiledValue> (readonly)
26 27 28 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 26 def input_values @input_values end |
#node_id ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 14 def node_id @node_id end |
#node_result_id ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 16 def node_result_id @node_result_id end |
#source_execution_id ⇒ String (readonly)
24 25 26 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 24 def source_execution_id @source_execution_id end |
#state ⇒ String (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 18 def state @state end |
#ts ⇒ DateTime (readonly)
20 21 22 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 20 def ts @ts end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::InitiatedWorkflowNodeResultEvent
63 64 65 66 67 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 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 63 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] node_id = parsed_json["node_id"] node_result_id = parsed_json["node_result_id"] state = parsed_json["state"] ts = unless parsed_json["ts"].nil? DateTime.parse(parsed_json["ts"]) else nil end unless parsed_json["data"].nil? data = parsed_json["data"].to_json data = Vellum::WorkflowNodeResultData.from_json(json_object: data) else data = nil end source_execution_id = parsed_json["source_execution_id"] input_values = parsed_json["input_values"]&.map do | item | item = item.to_json Vellum::NodeInputVariableCompiledValue.from_json(json_object: item) end new( id: id, node_id: node_id, node_result_id: node_result_id, state: state, ts: ts, data: data, source_execution_id: source_execution_id, input_values: input_values, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
110 111 112 113 114 115 116 117 118 119 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 110 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.node_id.is_a?(String) != false || raise("Passed value for field obj.node_id is not the expected type, validation failed.") obj.node_result_id.is_a?(String) != false || raise("Passed value for field obj.node_result_id is not the expected type, validation failed.") obj.state.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.") obj.data.nil? || Vellum::WorkflowNodeResultData.validate_raw(obj: obj.data) obj.source_execution_id&.is_a?(String) != false || raise("Passed value for field obj.source_execution_id is not the expected type, validation failed.") obj.input_values&.is_a?(Array) != false || raise("Passed value for field obj.input_values is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
101 102 103 |
# File 'lib/vellum_ai/types/initiated_workflow_node_result_event.rb', line 101 def to_json @_field_set&.to_json end |