Skip to content

Commit 1ae7531

Browse files
authored
Merge pull request #28 from ScotGovAnalysis/dev-9007
Final tweaks before release
2 parents 130837b + 1c83a12 commit 1ae7531

38 files changed

Lines changed: 326 additions & 63 deletions

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: objr
22
Title: Wrapper for Objective APIs
3-
Version: 0.0.0.9006
3+
Version: 0.0.0.9007
44
Authors@R: c(
55
person("Scottish Government", , , "statistics.enquiries@gov.scot", role = "cph"),
66
person("Alice", "Hannah", , "alice.hannah@gov.scot", role = c("aut", "cre"))

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(add_participants)
4-
export(allow_bypass_2fa)
54
export(asset_info)
65
export(assets)
76
export(comments)
@@ -22,6 +21,7 @@ export(rollback_to_version)
2221
export(upload_file)
2322
export(upload_file_version)
2423
export(versions)
24+
export(workgroup_bypass_2fa)
2525
export(workspaces)
2626
export(write_data)
2727
export(write_data_version)

R/assets.R

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#' Get data frame of assets in workspace
22
#'
3+
#' @details
4+
#' More details on this endpoint are available in the
5+
# nolint start: line_length_linter
6+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/getAssets}{API documentation}.
7+
# nolint end
8+
#'
39
#' @param workspace_uuid UUID of workspace
410
#' @param type List of asset types to return. Defaults to all types;
511
#' document, folder and link.
612
#' @inheritParams objr
713
#' @inheritParams workspaces
814
#'
9-
#' @return Tibble
15+
#' @return A tibble
1016
#'
1117
#' @export
1218

@@ -37,10 +43,16 @@ assets <- function(workspace_uuid,
3743

3844
#' Get asset information
3945
#'
46+
#' @details
47+
#' More details on this endpoint are available in the
48+
# nolint start: line_length_linter
49+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/getAssetByUuid}{API documentation}.
50+
# nolint end
51+
#'
4052
#' @param asset_uuid UUID of asset
4153
#' @inheritParams objr
4254
#'
43-
#' @return Tibble
55+
#' @return A tibble
4456
#'
4557
#' @export
4658

@@ -62,11 +74,18 @@ asset_info <- function(asset_uuid,
6274

6375
#' Delete an asset
6476
#'
77+
#' @details
78+
#' More details on this endpoint are available in the
79+
# nolint start: line_length_linter
80+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/deleteAsset}{API documentation}.
81+
# nolint end
82+
#'
83+
#' Note: This functionality is disabled in Scottish Government workspaces.
84+
#'
6585
#' @param asset_uuid UUID of asset
6686
#' @inheritParams objr
6787
#'
68-
#' @details Note: Note: This functionality is disabled in Scottish Government
69-
#' workspaces.
88+
#' @return API response (invisibly)
7089
#'
7190
#' @export
7291

@@ -92,10 +111,18 @@ delete_asset <- function(asset_uuid,
92111

93112
#' Rename an asset
94113
#'
114+
#' @details
115+
#' More details on this endpoint are available in the
116+
# nolint start: line_length_linter
117+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/updateAssetName}{API documentation}.
118+
# nolint end
119+
#'
95120
#' @param asset_uuid UUID of asset
96121
#' @param new_name Character. New name to give asset.
97122
#' @inheritParams objr
98123
#'
124+
#' @return API response (invisibly)
125+
#'
99126
#' @export
100127

101128
rename_asset <- function(asset_uuid,

R/bypass_2fa.R

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
#' Allow/disallow bypassing of two-factor authentication for workgroup
22
#'
3-
#' @description More information on two-factor authentication can be found in
3+
#' @details
4+
#' More information on two-factor authentication can be found in
45
#' `vignette("two-factor")`.
56
#'
7+
#' More details on this endpoint are available in the
8+
# nolint start: line_length_linter
9+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Workgroups/setWorkgroupMfaBypassAllowed}{API documentation}.
10+
# nolint end
11+
#'
612
#' @param workgroup_uuid Workgroup UUID
713
#' @param allow_bypass Logical to indicate whether the workgroup should allow
814
#' selected participants to bypass two-factor authentication verification.
915
#' @inheritParams objr
1016
#'
17+
#' @return API response (invisibly)
18+
#'
1119
#' @export
1220

