Class: Vellum::RejectedExecuteWorkflowWorkflowResultEvent
- Inherits:
-
Object
- Object
- Vellum::RejectedExecuteWorkflowWorkflowResultEvent
- Defined in:
- lib/vellum_ai/types/rejected_execute_workflow_workflow_result_event.rb
Overview
The unsuccessful response from the Workflow execution containing an error specifying what went wrong.
Instance Attribute Summary collapse
-
#additional_properties ⇒ Object
readonly
Returns the value of attribute additional_properties.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ts ⇒ Object
readonly
Returns the value of attribute ts.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ RejectedExecuteWorkflowWorkflowResultEvent
Deserialize a JSON object to an instance of RejectedExecuteWorkflowWorkflowResultEvent.
-
.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:, error:, additional_properties: nil) ⇒ RejectedExecuteWorkflowWorkflowResultEvent constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of RejectedExecuteWorkflowWorkflowResultEvent to a JSON object.
Constructor Details
#initialize(id:, ts:, error:, additional_properties: nil) ⇒ RejectedExecuteWorkflowWorkflowResultEvent
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/vellum_ai/types/rejected_execute_workflow_workflow_result_event.rb', line 17 def initialize(id:, ts:, error:, additional_properties: nil) # @type [String] @id = id # @type [DateTime] @ts = ts # @type [WorkflowEventError] @error = error # @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/rejected_execute_workflow_workflow_result_event.rb', line 10 def additional_properties @additional_properties end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
10 11 12 |
# File 'lib/vellum_ai/types/rejected_execute_workflow_workflow_result_event.rb', line 10 def error @error end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/vellum_ai/types/rejected_execute_workflow_workflow_result_event.rb', line 10 def id @id end |
#ts ⇒ Object (readonly)
Returns the value of attribute ts.
10 11 12 |
# File 'lib/vellum_ai/types/rejected_execute_workflow_workflow_result_event.rb', line 10 def ts @ts end |
Class Method Details
.from_json(json_object:) ⇒ RejectedExecuteWorkflowWorkflowResultEvent
Deserialize a JSON object to an instance of RejectedExecuteWorkflowWorkflowResultEvent
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vellum_ai/types/rejected_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"]) if parsed_json["error"].nil? error = nil else error = parsed_json["error"].to_json error = WorkflowEventError.from_json(json_object: error) end new(id: id, ts: ts, error: error, 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.
57 58 59 60 61 |
# File 'lib/vellum_ai/types/rejected_execute_workflow_workflow_result_event.rb', line 57 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.") WorkflowEventError.validate_raw(obj: obj.error) end |
Instance Method Details
#to_json(*_args) ⇒ JSON
Serialize an instance of RejectedExecuteWorkflowWorkflowResultEvent to a JSON object
49 50 51 |
# File 'lib/vellum_ai/types/rejected_execute_workflow_workflow_result_event.rb', line 49 def to_json(*_args) { "id": @id, "ts": @ts, "error": @error }.to_json end |