Skip to content

Commit

Permalink
feat: add page_number argument to functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tin900 committed Jan 11, 2024
1 parent 9f83556 commit a411d75
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 25 deletions.
2 changes: 1 addition & 1 deletion R/download_view_filtered.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @export
#'
#' @family Tableau REST API
download_filtered_tableau_image <- function(tableau, df, view_id, path_to_save, api_version = "3.8") {
download_filtered_tableau_image <- function(tableau, df, view_id, path_to_save, api_version = 3.8) {
base_url <- tableau$base_url
token <- tableau$token
site_id <- tableau$site_id
Expand Down
7 changes: 5 additions & 2 deletions R/get_server_datasources.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#'
#' @param tableau A list containing the Tableau authentication variables: `base_url`, `token`, `user_id`, and `site_id`.
#' @param api_version The API version to use (default: 3.4).
#' @param page_number The page number of the results to retrieve (default: 1).
#' @param page_size The number of records to retrieve per page (default: 100).
#' @param include_metadata Logical indicating whether to include metadata columns in the result (default: FALSE).
#'
#' @return A data frame containing the datasource information.
#' @export
#'
#' @family Tableau REST API
get_server_datasources <- function(tableau, api_version = 3.4, page_size = 100, include_metadata = FALSE) {
get_server_datasources <- function(tableau, api_version = 3.4, page_number = 1, page_size = 100, include_metadata = FALSE) {
base_url <- tableau$base_url
token <- tableau$token
site_id <- tableau$site_id
Expand All @@ -23,7 +24,9 @@ get_server_datasources <- function(tableau, api_version = 3.4, page_size = 100,
"/sites/",
site_id,
"/datasources?fields=_all_&pageSize=",
page_size
page_size,
"&pageNumber=",
page_number
)

api_response <- httr::GET(
Expand Down
7 changes: 5 additions & 2 deletions R/get_server_groups.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#'
#' @param tableau A list containing the Tableau authentication variables: `base_url`, `token`, `user_id`, and `site_id`.
#' @param api_version The API version to use (default: 3.4).
#' @param page_number The page number of the results to retrieve (default: 1).
#' @param page_size The number of records to retrieve per page (default: 100).
#' @param include_metadata Logical indicating whether to include metadata columns in the result (default: FALSE).
#'
#' @return A data frame containing the groups information.
#' @export
#'
#' @family Tableau REST API
get_server_groups <- function(tableau, api_version = 3.4, page_size = 100, include_metadata = FALSE) {
get_server_groups <- function(tableau, api_version = 3.4, page_number = 1, page_size = 100, include_metadata = FALSE) {
base_url <- tableau$base_url
token <- tableau$token
site_id <- tableau$site_id
Expand All @@ -23,7 +24,9 @@ get_server_groups <- function(tableau, api_version = 3.4, page_size = 100, inclu
"/sites/",
site_id,
"/groups?fields=_all_&pageSize=",
page_size
page_size,
"&pageNumber=",
page_number
)

api_response <- httr::GET(
Expand Down
7 changes: 5 additions & 2 deletions R/get_server_jobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#'
#' @param tableau A list containing the Tableau authentication variables: base_url, token, user_id, and site_id.
#' @param api_version The API version to use (default: "3.4").
#' @param page_number The page number of the results to retrieve (default: 1).
#' @param page_size The number of jobs to retrieve per page (default: 100).
#' @param include_metadata Logical indicating whether to include metadata columns in the result (default: FALSE).
#'
#' @return A data frame containing the server jobs information.
#' @export
#'
#' @family Tableau REST API
get_server_jobs <- function(tableau, api_version = "3.4", page_size = 100, include_metadata = FALSE) {
get_server_jobs <- function(tableau, api_version = 3.4, page_number = 1, page_size = 100, include_metadata = FALSE) {
base_url <- tableau$base_url
token <- tableau$token
user_id <- tableau$user_id
Expand All @@ -24,7 +25,9 @@ get_server_jobs <- function(tableau, api_version = "3.4", page_size = 100, inclu
"/sites/",
site_id,
"/jobs?fields=_all_&pageSize=",
page_size
page_size,
"&pageNumber=",
page_number
)

api_response <- httr::GET(
Expand Down
7 changes: 5 additions & 2 deletions R/get_server_projects.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#'
#' @param tableau A list containing the Tableau authentication variables: base_url, token, site_id, and user_id.
#' @param api_version The API version to use (default: "3.4").
#' @param page_number The page number of the results to retrieve (default: 1).
#' @param page_size The number of projects to retrieve per page (default: 100).
#' @param include_metadata Logical indicating whether to include metadata columns in the result (default: FALSE).
#'
#' @return A data frame containing the projects information.
#' @export
#'
#' @family Tableau REST API
get_server_projects <- function(tableau, api_version = "3.4", page_size = 100, include_metadata = FALSE) {
get_server_projects <- function(tableau, api_version = 3.4, page_number = 1, page_size = 100, include_metadata = FALSE) {
base_url <- tableau$base_url
token <- tableau$token
user_id <- tableau$user_id
Expand All @@ -24,7 +25,9 @@ get_server_projects <- function(tableau, api_version = "3.4", page_size = 100, i
"/sites/",
site_id,
"/projects?fields=_all_&pageSize=",
page_size
page_size,
"&pageNumber=",
page_number
)

api_response <- httr::GET(
Expand Down
7 changes: 5 additions & 2 deletions R/get_server_schedules.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#'
#' @param tableau A list containing the Tableau authentication variables: `base_url` and `token`.
#' @param api_version The API version to use (default: 3.4).
#' @param page_number The page number of the results to retrieve (default: 1).
#' @param page_size The number of records to retrieve per page (default: 100).
#' @param include_metadata Logical indicating whether to include metadata columns in the result (default: FALSE).
#'
#' @return A data frame containing the schedules information.
#' @export
#'
#' @family Tableau REST API
get_server_schedules <- function(tableau, api_version = 3.4, page_size = 100, include_metadata = FALSE) {
get_server_schedules <- function(tableau, api_version = 3.4, page_number = 1, page_size = 100, include_metadata = FALSE) {
base_url <- tableau$base_url
token <- tableau$token

Expand All @@ -20,7 +21,9 @@ get_server_schedules <- function(tableau, api_version = 3.4, page_size = 100, in
"api/",
api_version,
"/schedules?fields=_all_&pageSize=",
page_size
page_size,
"&pageNumber=",
page_number
)

api_response <- httr::GET(
Expand Down
7 changes: 5 additions & 2 deletions R/get_server_users.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#'
#' @param tableau A list containing the Tableau authentication variables: `base_url`, `token`, `user_id`, and `site_id`.
#' @param api_version The API version to use (default: 3.4).
#' @param page_number The page number of the results to retrieve (default: 1).
#' @param page_size The number of users to retrieve per page (default: 100).
#' @param include_metadata Logical indicating whether to include metadata columns in the result (default: FALSE).
#'
#' @return A data frame containing the users information.
#' @export
#'
#' @family Tableau REST API
get_server_users <- function(tableau, api_version = "3.4", page_size = 100, include_metadata = FALSE) {
get_server_users <- function(tableau, api_version = 3.4, page_number = 1, page_size = 100, include_metadata = FALSE) {
base_url <- tableau$base_url
token <- tableau$token
site_id <- tableau$site_id
Expand All @@ -23,7 +24,9 @@ get_server_users <- function(tableau, api_version = "3.4", page_size = 100, incl
"/sites/",
site_id,
"/users?fields=_all_&pageSize=",
page_size
page_size,
"&pageNumber=",
page_number
)

api_response <- httr::GET(
Expand Down
7 changes: 5 additions & 2 deletions R/get_server_views.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#'
#' @param tableau A list containing the Tableau authentication variables: `base_url`, `token`, `user_id`, and `site_id`.
#' @param api_version The API version to use (default: 3.4).
#' @param page_number The page number of the results to retrieve (default: 1).
#' @param page_size The number of views to retrieve per page (default: 100).
#' @param include_statistics Logical indicating whether to include usage statistics in the result (default: TRUE).
#' @param include_metadata Logical indicating whether to include metadata columns in the result (default: FALSE).
Expand All @@ -12,7 +13,7 @@
#' @export
#'
#' @family Tableau REST API
get_server_views <- function(tableau, api_version = "3.4", page_size = 100, include_statistics = TRUE, include_metadata = FALSE) {
get_server_views <- function(tableau, api_version = 3.4, page_number = 1, page_size = 100, include_statistics = TRUE, include_metadata = FALSE) {
base_url <- tableau$base_url
token <- tableau$token
site_id <- tableau$site_id
Expand All @@ -26,7 +27,9 @@ get_server_views <- function(tableau, api_version = "3.4", page_size = 100, incl
"/views?fields=_all_&includeUsageStatistics=",
include_statistics,
"&pageSize=",
page_size
page_size,
"&pageNumber=",
page_number
)

api_response <- httr::GET(
Expand Down
7 changes: 5 additions & 2 deletions R/get_server_workbooks.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#'
#' @param tableau A list containing the Tableau authentication variables: `base_url`, `token`, `user_id`, and `site_id`.
#' @param api_version The API version to use (default: 3.4).
#' @param page_number The page number of the results to retrieve (default: 1).
#' @param page_size The number of workbooks to retrieve per page (default: 100).
#' @param include_metadata Logical indicating whether to include metadata columns in the result (default: FALSE).
#'
#' @return A data frame containing the workbooks information.
#' @export
#'
#' @family Tableau REST API
get_server_workbooks <- function(tableau, api_version = "3.4", page_size = 100, include_metadata = FALSE) {
get_server_workbooks <- function(tableau, api_version = 3.4, page_number = 1, page_size = 100, include_metadata = FALSE) {
base_url <- tableau$base_url
token <- tableau$token
site_id <- tableau$site_id
Expand All @@ -23,7 +24,9 @@ get_server_workbooks <- function(tableau, api_version = "3.4", page_size = 100,
"/sites/",
site_id,
"/workbooks?fields=_all_&pageSize=",
page_size
page_size,
"&pageNumber=",
page_number
)

api_response <- httr::GET(
Expand Down
2 changes: 1 addition & 1 deletion R/query_user_on_site.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @return Information about the specified user.
#' @export
#' @family Tableau REST API
query_user_on_site <- function(tableau, user_id, api_version = "3.19") {
query_user_on_site <- function(tableau, user_id, api_version = 3.19) {
base_url <- tableau$base_url
token <- tableau$token
site_id <- tableau$site_id
Expand Down
2 changes: 1 addition & 1 deletion man/download_filtered_tableau_image.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/get_server_datasources.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/get_server_groups.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/get_server_jobs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/get_server_projects.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/get_server_schedules.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/get_server_users.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/get_server_views.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/get_server_workbooks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a411d75

Please sign in to comment.