-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
If we want to be strict about having exact 1 to 1 mappings with the API, we should have
list_projects()that callsGET /projects, andget_project()that callsGET /projects/project-id
The latter isn't that useful for data science, since I suspect you'll actually want to retrieve lots of projects at once to compare. I suggest instead having a higher level get_projects() that can return multiple projects at once. I think the pattern is:
#' @export
list_projects <- function(workspace, team, archived = FALSE) {
# some input checking
results <- call_asana_api("projects/", workspace = workspace, team = team, archived = archived)
# some flattening ...
flat_results
}
# internal only
get_project <- function(project_id) {
# checks
results <- call_asana_api("projects/", project_id)
# flattening
a_single_row_data_frame
}
#' @importFrom purrr map_df
#' @export
get_projects <- function(project_ids) {
map_df(project_ids, get_project)
}Metadata
Metadata
Assignees
Labels
No labels