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
- #raw_data ⇒ Hash{String => Object} readonly
- #stacktrace ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(message:, code:, raw_data: OMIT, stacktrace: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowEventError constructor
- #to_json ⇒ String
Constructor Details
#initialize(message:, code:, raw_data: OMIT, stacktrace: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowEventError
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 30 def initialize(message:, code:, raw_data: OMIT, stacktrace: OMIT, additional_properties: nil) @message = @code = code @raw_data = raw_data if raw_data != OMIT @stacktrace = stacktrace if stacktrace != OMIT @additional_properties = additional_properties @_field_set = { "message": , "code": code, "raw_data": raw_data, "stacktrace": stacktrace }.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_event_error.rb', line 17 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 |
#raw_data ⇒ Hash{String => Object} (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 13 def raw_data @raw_data end |
#stacktrace ⇒ String (readonly)
15 16 17 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 15 def stacktrace @stacktrace end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowEventError
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 44 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"] raw_data = parsed_json["raw_data"] stacktrace = parsed_json["stacktrace"] new( message: , code: code, raw_data: raw_data, stacktrace: stacktrace, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
71 72 73 74 75 76 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 71 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.") obj.raw_data&.is_a?(Hash) != false || raise("Passed value for field obj.raw_data is not the expected type, validation failed.") obj.stacktrace&.is_a?(String) != false || raise("Passed value for field obj.stacktrace is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
62 63 64 |
# File 'lib/vellum_ai/types/workflow_event_error.rb', line 62 def to_json @_field_set&.to_json end |