R/users.R

Defines functions asn_users_find_all asn_users_find_by_workspace asn_users_find_by_id asn_users_me

Documented in asn_users_find_all asn_users_find_by_id asn_users_find_by_workspace asn_users_me

# DO NOT EDIT MANUALLY - This file is autogenerated from Asana API Specs
#' Users
#'
#'
#'  A _user_ object represents an account in Asana that can be given access to
#'  various workspaces, projects, and tasks.
#'  
#'  Like other objects in the system, users are referred to by numerical IDs.
#'  However, the special string identifier `me` can be used anywhere
#'  a user ID is accepted, to refer to the current authenticated user.
#' @name asn_users
#' @rdname asn_users
#' @family users
#' @seealso \link{https://asana.com/developers/api-reference/users}
NULL

#' Returns the full user record for the currently authenticated user.
#'
#' @param ...  {Object} Parameters for the request
#' @export
#' @family users
asn_users_me = function(..., options = list()){
  path =  "/users/me"
  asn_get(endpoint = path, ..., options = options)
}


#' Returns the full user record for the single user with the provided ID.
#'
#' @param user  {String} An identifier for the user. Can be one of an email address,
#' @param the globally unique identifier for the user, or the keyword `me`
#' @param to indicate the current user making the request.#'
#' @param ...  {Object} Parameters for the request
#' @export
#' @family users
asn_users_find_by_id = function(user, ..., options = list()){
  path = sprintf("/users/%s", user)
  asn_get(endpoint = path, ..., options = options)
}


#' Returns the user records for all users in the specified workspace or
#' organization.
#'
#' @param workspace  {Id} The workspace in which to get users.#'
#' @param ...  {Object} Parameters for the request
#' @export
#' @family users
asn_users_find_by_workspace = function(workspace, ..., options = list()){
  path = sprintf("/workspaces/%s/users", workspace)
  asn_get(endpoint = path, ..., options = options)
}


#' Returns the user records for all users in all workspaces and organizations
#' accessible to the authenticated user. Accepts an optional workspace ID
#' parameter.
#'
#' @param ...  {Object} Parameters for the request
#'    [workspace] : {Id} The workspace or organization to filter users on.
#' @export
#' @family users
asn_users_find_all = function(..., options = list()){
  path =  "/users"
  asn_get(endpoint = path, ..., options = options)
}
datacamp/asana documentation built on Sept. 18, 2023, 8:51 a.m.