R/schema_ProtectedRange.R

Defines functions as_tibble.googlesheets4_schema_ProtectedRange

#' @export
as_tibble.googlesheets4_schema_ProtectedRange <- function(x, ...) {
  grid_range <- new("GridRange", !!!pluck(x, "range"))
  grid_range <- as_tibble(grid_range)

  tibble::tibble(
    protected_range_id       = glean_int(x, "protectedRangeId"),
    description              = glean_chr(x, "description"),
    requesting_user_can_edit = glean_lgl(x, "requestingUserCanEdit"),
    warning_only             = glean_lgl(x, "warningOnly"),
    has_unprotected_ranges   = rlang::has_name(x, "unprotectedRanges"),
    editors                  = x$editors %||% list(),
    named_range_id           = glean_chr(x, "namedRangeId"),
    !!!grid_range
  )
}
jennybc/googlesheets2 documentation built on Dec. 10, 2023, 12:56 a.m.