Class: Vellum::WorkflowEventError
- Inherits:
-
Object
- Object
- Vellum::WorkflowEventError
- Defined in:
- lib/vellum_ai/types/workflow_event_error.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #code ⇒ Vellum::WorkflowExecutionEventErrorCode readonly
- #message ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(message:, code:, additional_properties: nil) ⇒ Vellum::WorkflowEventError constructor
- #to_json ⇒ String
Constructor Details
#initialize(message:, code:, additional_properties: nil) ⇒ Vellum::WorkflowEventError
24 25 26 27 28 29 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 24 def initialize(message:, code:, additional_properties: nil) @message = @code = code @additional_properties = additional_properties @_field_set = { "message": , "code": code } 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_event_error.rb', line 13 def additional_properties @additional_properties end |
#code ⇒ Vellum::WorkflowExecutionEventErrorCode (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 11 def code @code end |
#message ⇒ String (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 9 def @message end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowEventError
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 34 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) = parsed_json["message"] code = parsed_json["code"] new( message: , code: code, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
57 58 59 60 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 57 def self.validate_raw(obj:) obj..is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.") obj.code.is_a?(Vellum::WorkflowExecutionEventErrorCode) != false || raise("Passed value for field obj.code is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
48 49 50 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 48 def to_json @_field_set&.to_json end |