| prepare_items_for_bulk_import {sevenbridges2} | R Documentation |
Prepare items for bulk import
Description
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.
Usage
prepare_items_for_bulk_import(
volume_items,
destination_project = NULL,
destination_parent = NULL,
autorename = FALSE,
preserve_folder_structure = TRUE
)
Arguments
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 |
Details
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_projectordestination_parent -
autorename -
preserve_folder_structure
However, keep in mind that there are certain constraints:
The same
destination_project/destination_parentselection applies to all items in the resulting list.The same applies to
autorenameandpreserve_folder_structureparameters.This function doesn't allow specification of the
nameof 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 theprepare_items_for_bulk_importfunction you can manually add thenamefield to certain items if necessary.
Value
A list of elements containing information about each file/folder to be imported.
See Also
Imports, VolumeFile,
VolumePrefix
Examples
## 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)