collection
},
- updateCollection = function(uuid, body)
+ updateCollection = function(uuid, newContent)
{
collectionURL <- paste0(private$host, "collections/", uuid)
headers <- list("Authorization" = paste("OAuth2", private$token),
"Content-Type" = "application/json")
+ body <- list(list())
names(body) <- c("collection")
+ body$collection <- newContent
+
body <- jsonlite::toJSON(body, auto_unbox = T)
serverResponse <- private$http$PUT(collectionURL, headers, body)
collection
},
- createCollection = function(body)
+ createCollection = function(content)
{
collectionURL <- paste0(private$host, "collections")
headers <- list("Authorization" = paste("OAuth2", private$token),
"Content-Type" = "application/json")
+ body <- list(list())
names(body) <- c("collection")
+ body$collection <- content
+
body <- jsonlite::toJSON(body, auto_unbox = T)
serverResponse <- private$http$POST(collectionURL, headers, body)
project
},
- createProject = function(body)
+ createProject = function(content)
{
projectURL <- paste0(private$host, "groups")
headers <- list("Authorization" = paste("OAuth2", private$token),
"Content-Type" = "application/json")
+ body <- list(list())
names(body) <- c("group")
- body$group <- c("group_class" = "project", body$group)
+ body$group <- c("group_class" = "project", content)
body <- jsonlite::toJSON(body, auto_unbox = T)
serverResponse <- private$http$POST(projectURL, headers, body)
project
},
- updateProject = function(uuid, body)
+ updateProject = function(uuid, newContent)
{
projectURL <- paste0(private$host, "groups/", uuid)
headers <- list("Authorization" = paste("OAuth2", private$token),
"Content-Type" = "application/json")
+ body <- list(list())
names(body) <- c("group")
+ body$group <- newContent
body <- jsonlite::toJSON(body, auto_unbox = T)
serverResponse <- private$http$PUT(projectURL, headers, body)
#Update collection:
-updatedCollection <- arv$updateCollection("uuid", list(list(name = "new_name", description = "new_desciption")))
+updatedCollection <- arv$updateCollection("uuid", list(name = "new_name", description = "new_desciption"))
--------------------------------------------------------------------------------------------------------------------------------
#Create collection:
-createdCollection <- arv$createCollection(list(list(name = "new_name", description = "new_desciption")))
+createdCollection <- arv$createCollection(list(name = "new_name", description = "new_desciption"))
--------------------------------------------------------------------------------------------------------------------------------
#Update project:
-updatedProject <- arv$updateProject("uuid", list(list(name = "new_name", description = "new_desciption")))
+updatedProject <- arv$updateProject("uuid", list(name = "new_name", description = "new_desciption"))
--------------------------------------------------------------------------------------------------------------------------------
#Create project:
-createdProject <- arv$createProject(list(list(name = "project_name", description = "project_desciption")))
+createdProject <- arv$createProject(list(name = "project_name", description = "project_desciption"))
--------------------------------------------------------------------------------------------------------------------------------