+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
getAPIDocument <- function(){
- url <- "https://4xphq.arvadosapi.com/discovery/v1/apis/arvados/v1/rest"
+ url <- "https://jutro.arvadosapi.com/discovery/v1/apis/arvados/v1/rest"
serverResponse <- httr::RETRY("GET", url = url)
httr::content(serverResponse, as = "parsed", type = "application/json")
discoveryDocument <- getAPIDocument()
methodResources <- discoveryDocument$resources
+
+ # Don't emit deprecated APIs
+ methodResources <- methodResources[!(names(methodResources) %in% c("jobs", "job_tasks", "pipeline_templates", "pipeline_instances",
+ "keep_disks", "nodes", "humans", "traits", "specimens"))]
resourceNames <- names(methodResources)
methodDoc <- genMethodsDoc(methodResources, resourceNames)
arvadosAPIFooter)
fileConn <- file("./R/Arvados.R", "w")
+ writeLines(c(
+ "# Copyright (C) The Arvados Authors. All rights reserved.",
+ "#",
+ "# SPDX-License-Identifier: Apache-2.0", ""), fileConn)
writeLines(unlist(arvadosClass), fileConn)
close(fileConn)
NULL
getRequestHeaders <- function()
{
- c("headers <- list(Authorization = paste(\"OAuth2\", private$token), ",
+ c("headers <- list(Authorization = paste(\"Bearer\", private$token), ",
" \"Content-Type\" = \"application/json\")")
}
}, methodResources, resourceNames)))
projectDoc <- genProjectMethodsDoc()
-
+
c(methodsDoc, projectDoc)
}
methodNames[!(methodNames %in% c("index", "show", "destroy"))])
}, methodResources, resourceNames)))
-
+
hardcodedMethods <- c("projects.create", "projects.get",
"projects.list", "projects.update", "projects.delete")
- paste0("#' \t\\item{}{\\code{\\link{", sort(c(methodList, hardcodedMethods)), "}}}")
+ paste0("#' \t\\item{}{\\code{\\link{", sort(c(methodList, hardcodedMethods)), "}}}")
}
getMethodDoc <- function(methodName, methodMetaData)
className <- sapply(prop, function(ref) ref)
objectName <- paste0(tolower(substr(className, 1, 1)),
substr(className, 2, nchar(className)))
- paste("#' @param", objectName, className, "object.")
+ paste("#' @param", objectName, className, "object.")
})))
}
{
arg <- methodMetaData$parameters[[argName]]
argDescription <- arg$description
- paste("#' @param", argName, argDescription)
+ paste("#' @param", argName, argDescription)
})))
c(requestDoc, argsDoc)
{
if(length(args) > 1)
{
- args[1:(length(args) - 1)] <- paste0(args[1:(length(args) - 1)], ",")
+ args[1:(length(args) - 1)] <- paste0(args[1:(length(args) - 1)], ",")
}
args[1] <- paste0(prependAtStart, args[1])
argLines <- c(argLines, line)
}
-
+
argLines <- unlist(argLines)
argLinesLen <- length(argLines)
if(argLinesLen > 1)
- argLines[2:argLinesLen] <- paste0(prependToEachSplit, argLines[2:argLinesLen])
+ argLines[2:argLinesLen] <- paste0(prependToEachSplit, argLines[2:argLinesLen])
argLines
}