Class: Vellum::WorkflowExecutionFulfilledBody
- Inherits:
-
Object
- Object
- Vellum::WorkflowExecutionFulfilledBody
- Defined in:
- lib/vellum_ai/types/workflow_execution_fulfilled_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #final_state ⇒ Hash{String => Object} readonly
- #outputs ⇒ Hash{String => Object} readonly
- #server_metadata ⇒ Hash{String => Object} readonly
- #workflow_definition ⇒ Vellum::VellumCodeResourceDefinition readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(workflow_definition:, outputs:, final_state: OMIT, server_metadata: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowExecutionFulfilledBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(workflow_definition:, outputs:, final_state: OMIT, server_metadata: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowExecutionFulfilledBody
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 30 def initialize(workflow_definition:, outputs:, final_state: OMIT, server_metadata: OMIT, additional_properties: nil) @workflow_definition = workflow_definition @outputs = outputs @final_state = final_state if final_state != OMIT @server_metadata = if != OMIT @additional_properties = additional_properties @_field_set = { "workflow_definition": workflow_definition, "outputs": outputs, "final_state": final_state, "server_metadata": }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 17 def additional_properties @additional_properties end |
#final_state ⇒ Hash{String => Object} (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 13 def final_state @final_state end |
#outputs ⇒ Hash{String => Object} (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 11 def outputs @outputs end |
#server_metadata ⇒ Hash{String => Object} (readonly)
15 16 17 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 15 def @server_metadata end |
#workflow_definition ⇒ Vellum::VellumCodeResourceDefinition (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 9 def workflow_definition @workflow_definition end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowExecutionFulfilledBody
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["workflow_definition"].nil? workflow_definition = parsed_json["workflow_definition"].to_json workflow_definition = Vellum::VellumCodeResourceDefinition.from_json(json_object: workflow_definition) else workflow_definition = nil end outputs = parsed_json["outputs"] final_state = parsed_json["final_state"] = parsed_json["server_metadata"] new( workflow_definition: workflow_definition, outputs: outputs, final_state: final_state, server_metadata: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
76 77 78 79 80 81 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 76 def self.validate_raw(obj:) Vellum::VellumCodeResourceDefinition.validate_raw(obj: obj.workflow_definition) obj.outputs.is_a?(Hash) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.") obj.final_state&.is_a?(Hash) != false || raise("Passed value for field obj.final_state is not the expected type, validation failed.") obj.&.is_a?(Hash) != false || raise("Passed value for field obj.server_metadata is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
67 68 69 |
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 67 def to_json @_field_set&.to_json end |