From 88e1f1d8effc5888ad8e6175ed2e32fbc9cec851 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Thu, 12 Sep 2024 15:28:31 -0400 Subject: [PATCH] 21909: Add project_exists method to generateApi.R This gets generateApi.R to generate the method added in de8cd4c6a56cac85dbcf7fe1fcb29abe98fe9f18. Arvados-DCO-1.1-Signed-off-by: Brett Smith --- sdk/R/generateApi.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sdk/R/generateApi.R b/sdk/R/generateApi.R index 2dbc74b07d..7e7f65f04c 100644 --- a/sdk/R/generateApi.R +++ b/sdk/R/generateApi.R @@ -150,6 +150,18 @@ genProjectMethods <- function(methodResources) "\t\t{", paste("\t\t\tself$groups_delete(", toCallArgs(deleteArgs), ")", sep=""), "\t\t},", + "", + "\t\t#' @description Test whether or not a project exists.", + getMethodParams(groupsMethods[["get"]]), + getMethodSignature("project_exist", getArgs), + "\t\t{", + paste("\t\t\tresult <- try(self$groups_get(", toCallArgs(getArgs), "))", sep=""), + "\t\t\tif(inherits(result, \"try-error\"))", + "\t\t\t\texists <- FALSE", + "\t\t\telse", + "\t\t\t\texists <- result['group_class'] == \"project\"", + "\t\t\tcat(format(exists))", + "\t\t},", "") } -- 2.30.2