item_move: Move item from one folder to another

View source: R/item_move.R

item_moveR Documentation

Move item from one folder to another

Description

Move item from one folder to another

Usage

item_move(sb_id, id_new, ..., session = current_session())

Arguments

sb_id

An sbitem object or a character ScienceBase ID corresponding to the item

id_new

Folder/item to move id to. A ScienceBase ID or something that can be coerced to a SB item ID by as.sbitem

...

Additional parameters are passed on to GET, POST, HEAD, PUT, or DELETE

session

Session object from authenticate_sb. Defaults to anonymous or last authenticated session

Value

An object of class sbitem. Same as id, but with new parent id

Examples

## Not run: 
# create 1st folder
(fold1 <- folder_create(user_id(), "bear123"))
(res <- item_create(fold1, "item-to-move"))

# create 2nd folder
(fold2 <- folder_create(user_id(), "bear456"))

# move item in 1st folder to 2nd folder
(res2 <- item_move(res, fold2))

# test identical
identical(res2$parentId, fold2$id)

## End(Not run)

sbtools documentation built on May 1, 2023, 1:07 a.m.