class Vellum::FulfilledWorkflowNodeResultEvent
An event that indicates that the node has fulfilled its execution.
def self.from_json(json_object:)
-
(FulfilledWorkflowNodeResultEvent)-
Parameters:
-
json_object(JSON) --
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
def self.validate_raw(obj:)
-
(Void)-
Parameters:
-
obj(Object) --
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
def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, source_execution_id: nil, output_values: nil,
-
(FulfilledWorkflowNodeResultEvent)-
Parameters:
-
additional_properties(OpenStruct) -- Additional properties unmapped to the current class definition -
mocked(Boolean) -- -
output_values(Array) -- -
source_execution_id(String) -- -
data(WorkflowNodeResultData) -- -
ts(DateTime) -- -
node_result_id(String) -- -
node_id(String) -- -
id(String) --
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
def to_json(*_args)
-
(JSON)-
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