Class: Vellum::WorkflowExecutionFulfilledBody

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workflow_definition:, outputs:, final_state: OMIT, server_metadata: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowExecutionFulfilledBody

Parameters:

  • workflow_definition (Vellum::VellumCodeResourceDefinition)
  • outputs (Hash{String => Object})
  • final_state (Hash{String => Object}) (defaults to: OMIT)
  • server_metadata (Hash{String => Object}) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



30
31
32
33
34
35
36
37
38
39
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 30

def initialize(workflow_definition:, outputs:, final_state: OMIT, server_metadata: OMIT, additional_properties: nil)
  @workflow_definition = workflow_definition
  @outputs = outputs
  @final_state = final_state if final_state != OMIT
  @server_metadata =  if  != OMIT
  @additional_properties = additional_properties
  @_field_set = { "workflow_definition": workflow_definition, "outputs": outputs, "final_state": final_state, "server_metadata":  }.reject do | _k, v |
  v == OMIT
end
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



17
18
19
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 17

def additional_properties
  @additional_properties
end

#final_stateHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


13
14
15
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 13

def final_state
  @final_state
end

#outputsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


11
12
13
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 11

def outputs
  @outputs
end

#server_metadataHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


15
16
17
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 15

def 
  @server_metadata
end

#workflow_definitionVellum::VellumCodeResourceDefinition (readonly)



9
10
11
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 9

def workflow_definition
  @workflow_definition
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::WorkflowExecutionFulfilledBody

Parameters:

  • json_object (String)

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 44

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  unless parsed_json["workflow_definition"].nil?
    workflow_definition = parsed_json["workflow_definition"].to_json
    workflow_definition = Vellum::VellumCodeResourceDefinition.from_json(json_object: workflow_definition)
  else
    workflow_definition = nil
  end
  outputs = parsed_json["outputs"]
  final_state = parsed_json["final_state"]
   = parsed_json["server_metadata"]
  new(
    workflow_definition: workflow_definition,
    outputs: outputs,
    final_state: final_state,
    server_metadata: ,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


76
77
78
79
80
81
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 76

def self.validate_raw(obj:)
  Vellum::VellumCodeResourceDefinition.validate_raw(obj: obj.workflow_definition)
  obj.outputs.is_a?(Hash) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.")
  obj.final_state&.is_a?(Hash) != false || raise("Passed value for field obj.final_state is not the expected type, validation failed.")
  obj.&.is_a?(Hash) != false || raise("Passed value for field obj.server_metadata is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


67
68
69
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 67

def to_json
  @_field_set&.to_json
end