Class: Vellum::WorkflowExecutionSpanAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/workflow_execution_span_attributes.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label:, workflow_id:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionSpanAttributes

Parameters:

  • label (String)
  • workflow_id (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#labelString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/vellum_ai/types/workflow_execution_span_attributes.rb', line 8

def label
  @label
end

#workflow_idString (readonly)

Returns:

  • (String)


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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (String)


47
48
49
# File 'lib/vellum_ai/types/workflow_execution_span_attributes.rb', line 47

def to_json
  @_field_set&.to_json
end