@@ -174,7 +174,7 @@ get_users <- function(
174
174
# ' Applies only to executable content types - not static.
175
175
# ' * `owner_guid`: The unique identifier for the owner
176
176
# ' * `content_url`: The URL associated with this content. Computed
177
- # ' from the associated vanity URL or GUID for this content.
177
+ # ' from the GUID for this content.
178
178
# ' * `dashboard_url`: The URL within the Connect dashboard where
179
179
# ' this content can be configured. Computed from the GUID for this content.
180
180
# ' * `role`: The relationship of the accessing user to this
@@ -183,7 +183,24 @@ get_users <- function(
183
183
# ' permitted to view the content. A none role is returned for
184
184
# ' administrators who cannot view the content but are permitted to view
185
185
# ' its configuration. Computed at the time of the request.
186
- # ' * `id`: The internal numeric identifier of this content item
186
+ # ' * `vanity_url`: The vanity URL associated with this content item.
187
+ # ' * `id`: The internal numeric identifier of this content item.
188
+ # ' * `tags`: Tags associated with this content item. Each entry is a list
189
+ # ' with the following fields:
190
+ # ' * `id`: The identifier for the tag.
191
+ # ' * `name`: The name of the tag.
192
+ # ' * `parent_id`: The identifier for the parent tag. Null if the tag is a
193
+ # ' top-level tag.
194
+ # ' * `created_time`: The timestamp (RFC3339) indicating when the tag was
195
+ # ' created.
196
+ # ' * `updated_time`: The timestamp (RFC3339) indicating when the tag was
197
+ # ' last updated.
198
+ # ' * `owner`: Basic details about the owner of this content item. Each entry
199
+ # ' is a list with the following fields:
200
+ # ' * `guid`: The user's GUID, or unique identifier, in UUID RFC4122 format.
201
+ # ' * `username`: The user's username.
202
+ # ' * `first_name`: The user's first name.
203
+ # ' * `last_name`: The user's last name.
187
204
# '
188
205
# ' @details
189
206
# ' Please see https://docs.posit.co/connect/api/#get-/v1/content for more
@@ -208,7 +225,24 @@ get_content <- function(
208
225
) {
209
226
validate_R6_class(src , " Connect" )
210
227
211
- res <- src $ content(guid = guid , owner_guid = owner_guid , name = name )
228
+ # The capability to return vanity URLs `vanity_url` was added in Connect
229
+ # v2024.06.0.
230
+ if (compare_connect_version(src $ version , " 2024.06.0" ) < 0 ) {
231
+ include <- " tags,owner"
232
+ content_ptype <- connectapi_ptypes $ content [,
233
+ names(connectapi_ptypes $ content ) != " vanity_url"
234
+ ]
235
+ } else {
236
+ include <- " tags,owner,vanity_url"
237
+ content_ptype <- connectapi_ptypes $ content
238
+ }
239
+
240
+ res <- src $ content(
241
+ guid = guid ,
242
+ owner_guid = owner_guid ,
243
+ name = name ,
244
+ include = include
245
+ )
212
246
213
247
if (! is.null(guid )) {
214
248
# convert a single item to a list
@@ -219,7 +253,7 @@ get_content <- function(
219
253
res <- res %> % purrr :: keep(.p = .p )
220
254
}
221
255
222
- out <- parse_connectapi_typed(res , connectapi_ptypes $ content )
256
+ out <- parse_connectapi_typed(res , content_ptype )
223
257
224
258
return (out )
225
259
}
0 commit comments