-
Notifications
You must be signed in to change notification settings - Fork 12
/
entitylist_update.Rd
129 lines (101 loc) · 4.18 KB
/
entitylist_update.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/entitylist_update.R
\name{entitylist_update}
\alias{entitylist_update}
\title{Update Entity List details.}
\usage{
entitylist_update(
pid = get_default_pid(),
did = "",
approval_required = FALSE,
url = get_default_url(),
un = get_default_un(),
pw = get_default_pw(),
retries = get_retries(),
odkc_version = get_default_odkc_version(),
orders = c("YmdHMS", "YmdHMSz", "Ymd HMS", "Ymd HMSz", "Ymd", "ymd"),
tz = get_default_tz()
)
}
\arguments{
\item{pid}{The numeric ID of the project, e.g.: 2.
Default: \code{\link{get_default_pid}}.
Set default \code{pid} through \code{ru_setup(pid="...")}.
See \code{vignette("Setup", package = "ruODK")}.}
\item{did}{(chr) The name of the Entity List, internally called Dataset.
The function will error if this parameter is not given.
Default: "".}
\item{approval_required}{(lgl) The value to set \code{approvalRequired} to.
If TRUE, a Submission must be approved before an Entity is created,
if FALSE, an Entity is created as soon as the Submission is received by
ODK Central.
Default: \code{FALSE}.}
\item{url}{The ODK Central base URL without trailing slash.
Default: \code{\link{get_default_url}}.
Set default \code{url} through \code{ru_setup(url="...")}.
See \code{vignette("Setup", package = "ruODK")}.}
\item{un}{The ODK Central username (an email address).
Default: \code{\link{get_default_un}}.
Set default \code{un} through \code{ru_setup(un="...")}.
See \code{vignette("Setup", package = "ruODK")}.}
\item{pw}{The ODK Central password.
Default: \code{\link{get_default_pw}}.
Set default \code{pw} through \code{ru_setup(pw="...")}.
See \code{vignette("Setup", package = "ruODK")}.}
\item{retries}{The number of attempts to retrieve a web resource.
This parameter is given to \code{\link[httr]{RETRY}(times = retries)}.
Default: 3.}
\item{odkc_version}{The ODK Central version as a semantic version string
(year.minor.patch), e.g. "2023.5.1". The version is shown on ODK Central's
version page \verb{/version.txt}. Discard the "v".
\code{ruODK} uses this parameter to adjust for breaking changes in ODK Central.
Default: \code{\link{get_default_odkc_version}} or "2023.5.1" if unset.
Set default \code{get_default_odkc_version} through
\code{ru_setup(odkc_version="2023.5.1")}.
See \code{vignette("Setup", package = "ruODK")}.}
\item{orders}{(vector of character) Orders of datetime elements for
lubridate.
Default:
\code{c("YmdHMS", "YmdHMSz", "Ymd HMS", "Ymd HMSz", "Ymd", "ymd")}.}
\item{tz}{A timezone to convert dates and times to.
Read \code{vignette("setup", package = "ruODK")} to learn how \code{ruODK}'s
timezone can be set globally or per function.}
}
\value{
A list of lists following the exact format and naming of the API
response for \code{entitylist_detail}.
Since this nested list is so deeply nested and irregularly shaped
it is not trivial to rectangle the result into a tibble.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#maturing}{\figure{lifecycle-maturing.svg}{options: alt='[Maturing]'}}}{\strong{[Maturing]}}
}
\details{
You can only update \code{approvalRequired} using this endpoint.
The \code{approvalRequired} flag controls the Entity creation flow;
if it is true then the Submission must be approved before an Entity can be
created from it and if it is false then an Entity is created as soon as the
Submission is received by the ODK Central.
By default \code{approvalRequired} is false for the Entity Lists created after
v2023.3. Entity Lists created prior to that will have \code{approvalRequired} set
to true.
}
\examples{
\dontrun{
# See vignette("setup") for setup and authentication options
# ruODK::ru_setup(svc = "....svc", un = "me@email.com", pw = "...")
pid <- get_default_pid()
ds <- entitylist_list(pid = pid)
did <- ds$name[1]
ds1 <- entitylist_detail(pid = pid, did = did)
ds1$approvalRequired # FALSE
ds2 <- entitylist_update(pid = pid, did = did, approval_required = TRUE)
ds2$approvalRequired # TRUE
ds3 <- entitylist_update(pid = pid, did = did, approval_required = FALSE)
ds3$approvalRequired # FALSE
}
}
\seealso{
\url{ https://docs.getodk.org/central-api-dataset-management/#datasets}
}
\concept{dataset-management}