Class: Vellum::RejectedWorkflowNodeResultEvent
- Inherits:
-
Object
- Object
- Vellum::RejectedWorkflowNodeResultEvent
- Defined in:
- lib/vellum_ai/types/rejected_workflow_node_result_event.rb
Overview
An event that indicates that the node has rejected 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
- #error ⇒ Vellum::WorkflowEventError readonly
- #id ⇒ String 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, error:, additional_properties: nil) ⇒ Vellum::RejectedWorkflowNodeResultEvent constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, node_id:, node_result_id:, state:, ts: OMIT, data: OMIT, source_execution_id: OMIT, error:, additional_properties: nil) ⇒ Vellum::RejectedWorkflowNodeResultEvent
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vellum_ai/types/rejected_workflow_node_result_event.rb', line 45 def initialize(id:, node_id:, node_result_id:, state:, ts: OMIT, data: OMIT, source_execution_id: OMIT, error:, 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 @error = error @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, "error": error }.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/rejected_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/rejected_workflow_node_result_event.rb', line 22 def data @data end |
#error ⇒ Vellum::WorkflowEventError (readonly)
26 27 28 |
# File 'lib/vellum_ai/types/rejected_workflow_node_result_event.rb', line 26 def error @error end |
#id ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/rejected_workflow_node_result_event.rb', line 12 def id @id end |
#node_id ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/rejected_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/rejected_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/rejected_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/rejected_workflow_node_result_event.rb', line 18 def state @state end |
#ts ⇒ DateTime (readonly)
20 21 22 |
# File 'lib/vellum_ai/types/rejected_workflow_node_result_event.rb', line 20 def ts @ts end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::RejectedWorkflowNodeResultEvent
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 98 99 |
# File 'lib/vellum_ai/types/rejected_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"] unless parsed_json["error"].nil? error = parsed_json["error"].to_json error = Vellum::WorkflowEventError.from_json(json_object: error) else error = nil 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, error: error, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
112 113 114 115 116 117 118 119 120 121 |
# File 'lib/vellum_ai/types/rejected_workflow_node_result_event.rb', line 112 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.") Vellum::WorkflowEventError.validate_raw(obj: obj.error) end |
Instance Method Details
#to_json ⇒ String
103 104 105 |
# File 'lib/vellum_ai/types/rejected_workflow_node_result_event.rb', line 103 def to_json @_field_set&.to_json end |