R/print.R

Defines functions print.WorkflowMetadataResponse print.StatusResponse print.VersionResponse print.StatsResponse print.WorkflowLogs print.WorkflowOutputs print.WorkflowIdAndStatus

#' @export
print.WorkflowIdAndStatus <- function(x, ...)
{
	cat("WorkflowIdAndStatus
status: ", x$status, "
id: ", x$id, "
", sep = "")
}

#' @export
print.WorkflowOutputs <- function(x, ...)
{
	files <- x[! names(x) %in% c("id", "host", "version")]
	cat("WorkflowOutputs
id: ", x$id, "
", if (length(files) != 0) paste0(names(files), ":\n  ", sapply(files, paste, sep = "\n  ", collapse = "\n  "), sep = "\n"), sep = "")
}

#' @export
print.WorkflowLogs <- function(x, ...)
{
	files <- x[! names(x) %in% c("id", "host", "version")]
	cat("WorkflowLogs
id: ", x$id, "
", if (length(files) != 0) paste0(names(files), ":\n  ", sapply(files, function(call) paste(names(call), ": ", call, sep = "", collapse = "\n  ")), sep = "\n"), sep = "")
}

#' @export
print.StatsResponse <- function(x, ...)
{
	cat("StatsResponse
workflows: ", x$workflows, "
jobs: ", x$jobs, "
", sep = "")
}

#' @export
print.VersionResponse <- function(x, ...)
{
	cat("StatsResponse
cromwell: ", x$cromwell, sep = "")
}

#' @export
print.StatusResponse <- function(x, ...)
{
	services <- x[! names(x) %in% c("host", "version")]
	cat("StatusResponse
", if (length(services) != 0) paste0(names(services), ":\n  ", sapply(services, function(message) paste(names(message), ": ", message, sep = "", collapse = "\n  ")), sep = "\n"), sep = "")
}

#' @export
print.WorkflowMetadataResponse <- function(x, ...)
{
	cat("WorkflowMetadataResponse
id: ", x$id, "
status: ", x$status, "
submission: ", x$submission, "
start: ", x$start, "
end: ", x$end, "
workflowName: ", x$workflowName, "
workflowRoot: ", x$workflowRoot, "
workflowLog: ", x$workflowLog, "
submittedFiles: ", length(x$submittedFiles), " elements
inputs: ", length(x$inputs), " inputs
outputs: ", length(x$outputs), " ouputs
labels: ", length(x$labels), " labels
failures: ", length(x$failures), " failures
calls: ", length(x$calls), " calls", sep="")
}
labbcb/CromwellClient documentation built on Aug. 16, 2020, 9:11 p.m.