Class: Vellum::ExecuteWorkflowResponse
- Inherits:
-
Object
- Object
- Vellum::ExecuteWorkflowResponse
- Defined in:
- lib/vellum_ai/types/execute_workflow_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #data ⇒ Vellum::ExecuteWorkflowWorkflowResultEvent readonly
- #execution_id ⇒ String readonly
- #external_id ⇒ String readonly
- #run_id ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(execution_id:, run_id: OMIT, external_id: OMIT, data:, additional_properties: nil) ⇒ Vellum::ExecuteWorkflowResponse constructor
- #to_json ⇒ String
Constructor Details
#initialize(execution_id:, run_id: OMIT, external_id: OMIT, data:, additional_properties: nil) ⇒ Vellum::ExecuteWorkflowResponse
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/vellum_ai/types/execute_workflow_response.rb', line 30 def initialize(execution_id:, run_id: OMIT, external_id: OMIT, data:, additional_properties: nil) @execution_id = execution_id @run_id = run_id if run_id != OMIT @external_id = external_id if external_id != OMIT @data = data @additional_properties = additional_properties @_field_set = { "execution_id": execution_id, "run_id": run_id, "external_id": external_id, "data": data }.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/execute_workflow_response.rb', line 17 def additional_properties @additional_properties end |
#data ⇒ Vellum::ExecuteWorkflowWorkflowResultEvent (readonly)
15 16 17 |
# File 'lib/vellum_ai/types/execute_workflow_response.rb', line 15 def data @data end |
#execution_id ⇒ String (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/execute_workflow_response.rb', line 9 def execution_id @execution_id end |
#external_id ⇒ String (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/execute_workflow_response.rb', line 13 def external_id @external_id end |
#run_id ⇒ String (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/execute_workflow_response.rb', line 11 def run_id @run_id end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::ExecuteWorkflowResponse
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/execute_workflow_response.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) execution_id = parsed_json["execution_id"] run_id = parsed_json["run_id"] external_id = parsed_json["external_id"] unless parsed_json["data"].nil? data = parsed_json["data"].to_json data = Vellum::ExecuteWorkflowWorkflowResultEvent.from_json(json_object: data) else data = nil end new( execution_id: execution_id, run_id: run_id, external_id: external_id, data: data, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
76 77 78 79 80 81 |
# File 'lib/vellum_ai/types/execute_workflow_response.rb', line 76 def self.validate_raw(obj:) obj.execution_id.is_a?(String) != false || raise("Passed value for field obj.execution_id is not the expected type, validation failed.") obj.run_id&.is_a?(String) != false || raise("Passed value for field obj.run_id is not the expected type, validation failed.") obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.") Vellum::ExecuteWorkflowWorkflowResultEvent.validate_raw(obj: obj.data) end |
Instance Method Details
#to_json ⇒ String
67 68 69 |
# File 'lib/vellum_ai/types/execute_workflow_response.rb', line 67 def to_json @_field_set&.to_json end |