R/project_statuses.R

Defines functions asn_project_statuses_delete asn_project_statuses_find_by_id asn_project_statuses_find_by_project asn_project_statuses_create

Documented in asn_project_statuses_create asn_project_statuses_delete asn_project_statuses_find_by_id asn_project_statuses_find_by_project

# DO NOT EDIT MANUALLY - This file is autogenerated from Asana API Specs
#' ProjectStatuses
#'
#'
#'  A _project status_ is an update on the progress of a particular project, and is sent out to all project
#'  followers when created. These updates include both text describing the update and a color code intended to
#'  represent the overall state of the project: "green" for projects that are on track, "yellow" for projects
#'  at risk, and "red" for projects that are behind.
#'  
#'  Project statuses can be created and deleted, but not modified.
#' @name asn_project_statuses
#' @rdname asn_project_statuses
#' @family project_statuses
#' @seealso \link{https://asana.com/developers/api-reference/project_statuses}
NULL

#' Creates a new status update on the project.
#' 
#' Returns the full record of the newly created project status update.
#'
#' @param project  {Id} The project on which to create a status update.#'
#' @param ...  {Object} Data for the request
#'    text : {String} The text of the project status update.
#'    color : {String} The color to associate with the status update. Must be one of `"red"`, `"yellow"`, or `"green"`.
#' @export
#' @family project_statuses
asn_project_statuses_create = function(project, ..., options = list()){
  path = sprintf("/projects/%s/project_statuses", project)
  asn_post(endpoint = path, ..., options = options)
}


#' Returns the compact project status update records for all updates on the project.
#'
#' @param project  {Id} The project to find status updates for.#'
#' @param ...  {Object} Parameters for the request
#' @export
#' @family project_statuses
asn_project_statuses_find_by_project = function(project, ..., options = list()){
  path = sprintf("/projects/%s/project_statuses", project)
  asn_get(endpoint = path, ..., options = options)
}


#' Returns the complete record for a single status update.
#'
#' @param project-status  {Id} The project status update to get.#'
#' @param ...  {Object} Parameters for the request
#' @export
#' @family project_statuses
asn_project_statuses_find_by_id = function(project_status, ..., options = list()){
  path = sprintf("/project_statuses/%s", project_status)
  asn_get(endpoint = path, ..., options = options)
}


#' Deletes a specific, existing project status update.
#' 
#' Returns an empty data record.
#'
#' @param project-status  {Id} The project status update to delete.
#' @export
#' @family project_statuses
asn_project_statuses_delete = function(project_status, ..., options = list()){
  path = sprintf("/project_statuses/%s", project_status)
  asn_delete(endpoint = path, ..., options = options)
}
datacamp/asana documentation built on Sept. 18, 2023, 8:51 a.m.