R/team_drive.R

Defines functions is_team_drive as_team_drive team_drive_update team_drive_rm team_drive_create team_drive_get team_drive_find

Documented in as_team_drive is_team_drive team_drive_create team_drive_find team_drive_get team_drive_rm team_drive_update

#' Deprecated Team Drive functions
#'
#' @description
#' `r lifecycle::badge('deprecated')`
#' @template team-drives-description
#'
#' @inheritParams shared_drive_find
#' @inheritParams shared_drive_get
#' @inheritParams as_shared_drive
#' @inheritParams is_shared_drive
#' @template team_drive-plural
#'
#' @eval return_dribble("shared drive")
#'
#' @keywords internal
#' @name deprecated-team-drive-functions
NULL

#' @export
#' @rdname deprecated-team-drive-functions
team_drive_find <- function(pattern = NULL,
                            n_max = Inf,
                            ...,
                            verbose = deprecated()) {
  warn_for_verbose(verbose)
  lifecycle::deprecate_warn("2.0.0", "team_drive_find()", "shared_drive_find()")
  shared_drive_find(pattern = pattern, n_max = n_max, ...)
}

#' @export
#' @rdname deprecated-team-drive-functions
team_drive_get <- function(name = NULL, id = NULL, verbose = deprecated()) {
  warn_for_verbose(verbose)
  lifecycle::deprecate_warn("2.0.0", "team_drive_get()", "shared_drive_get()")
  shared_drive_get(name = name, id = id)
}

#' @export
#' @rdname deprecated-team-drive-functions
team_drive_create <- function(name, verbose = deprecated()) {
  warn_for_verbose(verbose)
  lifecycle::deprecate_warn("2.0.0", "team_drive_create()", "shared_drive_create()")
  shared_drive_create(name = name)
}

#' @export
#' @rdname deprecated-team-drive-functions
team_drive_rm <- function(team_drive = NULL, verbose = deprecated()) {
  warn_for_verbose(verbose)
  lifecycle::deprecate_warn("2.0.0", "team_drive_rm()", "shared_drive_rm()")
  shared_drive_rm(drive = team_drive)
}

#' @export
#' @rdname deprecated-team-drive-functions
team_drive_update <- function(team_drive, ..., verbose = deprecated()) {
  warn_for_verbose(verbose)
  lifecycle::deprecate_warn("2.0.0", "team_drive_update()", "shared_drive_update()")
  shared_drive_update(drive = team_drive, ...)
}

#' @export
#' @rdname deprecated-team-drive-functions
as_team_drive <- function(x, ...) {
  lifecycle::deprecate_warn("2.0.0", "as_team_drive()", "as_shared_drive()")
  as_shared_drive(x, ...)
}

#' @export
#' @rdname deprecated-team-drive-functions
is_team_drive <- function(d) {
  stopifnot(inherits(d, "dribble"))
  map_chr(d$drive_resource, "kind") == "drive#teamDrive"
}
tidyverse/googledrive documentation built on Jan. 14, 2024, 3:44 a.m.