13-
allow_bypass_2fa <- function(workgroup_uuid,
14-
allow_bypass = TRUE,
15-
use_proxy = FALSE) {
21+
workgroup_bypass_2fa <- function(workgroup_uuid,
22+
allow_bypass = TRUE,
23+
use_proxy = FALSE) {
1624

1725
response <- objr(
1826
endpoint = "workgroups",
@@ -36,16 +44,25 @@ allow_bypass_2fa <- function(workgroup_uuid,
3644
#' Allow/disallow bypassing of two-factor authentication for workspace
3745
#' participant
3846
#'
39-
#' @description Note that this setting can only be updated by a workspace owner.
47+
#' @details
48+
#' This setting can only be updated by a workspace owner.
49+
#'
4050
#' More information on two-factor authentication can be found in
4151
#' `vignette("two-factor")`.
4252
#'
53+
#' More details on this endpoint are available in the
54+
# nolint start: line_length_linter
55+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Participants/setParticipantBypassMfa}{API documentation}.
56+
# nolint end
57+
#'
4358
#' @param participant_uuid Participant UUID (note that this is different to the
4459
#' user UUID)
4560
#' @param allow_bypass Logical to indicate whether the participant should be
4661
#' able to bypass two-factor authentication for workspace.
4762
#' @inheritParams objr
4863
#'
64+
#' @return API response (invisibly)
65+
#'
4966
#' @export
5067

5168
participant_bypass_2fa <- function(participant_uuid,

R/comments.R

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#' Get comments for workspaces of current user
22
#'
3+
#' @details
4+
#' More details on this endpoint are available in the
5+
# nolint start: line_length_linter
6+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Comments/getComments}{API documentation}.
7+
# nolint end
8+
#'
39
#' @param created_after Date (and optionally time) to filter comments created
410
#' since this date/time. If a time is not supplied, all comments made on this
511
#' day will be included.
@@ -8,7 +14,7 @@
814
#' @inheritParams objr
915
#' @inheritParams workspaces
1016
#'
11-
#' @return Data frame
17+
#' @return A tibble
1218
#'
1319
#' @examples
1420
#' \dontrun{
@@ -58,6 +64,12 @@ comments <- function(created_after = NULL,
5864

5965
#' Create a new thread
6066
#'
67+
#' @details
68+
#' More details on this endpoint are available in the
69+
# nolint start: line_length_linter
70+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Comments/createThread}{API documentation}.
71+
# nolint end
72+
#'
6173
#' @param workspace_uuid UUID of workspace
6274
#' @param text Character string to include in body of thread
6375
#' @param mentioned_assets UUID(s) of asset(s) to mention
@@ -97,6 +109,12 @@ new_thread <- function(workspace_uuid,
97109

98110
#' Create a new reply to a thread
99111
#'
112+
#' @details
113+
#' More details on this endpoint are available in the
114+
# nolint start: line_length_linter
115+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Comments/createReply}{API documentation}.
116+
# nolint end
117+
#'
100118
#' @param thread_uuid UUID of thread to reply to
101119
#' @inheritParams new_thread
102120
#' @inheritParams objr

R/create_folder.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#' Create a new folder
22
#'
3+
#' @details
4+
#' More details on this endpoint are available in the
5+
# nolint start: line_length_linter
6+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/createFolder}{API documentation}.
7+
# nolint end
8+
#'
39
#' @param folder_name Name to give new folder
410
#' @param workspace_uuid UUID of the workspace to create the new folder in
511
#' @param description Optional description of folder
@@ -8,6 +14,8 @@
814
#' of the workspace.
915
#' @inheritParams objr
1016
#'
17+
#' @return API response (invisibly)
18+
#'
1119
#' @export
1220

1321
create_folder <- function(folder_name,

R/documents.R

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#' Get data frame of document versions
22
#'
3+
#' @details
4+
#' More details on this endpoint are available in the
5+
# nolint start: line_length_linter
6+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/getVersionsByDocumentUuid}{API documentation}.
7+
# nolint end
8+
#'
39
#' @param document_uuid UUID of document (asset)
410
#' @inheritParams objr
511
#' @inheritParams workspaces
612
#'
7-
#' @return Data frame
13+
#' @return A tibble
814
#'
915
#' @export
1016

@@ -45,10 +51,18 @@ versions <- function(document_uuid,
4551

4652
#' Rollback a document to a previous version
4753
#'
54+
#' @details
55+
#' More details on this endpoint are available in the
56+
# nolint start: line_length_linter
57+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/rollbackDocument}{API documentation}.
58+
# nolint end
59+
#'
4860
#' @param document_uuid UUID of document (asset)
4961
#' @param version_uuid UUID of version to rollback to
5062
#' @inheritParams objr
5163
#'
64+
#' @return API response (invisibly)
65+
#'
5266
#' @export
5367

5468
rollback_to_version <- function(document_uuid,

R/download.R

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,21 @@ download_helper <- function(document_uuid,
5757
#' * Use `download_file_version()` with a document version UUID for a specific
5858
#' version of a document.
5959
#'
60+
#' @details
61+
#' More details on the endpoints used by these functions are available in the
62+
#' API documentation:
63+
# nolint start: line_length_linter
64+
#' * \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/download}{`download_file`}
65+
#' * \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/downloadVersion}{`download_file_version`}
66+
# nolint end
67+
#'
6068
#' @param document_uuid UUID of asset or document version
6169
#' @param folder Folder to save downloaded file to
6270
#' @param overwrite Logical to indicate whether file should be overwritten if
6371
#' already exists. Defaults to `FALSE`.
6472
#' @inheritParams objr
6573
#'
66-
#' @return An httr2 [httr2::response()][response] (invisibly)
74+
#' @return API response (invisibly)
6775
#'
6876
#' @export
6977

@@ -107,11 +115,8 @@ download_file_version <- function(document_uuid,
107115
#' * Use `read_data_version()` with a document version UUID for a specific
108116
#' version of a document.
109117
#'
110-
#' @param document_uuid UUID of asset or document version
111-
#' @param ... Additional arguments passed to read function. See details.
112-
#' @inheritParams objr
113-
#'
114-
#' @details This function can be used to read the following data file types:
118+
#' @details
119+
#' This function can be used to read the following data file types:
115120
#' csv, rds, xlsx.
116121
#'
117122
#' The function works by downloading the file from Objective Connect to a
@@ -132,7 +137,18 @@ download_file_version <- function(document_uuid,
132137
#' function, please \href{https://github.com/ScotGovAnalysis/objr/issues/new}{open an issue on the GitHub repository}.
133138
# nolint end
134139
#'
135-
#' @return For csv and xlsx files, a data frame. For rds files, an R object.
140+
#' More details on the endpoints used by these functions are available in the
141+
#' API documentation:
142+
# nolint start: line_length_linter
143+
#' * \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/download}{`read_data`}
144+
#' * \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Assets/downloadVersion}{`read_data_version`}
145+
# nolint end
146+
#'
147+
#' @param document_uuid UUID of asset or document version
148+
#' @param ... Additional arguments passed to read function. See details.
149+
#' @inheritParams objr
150+
#'
151+
#' @return Format depends on file type. See details.
136152
#'
137153
#' @export
138154

R/my_user_id.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#' Get user ID for current authenticated user
22
#'
3+
#' @details
4+
#' More details on this endpoint are available in the
5+
# nolint start: line_length_linter
6+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/Users/getCurrentUser}{API documentation}.
7+
# nolint end
8+
#'
39
#' @inheritParams objr
410
#'
511
#' @return A character value of the authenticated user's ID

R/objr.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#' Core request function
22
#'
3+
#' @details
4+
#' More details on endpoints are available in the
5+
# nolint start: line_length_linter
6+
#' \href{https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/}{API documentation}.
7+
# nolint end
8+
#'
39
#' @param endpoint The endpoint to append to the API server address
410
#' @param url_path A list of values to be added to the request URL path.
511
#' Values will be separated with `/`.
@@ -13,7 +19,7 @@
1319
#' @param content_type Content-Type header. Defaults to 'application/json'.
1420
#' @param use_proxy Logical to indicate whether to use proxy
1521
#'
16-
#' @return An httr2 [httr2::response()][response]
22+
#' @return API response
1723
#'
1824
#' @export
1925

0 commit comments

Comments
 (0)