Class: Vellum::CheckWorkflowExecutionStatusResponse

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

Overview

Response serializer for workflow execution status check.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, outputs: OMIT, error: OMIT, execution_id:, execution_detail_url: OMIT, additional_properties: nil) ⇒ Vellum::CheckWorkflowExecutionStatusResponse

Parameters:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/vellum_ai/types/check_workflow_execution_status_response.rb', line 35

def initialize(status:, outputs: OMIT, error: OMIT, execution_id:, execution_detail_url: OMIT, additional_properties: nil)
  @status = status
  @outputs = outputs if outputs != OMIT
  @error = error if error != OMIT
  @execution_id = execution_id
  @execution_detail_url = execution_detail_url if execution_detail_url != OMIT
  @additional_properties = additional_properties
  @_field_set = { "status": status, "outputs": outputs, "error": error, "execution_id": execution_id, "execution_detail_url": execution_detail_url }.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



21
22
23
# File 'lib/vellum_ai/types/check_workflow_execution_status_response.rb', line 21

def additional_properties
  @additional_properties
end

#error ⇒ Vellum::CheckWorkflowExecutionStatusError (readonly)



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

def error
  @error
end

#execution_detail_url ⇒ String (readonly)

Returns:

  • (String)


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

def execution_detail_url
  @execution_detail_url
end

#execution_id ⇒ String (readonly)

Returns:

  • (String)


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

def execution_id
  @execution_id
end

#outputs ⇒ Hash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


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

def outputs
  @outputs
end

#status ⇒ Vellum::WorkflowResultEventState (readonly)



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

def status
  @status
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::CheckWorkflowExecutionStatusResponse

Parameters:

  • json_object (String)

Returns:



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

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  status = parsed_json["status"]
  outputs = parsed_json["outputs"]
  unless parsed_json["error"].nil?
    error = parsed_json["error"].to_json
    error = Vellum::CheckWorkflowExecutionStatusError.from_json(json_object: error)
  else
    error = nil
  end
  execution_id = parsed_json["execution_id"]
  execution_detail_url = parsed_json["execution_detail_url"]
  new(
    status: status,
    outputs: outputs,
    error: error,
    execution_id: execution_id,
    execution_detail_url: execution_detail_url,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


84
85
86
87
88
89
90
# File 'lib/vellum_ai/types/check_workflow_execution_status_response.rb', line 84

def self.validate_raw(obj:)
  obj.status.is_a?(Vellum::WorkflowResultEventState) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.outputs&.is_a?(Hash) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.")
  obj.error.nil? || Vellum::CheckWorkflowExecutionStatusError.validate_raw(obj: obj.error)
  obj.execution_id.is_a?(String) != false || raise("Passed value for field obj.execution_id is not the expected type, validation failed.")
  obj.execution_detail_url&.is_a?(String) != false || raise("Passed value for field obj.execution_detail_url is not the expected type, validation failed.")
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


75
76
77
# File 'lib/vellum_ai/types/check_workflow_execution_status_response.rb', line 75

def to_json
  @_field_set&.to_json
end