class Vellum::WorkflowEventError

def self.from_json(json_object:)

Returns:
  • (WorkflowEventError) -

Parameters:
  • json_object (JSON) --
def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  message = struct.message
  code = WORKFLOW_EXECUTION_EVENT_ERROR_CODE.key(parsed_json["code"]) || parsed_json["code"]
  new(message: message, code: code, additional_properties: struct)
end

def self.validate_raw(obj:)

Returns:
  • (Void) -

Parameters:
  • obj (Object) --
def self.validate_raw(obj:)
  obj.message.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
  obj.code.is_a?(WORKFLOW_EXECUTION_EVENT_ERROR_CODE) != false || raise("Passed value for field obj.code is not the expected type, validation failed.")
end

def initialize(message:, code:, additional_properties: nil)

Returns:
  • (WorkflowEventError) -

Parameters:
  • additional_properties (OpenStruct) -- Additional properties unmapped to the current class definition
  • code (WORKFLOW_EXECUTION_EVENT_ERROR_CODE) --
  • message (String) --
def initialize(message:, code:, additional_properties: nil)
  # @type [String]
  @message = message
  # @type [WORKFLOW_EXECUTION_EVENT_ERROR_CODE]
  @code = code
  # @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)
  { "message": @message, "code": WORKFLOW_EXECUTION_EVENT_ERROR_CODE[@code] || @code }.to_json
end