View source: R/class-imports-utils.R
prepare_items_for_bulk_import | R Documentation |
Utility function to prepare the items
parameter, a list of
elements containing information about each file or folder to be imported
using the bulk_submit_import()
method.
prepare_items_for_bulk_import(
volume_items,
destination_project = NULL,
destination_parent = NULL,
autorename = FALSE,
preserve_folder_structure = TRUE
)
volume_items |
A list of |
destination_project |
Destination project ID or |
destination_parent |
Folder ID or |
autorename |
Logical indicating whether to autorename conflicting
files (default is |
preserve_folder_structure |
Logical indicating whether to preserve
folder structure. Set to |
Based on the provided list of VolumeFile
or
VolumePrefix
objects, this function allows you to set the
following fields for each item:
source_volume
source_location
destination_project
or destination_parent
autorename
preserve_folder_structure
However, keep in mind that there are certain constraints:
The same destination_project
/destination_parent
selection
applies to all items in the resulting list.
The same applies to autorename
and preserve_folder_structure
parameters.
This function doesn't allow specification of the name
of
aliases to create. This is something that should be specified per
item, therefore it cannot be applied to the entire list. However, once
you have the output of the prepare_items_for_bulk_import
function
you can manually add the name
field to certain items if necessary.
A list of elements containing information about each file/folder to be imported.
Imports
, VolumeFile
,
VolumePrefix
## Not run:
# Example 1: Prepare 2 items for bulk import action - provide destination
# project
volume_obj_1 <- a$volumes$get
volume_obj_2 <- a$volumes$get
volumes_to_import <- list(volume_obj_1, volume_obj_2)
destination_project <- a$projects$get(id = "project_id")
prepare_items_for_bulk_import(
volume_items = volumes_to_import,
destination_project = destination_project
)
## End(Not run)
## Not run:
# Example 2: Prepare 2 items for bulk import action - provide destination
# parent
volume_obj_1 <- a$volumes$get
volume_obj_2 <- a$volumes$get
volumes_to_import <- list(volume_obj_1, volume_obj_2)
destination_parent <- a$files$get(id = "folder_id")
prepare_items_for_bulk_import(
volume_items = volumes_to_import,
destination_parent = destination_parent
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.