From 10f9c9dbfb16b1f389f2b36263d2e4d27a1f7d28 Mon Sep 17 00:00:00 2001 From: gvill91 <57196403+gvill91@users.noreply.github.com> Date: Thu, 23 May 2024 11:08:41 -0400 Subject: [PATCH] Update s2api.R - add create checkpoint function Added create_checkpoint function so S2api.R (line 833) with option to add note. --- R/s2api.R | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/R/s2api.R b/R/s2api.R index 2278ff3..d44004b 100644 --- a/R/s2api.R +++ b/R/s2api.R @@ -830,4 +830,13 @@ MA_S2Api$set("public", "create_checkpoint", function(project_id, ret <- self$request(method="post",url=url,payload=pl) return(ret) }) - \ No newline at end of file + +MA_S2Api$set("public", "create_checkpoint", function(project_id, scenario_id, note="") { + stopifnot(is.character(project_id),length(project_id) == 1) + stopifnot(is.character(scenario_id),length(scenario_id) == 1) + pl <- list() + pl$note <- note + url <- paste0("/project/",project_id,"/scenario/",scenario_id,"/checkpoint") + ret <- self$request(method="post",url=url,payload=pl) + return(ret) +})