class Vellum::RejectedWorkflowNodeResultEvent

An event that indicates that the node has rejected its execution.

def self.from_json(json_object:)

Returns:
  • (RejectedWorkflowNodeResultEvent) -

Parameters:
  • json_object (JSON) --
def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = struct.id
  node_id = struct.node_id
  node_result_id = struct.node_result_id
  ts = DateTime.parse(parsed_json["ts"])
  if parsed_json["data"].nil?
    data = nil
  else
    data = parsed_json["data"].to_json
    data = WorkflowNodeResultData.from_json(json_object: data)
  end
  source_execution_id = struct.source_execution_id
  if parsed_json["error"].nil?
    error = nil
  else
    error = parsed_json["error"].to_json
    error = WorkflowEventError.from_json(json_object: error)
  end
  new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
      source_execution_id: source_execution_id, error: error, additional_properties: struct)
end

def self.validate_raw(obj:)

Returns:
  • (Void) -

Parameters:
  • obj (Object) --
def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.node_id.is_a?(String) != false || raise("Passed value for field obj.node_id is not the expected type, validation failed.")
  obj.node_result_id.is_a?(String) != false || raise("Passed value for field obj.node_result_id is not the expected type, validation failed.")
  obj.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.")
  obj.data.nil? || WorkflowNodeResultData.validate_raw(obj: obj.data)
  obj.source_execution_id&.is_a?(String) != false || raise("Passed value for field obj.source_execution_id is not the expected type, validation failed.")
  WorkflowEventError.validate_raw(obj: obj.error)
end

def initialize(id:, node_id:, node_result_id:, error:, ts: nil, data: nil, source_execution_id: nil,

Returns:
  • (RejectedWorkflowNodeResultEvent) -

Parameters:
  • additional_properties (OpenStruct) -- Additional properties unmapped to the current class definition
  • error (WorkflowEventError) --
  • source_execution_id (String) --
  • data (WorkflowNodeResultData) --
  • ts (DateTime) --
  • node_result_id (String) --
  • node_id (String) --
  • id (String) --
def initialize(id:, node_id:, node_result_id:, error:, ts: nil, data: nil, source_execution_id: nil,
               additional_properties: nil)
  # @type [String]
  @id = id
  # @type [String]
  @node_id = node_id
  # @type [String]
  @node_result_id = node_result_id
  # @type [DateTime]
  @ts = ts
  # @type [WorkflowNodeResultData]
  @data = data
  # @type [String]
  @source_execution_id = source_execution_id
  # @type [WorkflowEventError]
  @error = error
  # @type [OpenStruct] Additional properties unmapped to the current class definition
  @additional_properties = additional_properties
end

def to_json(*_args)

Returns:
  • (JSON) -
def to_json(*_args)
  {
    "id": @id,
    "node_id": @node_id,
    "node_result_id": @node_result_id,
    "ts": @ts,
    "data": @data,
    "source_execution_id": @source_execution_id,
    "error": @error
  }.to_json
end