From 638e8b997a17cecac6b57942b99534da946d5cf6 Mon Sep 17 00:00:00 2001 From: Scott Chamberlain Date: Wed, 5 Feb 2025 15:25:00 -0800 Subject: [PATCH] billing examples tgweaks --- R/billing.R | 7 ++++--- man/aws_billing.Rd | 2 +- man/aws_billing_raw.Rd | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/R/billing.R b/R/billing.R index cdd0e0f..aac56cf 100644 --- a/R/billing.R +++ b/R/billing.R @@ -47,7 +47,7 @@ #' - cost: cost in USD #' - acronym: short code for the service; if none known, this row #' will have the value in `service` -#' @examplesIf interactive() +#' @examplesIf interactive() && aws_has_creds() #' library(lubridate) #' library(dplyr) #' @@ -221,8 +221,9 @@ billing_blended <- billing_factory("BlendedCost") #' - GroupDefinitions #' - ResultsByTime #' - DimensionValueAttributes -#' @examplesIf interactive() -#' aws_billing_x(date_start = "2023-02-01", metrics = "BlendedCost") +#' @examplesIf interactive() && aws_has_creds() +#' library(lubridate) +#' aws_billing_raw(date_start = today() - days(3), metrics = "BlendedCost") aws_billing_raw <- function( date_start, metrics, granularity = "daily", filter = NULL, group_by = NULL, date_end = as.character(Sys.Date())) { diff --git a/man/aws_billing.Rd b/man/aws_billing.Rd index 51af59e..60046d3 100644 --- a/man/aws_billing.Rd +++ b/man/aws_billing.Rd @@ -65,7 +65,7 @@ Different filter criteria can be combined in different ways using \code{AND}, } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (interactive() && aws_has_creds()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} library(lubridate) library(dplyr) diff --git a/man/aws_billing_raw.Rd b/man/aws_billing_raw.Rd index 1b4abae..8ea4f42 100644 --- a/man/aws_billing_raw.Rd +++ b/man/aws_billing_raw.Rd @@ -42,8 +42,9 @@ list with slots for: Fetch billing data - rawest form } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} -aws_billing_x(date_start = "2023-02-01", metrics = "BlendedCost") +\dontshow{if (interactive() && aws_has_creds()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +library(lubridate) +aws_billing_raw(date_start = today() - days(3), metrics = "BlendedCost") \dontshow{\}) # examplesIf} } \seealso{