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, redacted: 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)
  • redacted (Boolean) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 33

def initialize(workflow_definition:, outputs:, final_state: OMIT, server_metadata: OMIT, redacted: OMIT, additional_properties: nil)
  @workflow_definition = workflow_definition
  @outputs = outputs
  @final_state = final_state if final_state != OMIT
  @server_metadata =  if  != OMIT
  @redacted = redacted if redacted != OMIT
  @additional_properties = additional_properties
  @_field_set = { "workflow_definition": workflow_definition, "outputs": outputs, "final_state": final_state, "server_metadata": , "redacted": redacted }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_properties ⇒ OpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct) —

    Additional properties unmapped to the current class definition



19
20
21
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 19

def additional_properties
  @additional_properties
end

#final_state ⇒ Hash{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

#outputs ⇒ Hash{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

#redacted ⇒ Boolean (readonly)

Returns:

  • (Boolean)


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

def redacted
  @redacted
end

#server_metadata ⇒ Hash{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_definition ⇒ Vellum::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:



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 48

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"]
  redacted = parsed_json["redacted"]
  new(
    workflow_definition: workflow_definition,
    outputs: outputs,
    final_state: final_state,
    server_metadata: ,
    redacted: redacted,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


82
83
84
85
86
87
88
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 82

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.")
  obj.redacted&.is_a?(Boolean) != false || raise("Passed value for field obj.redacted is not the expected type, validation failed.")
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


73
74
75
# File 'lib/vellum_ai/types/workflow_execution_fulfilled_body.rb', line 73

def to_json
  @_field_set&.to_json
end