Class: Vellum::WorkflowExecutionInitiatedBody
- Inherits:
-
Object
- Object
- Vellum::WorkflowExecutionInitiatedBody
- Defined in:
- lib/vellum_ai/types/workflow_execution_initiated_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #inputs ⇒ Hash{String => Object} readonly
- #workflow_definition ⇒ Vellum::VellumCodeResourceDefinition readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(workflow_definition:, inputs:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionInitiatedBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(workflow_definition:, inputs:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionInitiatedBody
24 25 26 27 28 29 |
# File 'lib/vellum_ai/types/workflow_execution_initiated_body.rb', line 24 def initialize(workflow_definition:, inputs:, additional_properties: nil) @workflow_definition = workflow_definition @inputs = inputs @additional_properties = additional_properties @_field_set = { "workflow_definition": workflow_definition, "inputs": inputs } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
13 14 15 |
# File 'lib/vellum_ai/types/workflow_execution_initiated_body.rb', line 13 def additional_properties @additional_properties end |
#inputs ⇒ Hash{String => Object} (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/workflow_execution_initiated_body.rb', line 11 def inputs @inputs end |
#workflow_definition ⇒ Vellum::VellumCodeResourceDefinition (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/workflow_execution_initiated_body.rb', line 9 def workflow_definition @workflow_definition end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowExecutionInitiatedBody
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/vellum_ai/types/workflow_execution_initiated_body.rb', line 34 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 inputs = parsed_json["inputs"] new( workflow_definition: workflow_definition, inputs: inputs, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
62 63 64 65 |
# File 'lib/vellum_ai/types/workflow_execution_initiated_body.rb', line 62 def self.validate_raw(obj:) Vellum::VellumCodeResourceDefinition.validate_raw(obj: obj.workflow_definition) obj.inputs.is_a?(Hash) != false || raise("Passed value for field obj.inputs is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
53 54 55 |
# File 'lib/vellum_ai/types/workflow_execution_initiated_body.rb', line 53 def to_json @_field_set&.to_json end |