R/agnostic_exists.R

Defines functions csmpi_custom_exists csmpi_exists

Documented in csmpi_custom_exists csmpi_exists

#' Check if an object exits in the cloud with a custom cloud interface.
#'
#' @param cloud_interface CloudInterface object. The cloud interface to use.
#' @inheritParams csmpi_exists
#'
#' @export
csmpi_custom_exists <- function(key, cloud_interface, params) {
  cloud_interface$exists(key, params)
}

#' Check if an object exits in the cloud.
#'
#' @param key simple string. The key under which the object is stored.
#' @param cloud_name simple string. The name of the cloud interface to use.
#' @param params list. Additional params for the cloud interface's \code{exists}
#'   method.
#'
#' @export
csmpi_exists <- function(key, cloud_name, params) {
  cloud_interface <- DEFAULT_CLOUD_INTERFACES[[cloud_name]]
  exists(key, cloud_interface, params)
}
abelcastilloavant/csmpi documentation built on May 24, 2019, 7:21 p.m.