class Vellum::RejectedExecuteWorkflowWorkflowResultEvent
The unsuccessful response from the Workflow execution containing an error specifying what went wrong.
def self.from_json(json_object:)
-
(RejectedExecuteWorkflowWorkflowResultEvent)-
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 ts = DateTime.parse(parsed_json["ts"]) 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, ts: ts, error: error, additional_properties: struct) end
def self.validate_raw(obj:)
-
(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.ts.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.") WorkflowEventError.validate_raw(obj: obj.error) end
def initialize(id:, ts:, error:, additional_properties: nil)
-
(RejectedExecuteWorkflowWorkflowResultEvent)-
Parameters:
-
additional_properties(OpenStruct) -- Additional properties unmapped to the current class definition -
error(WorkflowEventError) -- -
ts(DateTime) -- -
id(String) --
def initialize(id:, ts:, error:, additional_properties: nil) # @type [String] @id = id # @type [DateTime] @ts = ts # @type [WorkflowEventError] @error = error # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end
def to_json(*_args)
-
(JSON)-
def to_json(*_args) { "id": @id, "ts": @ts, "error": @error }.to_json end