create_results_collections {galvanizer} | R Documentation |
Create, Update or Delete Results - Collections
create_results_collections(auth, name, ...)
update_results_collections(auth, collection_id, ...)
delete_results_collections(auth, collection_id)
auth |
Highbond authentication credentials, created from |
name |
The name of the Results object to create |
... |
List(s) to add additional data |
collection_id |
The ID number of the collection |
Each endpoint has a list of required elements, as listed in the parameters.
For optional data, such as attributes, you may pass additional lists. The top level name of this optional list should match the name of the json level to be added, with key-value pairs within the list. Ultimately, this list object will be added as a child json level, under the 'data' top level json.
For example: attributes
is a json is nested under data, and therefore
should be created as the name of the object. Then additional information
can be added to it as a key-value pair to the list.
If creating or updating, a data frame with the new details. When deleting, JSON response indicating success or failure.
update_results_collections
: Update a collection
delete_results_collections
: Delete a collection
## Not run:
# Create and delete a Collection
auth <- setup_highbond(Sys.getenv('highbond_openapi'),
Sys.getenv('highbond_org'),
Sys.getenv('highbond_datacenter'))
name <- 'galvanizer Test Collection'
response <- create_results_collections(auth, name)
collection_id <- response$id[[1]]
response <- delete_results_collections(auth, collection_id)
# Create a Collection with attributes
myattr <- list(description = 'My first description')
response <- create_results_collections(auth, name, attributes = myattr)
collection_id <- response$id[[1]]
# Update a Collection with attributes
myattr <- list(name = 'galvanizer Super Test Collection', description = 'My second description')
response <- update_results_collections(auth, collection_id, attributes = myattr)
# Delete a Collection
response <- delete_results_collections(auth, collection_id)
## End(Not run)