Class: Vellum::FulfilledExecuteWorkflowWorkflowResultEvent
- Inherits:
-
Object
- Object
- Vellum::FulfilledExecuteWorkflowWorkflowResultEvent
- Defined in:
- lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb
Overview
outputs.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #id ⇒ String readonly
- #outputs ⇒ Array<Vellum::WorkflowOutput> readonly
- #state ⇒ String readonly
- #ts ⇒ DateTime readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Vellum::FulfilledExecuteWorkflowWorkflowResultEvent
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(id:, state:, ts:, outputs:, additional_properties: nil) ⇒ Vellum::FulfilledExecuteWorkflowWorkflowResultEvent constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, state:, ts:, outputs:, additional_properties: nil) ⇒ Vellum::FulfilledExecuteWorkflowWorkflowResultEvent
33 34 35 36 37 38 39 40 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 33 def initialize(id:, state:, ts:, outputs:, additional_properties: nil) @id = id @state = state @ts = ts @outputs = outputs @additional_properties = additional_properties @_field_set = { "id": id, "state": state, "ts": ts, "outputs": outputs } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 20 def additional_properties @additional_properties end |
#id ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 12 def id @id end |
#outputs ⇒ Array<Vellum::WorkflowOutput> (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 18 def outputs @outputs end |
#state ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 14 def state @state end |
#ts ⇒ DateTime (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 16 def ts @ts end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::FulfilledExecuteWorkflowWorkflowResultEvent
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] state = parsed_json["state"] ts = unless parsed_json["ts"].nil? DateTime.parse(parsed_json["ts"]) else nil end outputs = parsed_json["outputs"]&.map do | item | item = item.to_json Vellum::WorkflowOutput.from_json(json_object: item) end new( id: id, state: state, ts: ts, outputs: outputs, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
81 82 83 84 85 86 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 81 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.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.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 ⇒ String
72 73 74 |
# File 'lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb', line 72 def to_json @_field_set&.to_json end |