Class: Vellum::FulfilledExecuteWorkflowWorkflowResultEvent
- Inherits:
-
Object
- Object
- Vellum::FulfilledExecuteWorkflowWorkflowResultEvent
- Defined in:
- lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb
Overview
The successful response from the Workflow execution containing the produced outputs.
Instance Attribute Summary collapse
-
#additional_properties ⇒ Object
readonly
Returns the value of attribute additional_properties.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
-
#ts ⇒ Object
readonly
Returns the value of attribute ts.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ FulfilledExecuteWorkflowWorkflowResultEvent
Deserialize a JSON object to an instance of FulfilledExecuteWorkflowWorkflowResultEvent.
-
.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:, ts:, outputs:, additional_properties: nil) ⇒ FulfilledExecuteWorkflowWorkflowResultEvent constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of FulfilledExecuteWorkflowWorkflowResultEvent to a JSON object.
Constructor Details
#initialize(id:, ts:, outputs:, additional_properties: nil) ⇒ FulfilledExecuteWorkflowWorkflowResultEvent
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 17 def initialize(id:, ts:, outputs:, additional_properties: nil) # @type [String] @id = id # @type [DateTime] @ts = ts # @type [Array<WorkflowOutput>] @outputs = outputs # @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.
10 11 12 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 10 def additional_properties @additional_properties end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 10 def id @id end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
10 11 12 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 10 def outputs @outputs end |
#ts ⇒ Object (readonly)
Returns the value of attribute ts.
10 11 12 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 10 def ts @ts end |
Class Method Details
.from_json(json_object:) ⇒ FulfilledExecuteWorkflowWorkflowResultEvent
Deserialize a JSON object to an instance of FulfilledExecuteWorkflowWorkflowResultEvent
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 32 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = struct.id ts = DateTime.parse(parsed_json["ts"]) outputs = parsed_json["outputs"].map do |v| v = v.to_json WorkflowOutput.from_json(json_object: v) end new(id: id, ts: ts, outputs: outputs, 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.
55 56 57 58 59 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 55 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.ts.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.") obj.outputs.is_a?(Array) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ JSON
Serialize an instance of FulfilledExecuteWorkflowWorkflowResultEvent to a JSON object
47 48 49 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 47 def to_json(*_args) { "id": @id, "ts": @ts, "outputs": @outputs }.to_json end |