Class: Vellum::FulfilledWorkflowNodeResultEvent
- Inherits:
-
Object
- Object
- Vellum::FulfilledWorkflowNodeResultEvent
- Defined in:
- lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb
Overview
An event that indicates that the node has fulfilled its execution.
Instance Attribute Summary collapse
-
#additional_properties ⇒ Object
readonly
Returns the value of attribute additional_properties.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#mocked ⇒ Object
readonly
Returns the value of attribute mocked.
-
#node_id ⇒ Object
readonly
Returns the value of attribute node_id.
-
#node_result_id ⇒ Object
readonly
Returns the value of attribute node_result_id.
-
#output_values ⇒ Object
readonly
Returns the value of attribute output_values.
-
#source_execution_id ⇒ Object
readonly
Returns the value of attribute source_execution_id.
-
#ts ⇒ Object
readonly
Returns the value of attribute ts.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ FulfilledWorkflowNodeResultEvent
Deserialize a JSON object to an instance of FulfilledWorkflowNodeResultEvent.
-
.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:, node_id:, node_result_id:, ts: nil, data: nil, source_execution_id: nil, output_values: nil, mocked: nil, additional_properties: nil) ⇒ FulfilledWorkflowNodeResultEvent constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of FulfilledWorkflowNodeResultEvent to a JSON object.
Constructor Details
#initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, source_execution_id: nil, output_values: nil, mocked: nil, additional_properties: nil) ⇒ FulfilledWorkflowNodeResultEvent
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 24 def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, source_execution_id: nil, output_values: nil, mocked: nil, additional_properties: nil) # @type [String] @id = id # @type [String] @node_id = node_id # @type [String] @node_result_id = node_result_id # @type [DateTime] @ts = ts # @type [WorkflowNodeResultData] @data = data # @type [String] @source_execution_id = source_execution_id # @type [Array<NodeOutputCompiledValue>] @output_values = output_values # @type [Boolean] @mocked = mocked # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end |
Instance Attribute Details
#additional_properties ⇒ Object (readonly)
Returns the value of attribute additional_properties.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def additional_properties @additional_properties end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def data @data end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def id @id end |
#mocked ⇒ Object (readonly)
Returns the value of attribute mocked.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def mocked @mocked end |
#node_id ⇒ Object (readonly)
Returns the value of attribute node_id.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def node_id @node_id end |
#node_result_id ⇒ Object (readonly)
Returns the value of attribute node_result_id.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def node_result_id @node_result_id end |
#output_values ⇒ Object (readonly)
Returns the value of attribute output_values.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def output_values @output_values end |
#source_execution_id ⇒ Object (readonly)
Returns the value of attribute source_execution_id.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def source_execution_id @source_execution_id end |
#ts ⇒ Object (readonly)
Returns the value of attribute ts.
11 12 13 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 11 def ts @ts end |
Class Method Details
.from_json(json_object:) ⇒ FulfilledWorkflowNodeResultEvent
Deserialize a JSON object to an instance of FulfilledWorkflowNodeResultEvent
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 50 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = struct.id node_id = struct.node_id node_result_id = struct.node_result_id ts = DateTime.parse(parsed_json["ts"]) if parsed_json["data"].nil? data = nil else data = parsed_json["data"].to_json data = WorkflowNodeResultData.from_json(json_object: data) end source_execution_id = struct.source_execution_id output_values = parsed_json["output_values"].map do |v| v = v.to_json NodeOutputCompiledValue.from_json(json_object: v) end mocked = struct.mocked new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data, source_execution_id: source_execution_id, output_values: output_values, mocked: mocked, 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.
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 93 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.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.") obj.data.nil? || 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.output_values&.is_a?(Array) != false || raise("Passed value for field obj.output_values is not the expected type, validation failed.") obj.mocked&.is_a?(Boolean) != false || raise("Passed value for field obj.mocked is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ JSON
Serialize an instance of FulfilledWorkflowNodeResultEvent to a JSON object
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb', line 76 def to_json(*_args) { "id": @id, "node_id": @node_id, "node_result_id": @node_result_id, "ts": @ts, "data": @data, "source_execution_id": @source_execution_id, "output_values": @output_values, "mocked": @mocked }.to_json end |