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